Browse Source

ci: Add Release workflow

This uses the [auto-release] crate to create a new crates.io release and
push a github tag. The [Trusted Publishing] feature is used to provide
the crates.io token.

[auto-release]: https://crates.io/crates/auto-release
[Trusted Publishing]: https://blog.rust-lang.org/2025/07/11/crates-io-development-update-2025-07/
Nicholas Bishop 1 month ago
parent
commit
6b6e11d327
1 changed files with 24 additions and 0 deletions
  1. 24 0
      .github/workflows/release.yml

+ 24 - 0
.github/workflows/release.yml

@@ -0,0 +1,24 @@
+on:
+  push:
+    branches:
+      - main
+      
+name: Release
+
+permissions:
+  # Required for pushing the release tag.
+  contents: write
+  # Required for crates.io Trusted Publishing.
+  id-token: write
+
+jobs:
+  release:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: rust-lang/crates-io-auth-action@v1
+        id: auth
+      - run: cargo install auto-release
+      - run: auto-release -p printf-compat --condition subject
+        env:
+          CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}