ci(release): enable tag push trigger for automatic cross-compilation
This commit is contained in:
@@ -6,6 +6,9 @@ name: Release
|
|||||||
# the vX.Y.Z tag. The build matrix + release job then run off that tag. No
|
# the vX.Y.Z tag. The build matrix + release job then run off that tag. No
|
||||||
# more hand-editing versions across Cargo.toml and individual crate manifests.
|
# more hand-editing versions across Cargo.toml and individual crate manifests.
|
||||||
on:
|
on:
|
||||||
|
push:
|
||||||
|
tags:
|
||||||
|
- 'v[0-9]+.[0-9]+.[0-9]+*'
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
@@ -26,14 +29,12 @@ jobs:
|
|||||||
name: bump + tag
|
name: bump + tag
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
outputs:
|
outputs:
|
||||||
version: ${{ steps.stamp.outputs.version }}
|
version: ${{ steps.tag.outputs.tag_prefix }}
|
||||||
tag: ${{ steps.stamp.outputs.tag }}
|
tag: ${{ steps.tag.outputs.tag_full }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
# Push the release commit + tag back with a write-capable token.
|
|
||||||
token: ${{ secrets.RELEASE_TOKEN }}
|
|
||||||
|
|
||||||
- uses: dtolnay/rust-toolchain@1.83
|
- uses: dtolnay/rust-toolchain@1.83
|
||||||
|
|
||||||
@@ -48,7 +49,15 @@ jobs:
|
|||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ runner.os }}-cargo-prepare-
|
${{ runner.os }}-cargo-prepare-
|
||||||
|
|
||||||
|
- name: Extract version from tag (push trigger)
|
||||||
|
if: github.event_name == 'push'
|
||||||
|
id: tag
|
||||||
|
run: |
|
||||||
|
echo "tag_prefix=${GITHUB_REF_NAME#v}" >> "$GITHUB_OUTPUT"
|
||||||
|
echo "tag=${GITHUB_REF_NAME}" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
- name: Validate version + stamp
|
- name: Validate version + stamp
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
id: stamp
|
id: stamp
|
||||||
env:
|
env:
|
||||||
VERSION: ${{ inputs.version }}
|
VERSION: ${{ inputs.version }}
|
||||||
@@ -75,6 +84,7 @@ jobs:
|
|||||||
run: cargo test --workspace
|
run: cargo test --workspace
|
||||||
|
|
||||||
- name: Commit, tag, push
|
- name: Commit, tag, push
|
||||||
|
if: github.event_name == 'workflow_dispatch'
|
||||||
env:
|
env:
|
||||||
VER: ${{ steps.stamp.outputs.version }}
|
VER: ${{ steps.stamp.outputs.version }}
|
||||||
TAG: ${{ steps.stamp.outputs.tag }}
|
TAG: ${{ steps.stamp.outputs.tag }}
|
||||||
|
|||||||
Reference in New Issue
Block a user