Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,36 @@ jobs:
publish:
runs-on: ubuntu-24.04
environment: release
permissions:
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Trusted publishing crates.io
uses: rust-lang/crates-io-auth-action@bbd81622f20ce9e2dd9622e3218b975523e45bbe # v1.0.4
id: auth
- name: Install Nix
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31.10.6
with:
extra_nix_config: |
experimental-features = nix-command flakes
accept-flake-config = true

- name: Verify tag version matches Cargo.toml version
run: |
TAG_VERSION="${{ steps.get_tag.outputs.tag }}"
CLEAN_TAG_VERSION="${TAG_VERSION#v}"
CARGO_VERSION=$(nix develop -c -- toml get Cargo.toml package.version)
echo "Tag version: $CLEAN_TAG_VERSION"
echo "Cargo.toml version: $CARGO_VERSION"
if [ "$CLEAN_TAG_VERSION" != "$CARGO_VERSION" ]; then
echo "Tag version does not match Cargo.toml version"
exit 1
fi
shell: bash

- name: Cargo publish
run: nix develop -c -- cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
1 change: 1 addition & 0 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
rustToolchain
pkgs.nixd
pkgs.nil
pkgs.toml-cli
];
};
};
Expand Down