Skip to content

Commit 543c179

Browse files
committed
ci: configure trusted publishing
1 parent 45734dd commit 543c179

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,29 @@ on:
44
push:
55
tags:
66
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: The version to build
711

812
jobs:
913
release:
1014
runs-on: ubuntu-latest
1115
environment: release
16+
permissions:
17+
id-token: write
1218
steps:
1319
- name: Checkout repository
14-
uses: actions/checkout@v4
20+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
21+
with:
22+
# The tag to build or the tag received by the tag event
23+
ref: ${{ github.event.inputs.version || github.ref }}
24+
persist-credentials: false
1525

16-
- uses: dtolnay/rust-toolchain@stable
26+
- uses: rust-lang/crates-io-auth-action@v1
27+
id: auth
1728

1829
- name: Publish to crates.io
1930
run: cargo publish
2031
env:
21-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
32+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)