Repository navigation
ci: add a Tag release workflow that bumps and pushes the release tag #51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
mosherBT
merged 7 commits into
master
from
brennanmosher/ide-86-sdk-release-process-improvement
Nov 11, 2026
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
b57a034
ci: add a Tag release workflow that bumps and pushes the release tag
mosherBT b5c30c2
comments
mosherBT 0355241
ci: fail the Tag release unless it matches optableVersionName
mosherBT 71f797b
Revert "ci: fail the Tag release unless it matches optableVersionName"
mosherBT 51e1f6d
comments
mosherBT c056067
Merge remote-tracking branch 'origin/master' into brennanmosher/ide-8…
mosherBT a615db4
build: take the SDK version from the JitPack tag instead of checking …
mosherBT File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,7 @@ on: | |
| tags: | ||
| - v[0-9]+.[0-9]+.[0-9]+ | ||
| - v[0-9]+.[0-9]+.[0-9]+-* | ||
| workflow_call: | ||
|
|
||
| jobs: | ||
| sdk-tests: | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,94 @@ | ||
| name: Tag release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| bump: | ||
| description: "Which part of the version to increment" | ||
| type: choice | ||
| options: | ||
| - minor | ||
| - major | ||
| - patch | ||
| default: minor | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| tag: | ||
| name: Tag master | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: write | ||
| outputs: | ||
| version: ${{ steps.next.outputs.version }} | ||
| steps: | ||
| - name: Refuse to release from anything but master | ||
| if: github.ref != 'refs/heads/master' | ||
| run: | | ||
| echo "::error::Release must run on master, got ${{ github.ref }}. Re-run and pick master." | ||
| exit 1 | ||
|
|
||
| - name: Checkout code | ||
| uses: actions/checkout@v5 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Compute next version | ||
| id: next | ||
| env: | ||
| BUMP: ${{ inputs.bump }} | ||
| run: | | ||
| set -euo pipefail | ||
| latest=$(git tag -l | grep -E '^v?[0-9]+\.[0-9]+\.[0-9]+$' | sed 's/^v//' | sort -V | tail -n1 || true) | ||
| latest=${latest:-0.0.0} | ||
| IFS=. read -r major minor patch <<<"${latest}" | ||
| case "$BUMP" in | ||
| major) major=$((major + 1)); minor=0; patch=0 ;; | ||
| minor) minor=$((minor + 1)); patch=0 ;; | ||
| patch) patch=$((patch + 1)) ;; | ||
| esac | ||
| version="v${major}.${minor}.${patch}" | ||
| echo "${latest} -> ${version}" | ||
| echo "version=${version}" >>"$GITHUB_OUTPUT" | ||
| { | ||
| echo "### Release \`${version}\`" | ||
| echo "" | ||
| echo "Previous: \`${latest}\` · bump: \`${BUMP}\` · commit: \`${GITHUB_SHA:0:7}\`" | ||
| } >>"$GITHUB_STEP_SUMMARY" | ||
|
|
||
| - name: Create and push tag | ||
| env: | ||
| VERSION: ${{ steps.next.outputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
| for tag in "${VERSION}" "${VERSION#v}"; do | ||
| if git rev-parse -q --verify "refs/tags/${tag}" >/dev/null; then | ||
| echo "::error::${tag} already exists. Someone tagged out of band." | ||
| exit 1 | ||
| fi | ||
| done | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | ||
| git tag -a "${VERSION}" -m "Release ${VERSION}" | ||
| git push origin "${VERSION}" | ||
|
mosherBT marked this conversation as resolved.
Resolved
|
||
|
|
||
| ci: | ||
| # Tags pushed with GITHUB_TOKEN don't trigger other workflows, so CI is called directly. | ||
| name: CI | ||
| needs: tag | ||
| uses: ./.github/workflows/android-sdk-ci.yml | ||
|
|
||
| release: | ||
| name: GitHub release | ||
| needs: [tag, ci] | ||
| runs-on: ubuntu-24.04 | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - name: Create release | ||
| env: | ||
| GH_TOKEN: ${{ github.token }} | ||
| VERSION: ${{ needs.tag.outputs.version }} | ||
| run: gh release create "${VERSION}" --repo "${GITHUB_REPOSITORY}" --verify-tag --title "${VERSION}" --generate-notes | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.