name: publish
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
- v[0-9]+.[0-9]+.[0-9]+-[0-9]+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
validate:
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- run: nix build
- run: nix develop -c 'bash' -c "cargo set-version '${GITHUB_REF_NAME#v}'"
- uses: stefanzweifel/git-auto-commit-action@v7
with:
file_pattern: Cargo.toml Cargo.lock
commit_message: "chore: bump version to ${{ github.ref_name }}"
crates:
needs: validate
runs-on: ubuntu-latest
environment: publish
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
with:
ref: ${{ github.event.repository.default_branch }}
- id: auth
uses: rust-lang/crates-io-auth-action@v1
- uses: DeterminateSystems/determinate-nix-action@main
- uses: DeterminateSystems/flakehub-cache-action@main
- run: nix develop -c 'bash' -c 'cargo publish'
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
fh:
needs: validate
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v6
- uses: DeterminateSystems/determinate-nix-action@main
- uses: DeterminateSystems/flakehub-push@main
with:
visibility: public
name: molarmanful/euphrates
tag: ${{ github.ref_name }}
include-output-paths: true