-
Notifications
You must be signed in to change notification settings - Fork 289
Workflow to bump rust templates sdk dependency #3255
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
fibonacci1729
merged 1 commit into
spinframework:main
from
fibonacci1729:rust-sdk-release-workflow
Aug 28, 2025
Merged
Changes from all commits
Commits
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,39 @@ | ||
| name: Bump Spin Rust Templates SDK Dependency | ||
|
|
||
| on: | ||
| repository_dispatch: | ||
| types: | ||
| - rust-sdk-release | ||
|
|
||
| jobs: | ||
| create-pr: | ||
| name: Create PR with Spin Rust Templates SDK Dependency Bump | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Bump Rust Templates SDK Dependency | ||
| shell: bash | ||
| run: ./scripts/bump-rust-template-sdk.sh ${{ github.event.client_payload.version }} | ||
|
|
||
| - name: Import GPG key | ||
| uses: crazy-max/ghaction-import-gpg@v6 | ||
| with: | ||
| gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
| passphrase: ${{ secrets.PASSPHRASE }} | ||
| git_user_signingkey: true | ||
| git_commit_gpgsign: true | ||
|
|
||
| - name: Create Pull Request | ||
| uses: peter-evans/create-pull-request@v7 | ||
| with: | ||
| commit-message: "chore(rust-templates): bump Spin Rust SDK to ${{ github.event.client_payload.version }}" | ||
| title: "chore(rust-templates): bump Spin Rust SDK to ${{ github.event.client_payload.version }}" | ||
| body: Update the Spin Rust Templates SDK dependency to ${{ github.event.client_payload.version }} | ||
| branch: bump-spin-rust-sdk-${{ github.event.client_payload.version }} | ||
| base: main | ||
| delete-branch: true | ||
| committer: spinframeworkbot <[email protected]> | ||
| author: spinframeworkbot <[email protected]> | ||
| signoff: true | ||
| token: ${{ secrets.PAT }} | ||
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,35 @@ | ||
| #!/bin/bash | ||
| # This script updates the `spin-sdk` dependency in Rust template | ||
| # `Cargo.toml.tmpl` files under the `templates` directory. | ||
| set -euo pipefail | ||
|
|
||
| VERSION=$1 | ||
|
|
||
| # -i syntax differs between GNU and Mac sed; this usage is supported by both | ||
| SED_INPLACE='sed -i.bak' | ||
|
|
||
| # cleanup | ||
| trap 'find templates -name "*.bak" -delete' EXIT | ||
|
|
||
| usage() { | ||
| echo "Usage: $0 <VERSION>" | ||
| echo "Updates the Rust templates SDK dependency to the specified version" | ||
| echo "Example: $0 6.0.0" | ||
| } | ||
|
|
||
| if [[ $# -ne 1 ]] | ||
| then | ||
| usage | ||
| exit 1 | ||
| fi | ||
|
|
||
| # Ensure version is an 'official' release | ||
| if [[ ! "${VERSION}" =~ ^[0-9]+.[0-9]+.[0-9]+$ ]] | ||
| then | ||
| echo "VERSION doesn't match [0-9]+.[0-9]+.[0-9]+ and may be a prerelease; skipping." | ||
| exit 1 | ||
| fi | ||
|
|
||
|
|
||
| # Update the version in the Cargo.toml.tmpl files for each Rust template | ||
| find templates -type f -path "templates/*-rust/content/Cargo.toml.tmpl" -exec $SED_INPLACE "/^\[dependencies\]/,/^\[/ s/^spin-sdk = \".*\"/spin-sdk = \"${VERSION}\"/" {} + |
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.