-
Notifications
You must be signed in to change notification settings - Fork 154
chore: revive and improve release automation #2266
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
13 commits
Select commit
Hold shift + click to select a range
084c879
ci: automate creation of GitHub releases and tags
galargh c0aa24f
docs: update documentation on release creation
galargh c4fa7c0
feat: release individual packages
galargh 2292bc1
fix: trigger release workflows on Cargo.toml changes
galargh 85586da
chore: simplify cargo-publish job check
galargh 50273e3
ci: limit duplication in release workflows
galargh a3fb5a9
docs: document the new release process and possible improvements
galargh 423e826
chore: apply suggestions from code review
galargh 803b57e
chore: modernize release automation with workspace-aware publishing
galargh 8fa2fd8
Merge remote-tracking branch 'origin/master' into ipdx/unified-github…
galargh 5d31a03
chore: enable trusted publishing and fix OpenCL linkage
galargh ef9e20f
ci: install opencl in release workflows
galargh f8f80dd
Apply changes requested in review
galargh 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,58 @@ | ||
| name: Release Checker | ||
|
|
||
| on: | ||
| # Change to pull_request_target for the workflow to function correctly on PRs from forks | ||
| pull_request: | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| types: [ opened, synchronize, reopened, labeled, unlabeled ] | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| release-check: | ||
| uses: ipdxco/unified-github-workflows/.github/workflows/release-check.yml@v1.0 | ||
| if: ${{ github.event_name == 'workflow_dispatch' || !github.event.pull_request.head.repo.fork }} | ||
| with: | ||
| sources: | | ||
| [ | ||
| "fvm/Cargo.toml", | ||
| "testing/integration/Cargo.toml", | ||
| "ipld/amt/Cargo.toml", | ||
| "ipld/bitfield/Cargo.toml", | ||
| "ipld/blockstore/Cargo.toml", | ||
| "ipld/car/Cargo.toml", | ||
| "ipld/encoding/Cargo.toml", | ||
| "ipld/hamt/Cargo.toml", | ||
| "ipld/kamt/Cargo.toml", | ||
| "sdk/Cargo.toml", | ||
| "shared/Cargo.toml" | ||
| ] | ||
| separator: "@" | ||
| cargo-publish: | ||
| needs: [release-check] | ||
| if: needs.release-check.outputs.json != '{}' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Install required packages | ||
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | ||
| with: | ||
| timeout_minutes: 10 | ||
| max_attempts: 3 | ||
| shell: bash | ||
| command: | | ||
| sudo apt-get update | ||
| sudo apt-get install --no-install-recommends --yes libhwloc-dev ocl-icd-opencl-dev | ||
| - name: Dry-run publish | ||
| run: | | ||
| # Use cargo publish --workspace --dry-run to verify the entire workspace at once. | ||
| # This correctly handles interdependent crates which a matrix-based approach misses. | ||
| cargo publish --workspace --dry-run |
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,58 @@ | ||
| name: Releaser | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - "**/Cargo.toml" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| releaser: | ||
| uses: ipdxco/unified-github-workflows/.github/workflows/releaser.yml@v1.0 | ||
| with: | ||
| sources: | | ||
| [ | ||
| "fvm/Cargo.toml", | ||
| "testing/integration/Cargo.toml", | ||
| "ipld/amt/Cargo.toml", | ||
| "ipld/bitfield/Cargo.toml", | ||
| "ipld/blockstore/Cargo.toml", | ||
| "ipld/car/Cargo.toml", | ||
| "ipld/encoding/Cargo.toml", | ||
| "ipld/hamt/Cargo.toml", | ||
| "ipld/kamt/Cargo.toml", | ||
| "sdk/Cargo.toml", | ||
| "shared/Cargo.toml" | ||
| ] | ||
| separator: "@" | ||
| secrets: | ||
| UCI_GITHUB_TOKEN: ${{ secrets.UCI_GITHUB_TOKEN }} | ||
|
|
||
| cargo-publish: | ||
| needs: [releaser] | ||
| if: needs.releaser.outputs.json != '{}' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| - name: Install required packages | ||
| uses: nick-fields/retry@ad984534de44a9489a53aefd81eb77f87c70dc60 # v4.0.0 | ||
| with: | ||
| timeout_minutes: 10 | ||
| max_attempts: 3 | ||
| shell: bash | ||
| command: | | ||
| sudo apt-get update | ||
| sudo apt-get install --no-install-recommends --yes libhwloc-dev ocl-icd-opencl-dev | ||
| - name: Publish to crates.io | ||
| run: | | ||
| # Use cargo publish --workspace to publish all changed crates in the workspace. | ||
| # This handles interdependent crates correctly and only publishes those with version bumps. | ||
| cargo publish --workspace | ||
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.
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.
We should verify that this workflow is listed as a trusted publisher in crates.io.
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.
I'd look but I can't find the crate settings even though I should be in the team that has publish access, crates.io teams is janky, maybe @hanabi1224 || @LesnyRumcajs has a clue
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.
Settings should be next to Security on crates.io ,however, I don't have the setting permission of fvm* crates either
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.
https://crates.io/crates/fvm/settings
https://crates.io/crates/fvm_integration_tests/settings
https://crates.io/crates/fvm_sdk/settings
https://crates.io/crates/fvm_shared/settings
Should any other crates be modified?
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.
I think:
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.
I did the same setup for those as well - my bad for missing those previously.