Skip to content

Commit 1b7602b

Browse files
committed
Add crates.io publishing workflow
1 parent dec760c commit 1b7602b

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish to crates.io
2+
on:
3+
push:
4+
tags: ['v*'] # Triggers when pushing tags starting with 'v'
5+
jobs:
6+
publish:
7+
if: github.repository == 'ruby/prism'
8+
runs-on: ubuntu-latest
9+
environment: release # Optional: for enhanced security
10+
permissions:
11+
id-token: write # Required for OIDC token exchange
12+
steps:
13+
- name: Harden Runner
14+
uses: step-security/harden-runner@f4a75cfd619ee5ce8d5b864b0d183aff3c69b55a # v2.13.1
15+
with:
16+
egress-policy: audit
17+
- uses: actions/checkout@v5
18+
19+
- name: Set up Ruby
20+
uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
21+
with:
22+
ruby-version: ${{ matrix.ruby }}
23+
24+
- name: Install dependencies
25+
run: bundle install --jobs 4 --retry 3
26+
27+
- uses: rust-lang/crates-io-auth-action@v1
28+
id: auth
29+
30+
- run: bundle exec rake cargo:publish:real
31+
env:
32+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}

0 commit comments

Comments
 (0)