Skip to content

Commit fba63a8

Browse files
committed
[release] use trusted publishing
1 parent 47a911c commit fba63a8

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# adapted from https://github.com/taiki-e/cargo-hack/blob/main/.github/workflows/release.yml
22

3-
name: Publish releases to GitHub
3+
name: crates.io release
44
on:
55
push:
66
tags:
@@ -9,16 +9,22 @@ on:
99
jobs:
1010
create-release:
1111
if: github.repository_owner == 'sunshowers-code'
12-
runs-on: ubuntu-18.04
12+
runs-on: ubuntu-latest
13+
environment: release
14+
permissions:
15+
id-token: write # Required for OIDC token exchange.
16+
contents: write # Required for creating releases.
1317
steps:
14-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v6
1519
with:
1620
persist-credentials: false
21+
- uses: rust-lang/crates-io-auth-action@v1
22+
id: auth
1723
- name: Install Rust
1824
uses: dtolnay/rust-toolchain@stable
1925
- run: cargo publish
2026
env:
21-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
27+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
2228
- uses: taiki-e/create-gh-release-action@v1
2329
with:
2430
changelog: CHANGELOG.md

0 commit comments

Comments
 (0)