Files
rust-gpu/.github/workflows/release-plz.yml
Christian Legnitto 36e3348cdc
All checks were successful
Release-plz / Release-plz release (push) Has been skipped
Release-plz / Release-plz PR (push) Has been skipped
Rust Toolchain Upgrade / check-and-upgrade (push) Has been skipped
release-plz2: update difftest Cargo.lock in the release PR
The difftest workspace pulls `spirv-std` / `spirv-builder` via path
deps, so its `Cargo.lock` references their versions. release-plz only
bumps the root workspace, so add a follow-up step on the `release-pr`
job that checks out the freshly-created release PR, runs a targeted
`cargo update` against the difftest manifest for the five spirv-*
packages, and pushes the resulting lockfile change back onto the PR
before CI runs against it. Uses the documented "commit files to the
release PR" pattern from release-plz so we don't need a config option
upstream. `RUSTUP_TOOLCHAIN=stable` avoids rust-toolchain.toml
auto-installing the pinned nightly just to refresh a lockfile.
2026-05-20 08:50:43 +00:00

94 lines
3.2 KiB
YAML

name: Release-plz
on:
push:
branches:
- main
jobs:
# Release unpublished packages.
release-plz-release:
name: Release-plz release
if: ${{ github.repository_owner == 'rust-gpu' }}
runs-on: ubuntu-latest
environment: release
permissions:
contents: write
pull-requests: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: false
submodules: true
- &install-rust
name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Run release-plz
uses: release-plz/action@v0.5
with:
command: release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Create a PR with the new versions and changelog, preparing the next release.
release-plz-pr:
name: Release-plz PR
if: ${{ github.repository_owner == 'rust-gpu' }}
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
concurrency:
group: release-plz-${{ github.ref }}
cancel-in-progress: false
steps:
# `persist-credentials: true` so the follow-up step below can push to
# the release PR. See https://release-plz.dev/docs/github/output#example-commit-files-to-the-release-pr
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
persist-credentials: true
submodules: true
- *install-rust
- name: Run release-plz
id: release-plz
uses: release-plz/action@v0.5
with:
command: release-pr
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# The difftest workspace pulls `spirv-std` / `spirv-builder` via path
# deps, so its `Cargo.lock` references their versions. release-plz only
# bumps the root workspace, so we update the difftest lockfile here and
# push it onto the release PR before CI runs against it.
- name: Update difftest Cargo.lock in release PR
if: ${{ steps.release-plz.outputs.prs_created == 'true' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ steps.release-plz.outputs.pr }}
# `rust-toolchain.toml` pins nightly; force stable so rustup doesn't
# auto-install ~1GB of nightly + components just to update a lockfile.
RUSTUP_TOOLCHAIN: stable
run: |
set -euo pipefail
pr_number=$(echo "$PR" | jq -r '.number')
gh pr checkout "$pr_number"
cargo update --manifest-path tests/difftests/tests/Cargo.toml \
-p spirv-std \
-p spirv-std-macros \
-p spirv-std-types \
-p spirv-builder \
-p rustc_codegen_spirv-types
if ! git diff --quiet tests/difftests/tests/Cargo.lock; then
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add tests/difftests/tests/Cargo.lock
git commit -m "chore: update difftest Cargo.lock"
git push
fi