Conversation
Signed-off-by: Esteve Fernandez <esteve@apache.org>
There was a problem hiding this comment.
Pull request overview
This PR adds a GitHub Actions workflow for automating Rust package releases using release-plz, a tool that handles changelog generation, version bumping, and publishing to crates.io.
Key Changes
- Adds two jobs: one for creating release PRs with version bumps and changelogs, and another for publishing releases
- Configures GitHub App token generation to allow the workflow to trigger other workflows
- Sets up necessary permissions and secrets for cargo registry publishing
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Generate GitHub token | ||
| uses: actions/create-github-app-token@v2 | ||
| id: generate-token | ||
| with: | ||
| # GitHub App ID secret name | ||
| app-id: ${{ secrets.APP_ID }} | ||
| # GitHub App private key secret name | ||
| private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| token: ${{ steps.generate-token.outputs.token }} |
There was a problem hiding this comment.
The token generation and checkout steps are duplicated between the two jobs. Consider extracting these into a reusable workflow or using a composite action to reduce duplication. This would make the workflow easier to maintain and ensure consistency between jobs.
| @@ -0,0 +1,75 @@ | |||
| name: Release-plz | |||
There was a problem hiding this comment.
The workflow name uses "Release-plz" with a capital 'P', but the action and job names use "release-plz" with lowercase. Consider using consistent casing throughout, preferably matching the official tool name "release-plz" with lowercase.
| runs-on: ubuntu-latest | ||
| if: ${{ github.repository_owner == 'ros2-rust' }} | ||
| permissions: | ||
| contents: write |
There was a problem hiding this comment.
The concurrency configuration prevents parallel runs of the PR job but doesn't apply to the release job. If multiple commits are pushed to main rapidly, multiple release jobs could run concurrently. Consider adding a similar concurrency configuration to the release-plz-release job to prevent race conditions during releases.
| contents: write | |
| contents: write | |
| concurrency: | |
| group: release-plz-${{ github.ref }} | |
| cancel-in-progress: false |
|
I'll go ahead and merge this, it's the same release-plz configuration we use for rclrs. |
No description provided.