11name : Auto Release
22
3- # Automatically bump version, tag, and trigger release on every merge to master.
4- # During alpha, every PR merge gets its own release (alpha.N → alpha.N+1).
3+ # Automatically tag and release on every merge to master.
4+ # Uses CalVer: v2026.02.27.N-alpha (UTC date + daily build counter).
5+ # No commits to master — just tags the merge commit directly.
56
67on :
78 push :
89 branches : [master]
910
11+ # Change to "beta" or remove for stable releases.
12+ env :
13+ PRERELEASE_SUFFIX : alpha
14+
1015# Queue releases — don't cancel in-progress ones.
11- # Each merge gets its own version bump , processed sequentially.
16+ # Each merge gets its own tag , processed sequentially.
1217concurrency :
1318 group : auto-release
1419 cancel-in-progress : false
1520
1621jobs :
1722 auto-release :
18- name : Bump Version & Tag
23+ name : Tag & Release
1924 runs-on : ubuntu-latest
20- timeout-minutes : 10
21-
22- # Skip release commits to prevent infinite loop.
23- # The version bump commit starts with "chore: release v".
24- if : " !startsWith(github.event.head_commit.message, 'chore: release v')"
25+ timeout-minutes : 5
2526
2627 steps :
2728 - name : Checkout
@@ -31,58 +32,39 @@ jobs:
3132 fetch-depth : 0
3233 ref : master
3334
34- - name : Configure git
35+ - name : Derive release tag
36+ id : tag
3537 run : |
36- git config user.name "github-actions[bot]"
37- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
38-
39- - name : Install Rust
40- uses : dtolnay/rust-toolchain@stable
38+ TODAY=$(date -u +"%Y.%m.%d")
39+ COUNT=1
40+ while git rev-parse "refs/tags/v${TODAY}.${COUNT}-${PRERELEASE_SUFFIX}" &>/dev/null; do
41+ COUNT=$((COUNT + 1))
42+ done
43+ TAG="v${TODAY}.${COUNT}-${PRERELEASE_SUFFIX}"
44+ echo "tag=$TAG" >> $GITHUB_OUTPUT
45+ echo "Release tag: $TAG"
4146
42- - name : Determine version
43- id : version
47+ - name : Push tag
4448 run : |
45- CURRENT=$(grep -E '^version\s*=' Cargo.toml | head -1 | sed 's/.*=\s*"\([^"]*\)".*/\1/')
46- echo "current=$CURRENT" >> $GITHUB_OUTPUT
47-
48- if git rev-parse "refs/tags/v$CURRENT" &>/dev/null; then
49- # Tag exists — auto-increment
50- echo "Tag v$CURRENT already exists, auto-incrementing..."
51- echo "bumped=true" >> $GITHUB_OUTPUT
52- else
53- # Tag doesn't exist — version was set manually in a PR, or first release
54- echo "Tag v$CURRENT does not exist, using current version as-is"
55- echo "bumped=false" >> $GITHUB_OUTPUT
56- echo "new_version=$CURRENT" >> $GITHUB_OUTPUT
57- fi
49+ git tag "${{ steps.tag.outputs.tag }}"
50+ git push origin "${{ steps.tag.outputs.tag }}"
5851
59- - name : Bump version
60- if : steps.version.outputs.bumped == 'true'
61- run : ./scripts/release.sh --yes
62-
63- - name : Read new version
64- id : new_version
52+ - name : Create release with notes
53+ env :
54+ GH_TOKEN : ${{ secrets.ORILANG_RELEASE_TOKEN }}
6555 run : |
66- VERSION=$(grep -E '^version\s*=' Cargo.toml | head -1 | sed 's/.*=\s*"\([^"]*\)".*/\1/')
67- echo "version=$VERSION" >> $GITHUB_OUTPUT
68- echo "New version: $VERSION"
56+ TAG="${{ steps.tag.outputs.tag }}"
6957
70- - name : Regenerate lockfiles
71- if : steps.version.outputs.bumped == 'true'
72- run : |
73- cargo generate-lockfile
74- cargo generate-lockfile --manifest-path compiler/ori_llvm/Cargo.toml
75- cargo generate-lockfile --manifest-path compiler/ori_rt/Cargo.toml
76- cargo generate-lockfile --manifest-path tools/ori-lsp/Cargo.toml
77- cargo generate-lockfile --manifest-path website/playground-wasm/Cargo.toml
58+ # Find previous tag for release notes range
59+ PREV_TAG=$(git tag --sort=-creatordate | grep '^v' | sed -n '2p')
7860
79- - name : Commit version bump
80- if : steps.version.outputs.bumped == 'true'
81- run : |
82- git add -A
83- git commit -m "chore: release v${{ steps.new_version.outputs.version }}"
61+ NOTES_ARGS=""
62+ if [[ -n "$PREV_TAG" ]]; then
63+ NOTES_ARGS="--notes-start-tag $PREV_TAG"
64+ fi
8465
85- - name : Tag and push
86- run : |
87- git tag "v${{ steps.new_version.outputs.version }}"
88- git push origin master --tags
66+ gh release create "$TAG" \
67+ --title "Ori ${TAG#v}" \
68+ --generate-notes \
69+ $NOTES_ARGS \
70+ --prerelease
0 commit comments