Skip to content

Commit 4eb104f

Browse files
committed
chore(release): v0.1.0
1 parent c8c2156 commit 4eb104f

34 files changed

Lines changed: 4549 additions & 0 deletions
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Build Release
2+
on:
3+
push:
4+
tags:
5+
- 'v*'
6+
permissions:
7+
contents: write
8+
jobs:
9+
build-and-release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
- name: Install Rust
15+
uses: actions-rs/toolchain@v1
16+
with:
17+
toolchain: stable
18+
override: true
19+
- name: Build binary
20+
run: cargo build --release
21+
- name: Bundle binary with assets
22+
run: |
23+
mkdir -p release-bundle
24+
cp target/release/post-notes release-bundle/
25+
cp -r assets release-bundle/
26+
tar -czf post-notes-bundle.tar.gz -C release-bundle .
27+
- name: Upload release bundle
28+
uses: softprops/action-gh-release@v2
29+
with:
30+
files: post-notes-bundle.tar.gz
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33+
- name: Build docs
34+
run: |
35+
cargo doc --no-deps --release
36+
echo "<meta http-equiv=\"refresh\" content=\"0; url=post-notes\">" > target/doc/index.html
37+
- name: Deploy docs to GitHub Pages
38+
uses: peaceiris/actions-gh-pages@v3
39+
with:
40+
github_token: ${{ secrets.GITHUB_TOKEN }}
41+
publish_dir: ./target/doc
42+
publish_branch: gh-pages

.github/workflows/pull_request.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Pull Request Checks
2+
on:
3+
pull_request:
4+
branches:
5+
- main
6+
- dev
7+
jobs:
8+
build-and-test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
# Checkout the repository
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
# Install Rust toolchain
15+
- name: Install Rust
16+
uses: actions-rs/toolchain@v1
17+
with:
18+
profile: minimal
19+
toolchain: stable
20+
override: true
21+
# Install nextest
22+
- name: Install cargo-nextest
23+
uses: taiki-e/install-action@cargo-nextest
24+
# Run Clippy (linting)
25+
- name: Run Clippy
26+
run: cargo clippy --all-targets -- -D warnings
27+
# Check code formatting
28+
- name: Check formatting
29+
run: cargo fmt --all --check
30+
# Run tests with cargo-nextest
31+
- name: Run Tests
32+
run: cargo nextest run

.github/workflows/release.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
version:
6+
description: "Version to release (e.g., 1.2.3)"
7+
required: true
8+
type: string
9+
permissions:
10+
contents: write
11+
jobs:
12+
release:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
ref: dev
19+
- name: Validate version format
20+
run: |
21+
if ! [[ "${{ inputs.version }}" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
22+
echo "Invalid version format. Use semver: x.y.z"
23+
exit 1
24+
fi
25+
- name: Configure git
26+
run: |
27+
git config user.name "github-actions[bot]"
28+
git config user.email "github-actions[bot]@users.noreply.github.com"
29+
- name: Update Cargo.toml
30+
run: |
31+
sed -i 's/^version = .*/version = "${{ inputs.version }}"/' Cargo.toml
32+
- name: Update Cargo.lock
33+
run: |
34+
cargo update --workspace
35+
- name: Commit version update
36+
run: |
37+
git add Cargo.toml Cargo.lock
38+
git commit -m "chore(release): v${{ inputs.version }}"
39+
- name: Push to dev
40+
run: git push origin dev
41+
- name: Checkout main
42+
run: git checkout main && git pull origin main
43+
- name: Merge dev into main
44+
run: |
45+
git merge --no-ff dev -m "chore(release): v${{ inputs.version }}"
46+
- name: Push to main
47+
run: git push origin main
48+
- name: Sync dev with main
49+
run: |
50+
git checkout dev
51+
git merge main
52+
git push origin dev
53+
- name: Create tag
54+
run: |
55+
git tag -a "v${{ inputs.version }}" -m "Release version ${{ inputs.version }}"
56+
git push origin "v${{ inputs.version }}"
57+
- name: Create GitHub Release
58+
uses: actions/create-release@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
tag_name: v${{ inputs.version }}
63+
release_name: Release v${{ inputs.version }}
64+
draft: false
65+
prerelease: false

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
target/
2+
output/

0 commit comments

Comments
 (0)