-
Notifications
You must be signed in to change notification settings - Fork 4
release: prepare v1.1.0 #8
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
Merged
Changes from all commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
f7ceb6c
test checksum failures
Maxerns c5c006b
add release workflow
Maxerns 2655efd
document action releases
Maxerns 08217b0
explain checksum helpers
Maxerns 9c51d19
explain release history check
Maxerns 7ad5c5a
refresh release tags
Maxerns 890cd69
clarify release queue
Maxerns 1943cee
test checksum manifests
Maxerns 1318815
clarify action tags
Maxerns 2d507e8
test macOS checksums
Maxerns 1188ac2
tighten checksum parsing
Maxerns c78b226
fix checksum test harness
Maxerns 2b44a7c
fix Windows checksum parsing
Maxerns 7bb22fb
fix Windows checksum fixture
Maxerns 04acc09
clarify release major tag
Maxerns bc26420
pin checkout action
Maxerns 17427c5
normalize checksum case
Maxerns de65375
explain CDPATH clearing
Maxerns 579b509
refresh release tags
Maxerns 0f72ed3
trim checksum manifest lines
Maxerns be6404e
align release job names
Maxerns 378743e
explain PowerShell helper path
Maxerns c5552de
explain checksum parsing
Maxerns a62f8d9
explain Windows checksum tests
Maxerns 209aca4
simplify ancestry guard
Maxerns 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 |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| e80b71cd14d3cbd65f4173abcbfcf01a545dbca32a72d575108b553a648cc96f sotto-fixture |
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 @@ | ||
| fixture |
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,167 @@ | ||
| # Publishes an immutable `v1.x.y` action release, then moves the `v1` major convenience tag only | ||
| # after the full action test matrix succeeds. Dispatch this workflow from main with the exact tag. | ||
|
|
||
| name: release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| inputs: | ||
| version: | ||
| description: Exact action release tag (vMAJOR.MINOR.PATCH) | ||
| required: true | ||
| # v1.1.0 is the first numbered release; the existing v1 tag remains the moving bootstrap tag. | ||
| default: v1.1.0 | ||
| type: string | ||
|
|
||
| # Called tests and validation only need to read the checkout. The release job receives its narrower | ||
| # write grant below, so no other job can create or move tags. | ||
| permissions: | ||
| contents: read | ||
|
|
||
| # All action releases share one queue because each successful run may move the same major tag. GitHub | ||
| # keeps one active and one pending run; a newer pending dispatch may replace an older pending run, | ||
| # but it must never cancel an active run after that run has created the immutable release. | ||
| concurrency: | ||
| group: action-release | ||
| cancel-in-progress: false | ||
|
|
||
| # Keep the moving major tag separate from the exact release tag supplied at dispatch time. | ||
| env: | ||
| ACTION_MAJOR_TAG: v1 | ||
|
|
||
| jobs: | ||
| validate: | ||
| name: validate-release | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| # Full history and tags are required for the ancestry and forward-version guards below. | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Check release tag and commit | ||
| shell: bash | ||
| env: | ||
| RELEASE_TAG: ${{ inputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| if [[ ! "$RELEASE_TAG" =~ ^${ACTION_MAJOR_TAG}\.[0-9]+\.[0-9]+$ ]]; then | ||
| echo "error: version must be an exact ${ACTION_MAJOR_TAG} action release such as ${ACTION_MAJOR_TAG}.1.0" >&2 | ||
| exit 1 | ||
| fi | ||
| if [ "$GITHUB_REF" != "refs/heads/main" ]; then | ||
| echo "error: action releases must be dispatched from main" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Refresh remote tags explicitly so version and ancestry guards cannot use stale refs. | ||
| git fetch --force origin '+refs/tags/*:refs/tags/*' | ||
| if ! git rev-parse --verify --quiet "${ACTION_MAJOR_TAG}^{commit}" >/dev/null; then | ||
| echo "error: remote ${ACTION_MAJOR_TAG} convenience tag is missing" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| # A rerun may reuse an exact tag only when it already names this workflow commit. | ||
| if git rev-parse --verify --quiet "$RELEASE_TAG^{commit}" >/dev/null; then | ||
| if [ "$(git rev-parse "$RELEASE_TAG^{commit}")" != "$GITHUB_SHA" ]; then | ||
| echo "error: $RELEASE_TAG already points to another commit" >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # Before the first exact release, grep has no match; treat that as an empty history. | ||
| latest="$(git tag --list "${ACTION_MAJOR_TAG}.*.*" | \ | ||
| grep -E "^${ACTION_MAJOR_TAG}\.[0-9]+\.[0-9]+$" | sort -V | tail -n 1 || true)" | ||
| if [ -n "$latest" ]; then | ||
| newest="$(printf '%s\n%s\n' "$latest" "$RELEASE_TAG" | sort -V | tail -n 1)" | ||
| if [ "$newest" != "$RELEASE_TAG" ]; then | ||
| echo "error: $RELEASE_TAG would move $ACTION_MAJOR_TAG backwards from $latest" >&2 | ||
| exit 1 | ||
| fi | ||
| fi | ||
|
|
||
| # The major tag exists from the guard above; check its ancestry independently of version ordering. | ||
| if ! git merge-base --is-ancestor "${ACTION_MAJOR_TAG}^{commit}" "$GITHUB_SHA"; then | ||
| echo "error: ${ACTION_MAJOR_TAG} does not point to an ancestor of $GITHUB_SHA" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| test: | ||
| name: test-action | ||
| needs: validate | ||
| uses: ./.github/workflows/test.yml | ||
|
|
||
| release: | ||
| name: publish-release | ||
| needs: [validate, test] | ||
| runs-on: ubuntu-latest | ||
| # This job creates the exact release and updates the major convenience tag. | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| # Full history preserves the same ancestry guarantees when the queued release job starts. | ||
| - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 | ||
| with: | ||
| fetch-depth: 0 | ||
|
|
||
| - name: Create exact release | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RELEASE_TAG: ${{ inputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # The queued job may start after another ref update, so refresh the refs before tagging. | ||
| git fetch --force origin '+refs/tags/*:refs/tags/*' | ||
|
|
||
| # GitHub's bot identity keeps the annotated tag attributable without a maintainer key. | ||
| git config user.name 'github-actions[bot]' | ||
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
|
|
||
| if git rev-parse --verify --quiet "$RELEASE_TAG^{commit}" >/dev/null; then | ||
| test "$(git rev-parse "$RELEASE_TAG^{commit}")" = "$GITHUB_SHA" | ||
| else | ||
| git tag -a "$RELEASE_TAG" "$GITHUB_SHA" -m "$RELEASE_TAG" | ||
| git push origin "refs/tags/$RELEASE_TAG" | ||
| fi | ||
|
|
||
| # This guard makes reruns idempotent after the tag or release has already been created. | ||
| if ! gh release view "$RELEASE_TAG" >/dev/null 2>&1; then | ||
| gh release create "$RELEASE_TAG" --verify-tag --generate-notes --latest | ||
| fi | ||
|
|
||
| - name: Move major tag after release validation | ||
| shell: bash | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RELEASE_TAG: ${{ inputs.version }} | ||
| run: | | ||
| set -euo pipefail | ||
|
|
||
| # Recheck the release and ancestry immediately before the only destructive operation. | ||
| git fetch --force origin '+refs/tags/*:refs/tags/*' | ||
| gh release view "$RELEASE_TAG" >/dev/null | ||
| if ! git rev-parse --verify --quiet "${ACTION_MAJOR_TAG}^{commit}" >/dev/null; then | ||
| echo "error: remote ${ACTION_MAJOR_TAG} convenience tag is missing" >&2 | ||
| exit 1 | ||
| fi | ||
| if ! git merge-base --is-ancestor "${ACTION_MAJOR_TAG}^{commit}" "$GITHUB_SHA"; then | ||
| echo "error: refusing to move ${ACTION_MAJOR_TAG} backwards" >&2 | ||
| exit 1 | ||
| fi | ||
|
|
||
| git config user.name 'github-actions[bot]' | ||
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | ||
| git tag -fa "$ACTION_MAJOR_TAG" "$GITHUB_SHA" -m "$ACTION_MAJOR_TAG tracks $RELEASE_TAG" | ||
| git push origin "refs/tags/$ACTION_MAJOR_TAG" --force | ||
|
|
||
| # The repository already has a major-tag GitHub Release. Keep its notes consistent with the | ||
| # moved tag while the exact release remains the canonical, latest release record. | ||
| if gh release view "$ACTION_MAJOR_TAG" >/dev/null 2>&1; then | ||
| gh release edit "$ACTION_MAJOR_TAG" \ | ||
| --title "$ACTION_MAJOR_TAG" \ | ||
| --notes "Tracks the latest validated $ACTION_MAJOR_TAG release: $RELEASE_TAG." \ | ||
| --latest=false | ||
| fi | ||
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
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.
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.