-
Notifications
You must be signed in to change notification settings - Fork 0
Implement gated release pipeline with CI enforcement #18
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,143 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: Release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| push: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| tags: ['v*'] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| gate: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Enforce that the tag points to the current tip of `release`. The | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # release-branch CI (ci.yml) runs Tier 1 + Tier 2 on every push to | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # release, so tip-of-release is the SHA on which full CI passed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Tag must point to the tip of release | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| git fetch origin release --depth=1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| expected=$(git rev-parse FETCH_HEAD) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ "$GITHUB_SHA" != "$expected" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "::error::Tag $GITHUB_REF_NAME ($GITHUB_SHA) is not the tip of release ($expected). See RELEASING.md." | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| linux: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: gate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| target: [x86_64, aarch64] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v6 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: PyO3/maturin-action@v1 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| target: ${{ matrix.target }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| manylinux: auto | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| args: --release --out dist -i python3.11 -i python3.12 -i python3.13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/upload-artifact@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| name: wheels-linux-${{ matrix.target }} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| path: dist | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| macos: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| needs: gate | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| strategy: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| fail-fast: false | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| matrix: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| target: [x86_64, aarch64] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| python-version: ['3.11', '3.12', '3.13'] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| include: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - target: x86_64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runner: macos-13 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - target: aarch64 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
| runner: macos-14 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+55
to
+61
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||
| target: [x86_64, aarch64] | |
| python-version: ['3.11', '3.12', '3.13'] | |
| include: | |
| - target: x86_64 | |
| runner: macos-13 | |
| - target: aarch64 | |
| runner: macos-14 | |
| include: | |
| - target: x86_64 | |
| python-version: '3.11' | |
| runner: macos-13 | |
| - target: x86_64 | |
| python-version: '3.12' | |
| runner: macos-13 | |
| - target: x86_64 | |
| python-version: '3.13' | |
| runner: macos-13 | |
| - target: aarch64 | |
| python-version: '3.11' | |
| runner: macos-14 | |
| - target: aarch64 | |
| python-version: '3.12' | |
| runner: macos-14 | |
| - target: aarch64 | |
| python-version: '3.13' | |
| runner: macos-14 |
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,57 @@ | ||||||||||||
| # Releasing | ||||||||||||
|
|
||||||||||||
| Releases are cut from the `release` branch. The `ci.yml` workflow runs full | ||||||||||||
| CI (Tier 1 + Tier 2 against the pinned harfrust corpus) on every push to | ||||||||||||
| `release`. The `release.yml` workflow gates on tag-equals-release-tip, so | ||||||||||||
| the SHA being released has demonstrably passed full CI. | ||||||||||||
|
Comment on lines
+5
to
+6
|
||||||||||||
| `release`. The `release.yml` workflow gates on tag-equals-release-tip, so | |
| the SHA being released has demonstrably passed full CI. | |
| `release`. The `release.yml` workflow's `gate` job ensures the tag points | |
| to the tip of `release`, so the SHA being released has demonstrably passed | |
| full CI. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
release-source-gateonly checks$GITHUB_HEAD_REF == "main". A PR from a fork whose branch is also namedmainwill pass this gate even though it did not originate from this repo’smain. If the intent is to ensure the source is this repository’smain, also validate the head repo (e.g.,github.event.pull_request.head.repo.full_name == github.repository) in addition to the branch name.