-
Notifications
You must be signed in to change notification settings - Fork 5
Automate release & uploading artifacts #904
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
14 commits
Select commit
Hold shift + click to select a range
689aba2
Create release notes
spoorcc bc93d44
Create release workflow
spoorcc b72df38
Automate
spoorcc 3c146a7
Upload wheels to release
spoorcc bbda770
reorder workflows
spoorcc 2842936
Make sure zig is installed
spoorcc d2b25ef
Make tag annotated
spoorcc b6fc50c
cleanup script
spoorcc 45696fe
Cleanup
spoorcc 07fbbf3
Review comments
spoorcc 14b8b20
Update contributing manual
spoorcc 13f10e3
Restore step titles
spoorcc 39d87a1
Review fixes
spoorcc d7655f7
Pin zig
spoorcc 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
Some comments aren't visible on the classic Files Changed page.
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
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,38 @@ | ||
| name: CI & Release Orchestration | ||
|
|
||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| tags: | ||
| - '[0-9]+.[0-9]+.[0-9]+' | ||
| pull_request: | ||
| types: [opened, synchronize, reopened] | ||
|
|
||
| # Allows to run this workflow manually | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| prep-release: | ||
| uses: ./.github/workflows/release.yml | ||
| permissions: | ||
| contents: write | ||
| security-events: write | ||
|
|
||
| build: | ||
| needs: prep-release | ||
| uses: ./.github/workflows/build.yml | ||
| permissions: | ||
| contents: write | ||
| security-events: write | ||
| with: | ||
| release_id: ${{ needs.prep-release.outputs.release_id }} | ||
|
|
||
| run: | ||
| uses: ./.github/workflows/run.yml | ||
| permissions: | ||
| contents: read | ||
| security-events: write |
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
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,88 @@ | ||
| name: Releases | ||
|
|
||
| on: | ||
| workflow_call: | ||
| outputs: | ||
| release_id: | ||
| description: "Tag name to use of release, empty if not needed" | ||
| value: ${{ jobs.prepare-release.outputs.release_id }} | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| prepare-release: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| security-events: write | ||
|
|
||
| outputs: | ||
| release_id: ${{ steps.release_info.outputs.tag }} | ||
|
|
||
| steps: | ||
| - uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0 | ||
| with: | ||
| egress-policy: audit | ||
| - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v5.0.0 | ||
| - uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # v6.1.0 | ||
| with: | ||
| python-version: '3.13' | ||
|
|
||
| - name: Determine release info | ||
| id: release_info | ||
| run: | | ||
| if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then | ||
| BRANCH="${GITHUB_HEAD_REF}" | ||
| else | ||
| BRANCH="${GITHUB_REF#refs/heads/}" | ||
| fi | ||
|
|
||
| if [[ "$BRANCH" == "main" ]]; then | ||
| TAG="latest" | ||
| elif [[ "${GITHUB_REF}" == refs/tags/* ]]; then | ||
| TAG="${GITHUB_REF#refs/tags/}" | ||
| else | ||
| TAG="" | ||
| fi | ||
| echo "tag=$TAG" | ||
| echo "tag=$TAG" >> $GITHUB_OUTPUT | ||
|
|
||
| - name: Update latest tag | ||
| if: ${{ steps.release_info.outputs.tag == 'latest' }} | ||
| uses: EndBug/latest-tag@52ce15b2695f86a4ce47b72387dee54e47f6356c # v1.6.2 | ||
| with: | ||
| ref: latest | ||
| description: Last state in main | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
|
||
| - name: Generate release notes | ||
| if: ${{ steps.release_info.outputs.tag }} | ||
| id: notes | ||
| run: | | ||
| python script/create_release_notes.py | ||
|
|
||
| - name: Delete existing release | ||
| if: ${{ steps.release_info.outputs.tag == 'latest' }} | ||
| env: | ||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| TAG: ${{ steps.release_info.outputs.tag }} | ||
| run: | | ||
| if gh release view "$TAG" >/dev/null 2>&1; then | ||
| gh release delete "$TAG" --yes | ||
| else | ||
| echo "No release found for $TAG." | ||
| fi | ||
|
|
||
| - name: Create release | ||
| if: ${{ steps.release_info.outputs.tag }} | ||
| uses: softprops/action-gh-release@5122b4edc95f85501a71628a57dc180a03ec7588 # v2.5.0 | ||
| with: | ||
| tag_name: ${{ steps.release_info.outputs.tag }} | ||
| name: ${{ steps.release_info.outputs.tag }} | ||
| body_path: release_notes.txt | ||
| draft: true | ||
| files: LICENSE | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,4 @@ doc/landing-page/_build | |
| example/Tests/ | ||
| venv* | ||
| *.cdx.json | ||
| release_notes.txt | ||
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
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.