Skip to content

Bump versions

Bump versions #10

on:
push:
tags:
- releases/gel-protocol/v*
name: Release gel-protocol
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-protocol
# verify that git tag matches cargo version
- run: |
set -x
cargo_version="$(cargo metadata --format-version 1 \
| jq -r '.packages[] | select(.name=="gel-protocol") | .version')"
tag_version="${GITHUB_REF#refs/tags/releases/gel-protocol/v}"
test "$cargo_version" = "$tag_version"
- working-directory: ./gel-protocol
run: |
nix develop --command cargo publish --token=${{ secrets.CARGO_REGISTRY_TOKEN }}