Skip to content

chore(kubert): v0.23.0-alpha4 (#334) #138

chore(kubert): v0.23.0-alpha4 (#334)

chore(kubert): v0.23.0-alpha4 (#334) #138

Workflow file for this run

name: Release kubert
on:
pull_request:
paths:
- .github/workflows/release-kubert.yml
push:
tags:
- 'kubert/*'
env:
CARGO_INCREMENTAL: 0
CARGO_NET_RETRY: 10
RUSTUP_MAX_RETRIES: 10
permissions:
contents: read
jobs:
cleanup:
runs-on: ubuntu-latest
permissions:
actions: write
steps:
- uses: styfle/cancel-workflow-action@85880fa0301c86cca9da44039ee3bb12d3bedbfa
with:
all_but_latest: true
access_token: ${{ github.token }}
meta:
timeout-minutes: 5
runs-on: ubuntu-latest
container: ghcr.io/linkerd/dev:v44-rust
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- id: meta
shell: bash
run: |
ref="${{ github.ref }}"
if [[ "$ref" == refs/tags/kubert/* ]]; then
version="${ref##refs/tags/kubert/}"
crate=$(just-cargo crate-version kubert)
if [[ "$crate" != "$version" ]]; then
echo "::error ::Crate version $crate does not match tag $version" >&2
exit 1
fi
( echo version="$version"
echo mode=release
) >> "$GITHUB_OUTPUT"
else
sha="${{ github.sha }}"
( echo version="$(just-cargo crate-version kubert)-git-${sha:0:7}"
echo mode=test
) >> "$GITHUB_OUTPUT"
fi
outputs:
mode: ${{ steps.meta.outputs.mode }}
version: ${{ steps.meta.outputs.version }}
release:
needs: [meta]
permissions:
contents: write
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- if: needs.meta.outputs.mode == 'release'
uses: softprops/action-gh-release@7b4da11513bf3f43f9999e90eabced41ab8bb048
with:
name: kubert ${{ 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: ghcr.io/linkerd/dev:v44-rust
env:
RUSTFLAGS: '--cfg tokio_unstable'
RUSTDOCFLAGS: '--cfg tokio_unstable'
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
- run: cargo publish --package=kubert --dry-run
- if: needs.meta.outputs.mode == 'release'
run: cargo publish --package=kubert --token=${{ secrets.CRATESIO_TOKEN }}