1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Publish
on:
release:
types:
jobs:
publish-imperfect:
name: Publish terni to crates.io
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: systemic-engineering/ci/actions/nix-setup@main
- name: Verify version matches tag
run: |
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
CARGO_VERSION=$(nix develop -c cargo metadata --no-deps --format-version 1 | jq -r '.packages[] | select(.name == "terni") | .version')
if [ "$TAG_VERSION" != "$CARGO_VERSION" ]; then
echo "Tag version ($TAG_VERSION) does not match Cargo.toml version ($CARGO_VERSION)"
exit 1
fi
- name: Publish terni
run: nix develop -c cargo publish -p terni
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
notify-on-failure:
if: failure()
needs:
uses: systemic-engineering/ci/.github/workflows/notify-ntfy.yml@main
with:
repo: ${{ github.repository }}
workflow: ${{ github.workflow }}
run_url: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
secrets:
NTFY_TOKEN: ${{ secrets.NTFY_TOKEN }}