Skip to content

Commit 3ae4ea9

Browse files
authored
chore: switch to trusted crates.io publishing (#318)
1 parent 342c363 commit 3ae4ea9

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ on:
55
branches: [main]
66
push:
77
branches: [main]
8-
tags:
9-
- "*"
108
workflow_dispatch:
119

1210
jobs:
@@ -23,7 +21,7 @@ jobs:
2321

2422
steps:
2523
- name: Clone repository
26-
uses: actions/checkout@v4
24+
uses: actions/checkout@v5
2725

2826
- uses: denoland/setup-deno@v1
2927
- uses: dsherret/rust-toolchain-file@v1
@@ -46,12 +44,3 @@ jobs:
4644
run: cargo build --all-targets --all-features --release
4745
- name: Test
4846
run: cargo test --all-targets --all-features --release
49-
50-
- name: Publish
51-
if: |
52-
github.repository == 'denoland/deno_ast' &&
53-
startsWith(github.ref, 'refs/tags/')
54-
env:
55-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
56-
run: |
57-
cargo publish

.github/workflows/publish.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "*"
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: read
13+
id-token: write
14+
steps:
15+
- name: Clone repository
16+
uses: actions/checkout@v5
17+
- uses: rust-lang/crates-io-auth-action@v1
18+
id: auth
19+
- run: cargo publish
20+
env:
21+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
steps:
2121
- name: Clone repository
22-
uses: actions/checkout@v4
22+
uses: actions/checkout@v5
2323
with:
2424
token: ${{ secrets.DENOBOT_PAT }}
2525

0 commit comments

Comments
 (0)