Skip to content
Merged
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
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Cargo Build & Test

on:
push:
branches:
- main
pull_request:
workflow_dispatch:

Expand Down Expand Up @@ -32,8 +34,18 @@ jobs:
echo "changed=false" >> $GITHUB_ENV
fi

- name: Tag the release
if: github.ref == 'refs/heads/main' && env.changed == 'true'
run: |
version=$(grep '^version\s*=' Cargo.toml | sed -E 's/version[[:space:]]*=[[:space:]]*"(.*)"/\1/')

echo "Tagging version: $version"

git tag -a v$version -m "Release v$version"
git push origin v$version

- name: Publish to crates.io
if: env.changed == 'true'
if: github.ref == 'refs/heads/main' && env.changed == 'true'
run: cargo publish
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}