v0.14.0 #59
Workflow file for this run
This file contains 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
name: release | |
on: | |
pull_request: | |
paths: | |
- .github/workflows/release.yml | |
push: | |
tags: | |
- 'release/*' | |
env: | |
CARGO_INCREMENTAL: 0 | |
CARGO_NET_RETRY: 10 | |
RUSTUP_MAX_RETRIES: 10 | |
permissions: | |
contents: read | |
jobs: | |
meta: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
steps: | |
- id: meta | |
shell: bash | |
run: | | |
ref=${{ github.ref }} | |
if [[ "$ref" == refs/tags/release/* ]]; then | |
( echo version="${ref##refs/tags/release/}" | |
echo publish=true | |
) >> "$GITHUB_OUTPUT" | |
else | |
sha=${{ github.sha }} | |
( echo version="test-${sha:0:7}" | |
) >> "$GITHUB_OUTPUT" | |
fi | |
outputs: | |
publish: ${{ steps.meta.outputs.publish }} | |
version: ${{ steps.meta.outputs.version }} | |
test: | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
container: docker://ghcr.io/linkerd/dev:v42-rust | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- run: just fetch | |
- run: just test-build | |
- run: just test | |
# Publish a GitHub release with platform-specific static binaries. | |
release: | |
needs: [meta, test] | |
permissions: | |
contents: write | |
timeout-minutes: 5 | |
runs-on: ubuntu-latest | |
container: docker://ghcr.io/linkerd/dev:v42-rust | |
steps: | |
- if: needs.meta.outputs.publish | |
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- if: needs.meta.outputs.publish | |
shell: bash | |
run: | | |
just-cargo fetch | |
crate=$(just-cargo crate-version k8s-gateway-api) | |
tag="${{ needs.meta.outputs.version }}" | |
if [[ "$crate" != "$tag" ]]; then | |
echo "::error ::Crate version ${crate} does not match tag ${tag}" | |
exit 1 | |
fi | |
- if: needs.meta.outputs.publish | |
uses: softprops/action-gh-release@de2c0eb89ae2a093876385947365aca7b0e5f844 | |
with: | |
name: ${{ needs.meta.outputs.version }} | |
generate_release_notes: true | |
crate: | |
# Only publish the crate after the rest of the release succeeds. | |
needs: [meta, release] | |
timeout-minutes: 10 | |
runs-on: ubuntu-latest | |
container: docker://ghcr.io/linkerd/dev:v42-rust | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 | |
- if: needs.meta.outputs.publish == '' | |
run: just publish --dry-run | |
- if: needs.meta.outputs.publish == 'true' | |
run: just publish --token=${{ secrets.CRATESIO_TOKEN }} |