Skip to content

Commit b8603bc

Browse files
fix(ci): wire trusted publishing token into cargo publish (#409)
* fix(ci): wire trusted publishing token into cargo publish --------- Co-authored-by: Jo D <dev-jodee@users.noreply.github.com> Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
1 parent f5b6737 commit b8603bc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

.github/workflows/rust-publish.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,15 @@ jobs:
9090
done
9191
git push origin --tags 2>/dev/null || echo "⏭️ Tags already pushed"
9292
93+
- name: Authenticate crates.io trusted publisher
94+
if: ${{ github.event.inputs.publish-kora-lib == 'true' || github.event.inputs.publish-kora-cli == 'true' }}
95+
id: crates_io_auth
96+
uses: rust-lang/crates-io-auth-action@2d789f72ce8ec8eee70e84c7f0a1b68cd52b6e8e # v1.0.3
97+
9398
- name: Publish kora-lib to crates.io
9499
if: ${{ github.event.inputs.publish-kora-lib == 'true' }}
100+
env:
101+
CARGO_REGISTRY_TOKEN: ${{ steps.crates_io_auth.outputs.token }}
95102
run: |
96103
echo "📦 Publishing kora-lib@${{ steps.version.outputs.version }} to crates.io..."
97104
cargo publish -p kora-lib --locked
@@ -104,6 +111,8 @@ jobs:
104111
105112
- name: Publish kora-cli to crates.io
106113
if: ${{ github.event.inputs.publish-kora-cli == 'true' }}
114+
env:
115+
CARGO_REGISTRY_TOKEN: ${{ steps.crates_io_auth.outputs.token }}
107116
run: |
108117
echo "📦 Publishing kora-cli@${{ steps.version.outputs.version }} to crates.io..."
109118
cargo publish -p kora-cli --locked

0 commit comments

Comments
 (0)