Bump versions #18
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
on: | |
push: | |
tags: | |
- releases/gel-errors/v* | |
name: Release gel-errors | |
jobs: | |
test_and_publish: | |
name: Test and publish | |
runs-on: ubuntu-latest | |
permissions: | |
id-token: "write" | |
contents: "read" | |
steps: | |
# checkout and env setup | |
- uses: actions/checkout@v3 | |
- uses: DeterminateSystems/nix-installer-action@main | |
- uses: DeterminateSystems/magic-nix-cache-action@main | |
- name: Build the nix shell | |
run: nix develop --command just --version | |
- uses: Swatinem/rust-cache@v2 | |
# test | |
- name: Test | |
run: nix develop --command cargo test --all-features --package=gel-errors | |
# verify that git tag matches cargo version | |
- run: | | |
set -x | |
cargo_version="$(cargo metadata --format-version 1 \ | |
| jq -r '.packages[] | select(.name=="gel-errors") | .version')" | |
tag_version="${GITHUB_REF#refs/tags/releases/gel-errors/v}" | |
test "$cargo_version" = "$tag_version" | |
- working-directory: ./gel-errors | |
run: | | |
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }} |