Skip to content

Commit 4cc0823

Browse files
authored
Merge pull request #87 from tomodachi94/ci-trusted-publishing
ci: start setting up trusted publishing
2 parents 35edb5f + f7efb7e commit 4cc0823

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -634,9 +634,13 @@ jobs:
634634
- name: Install Rust toolchain
635635
uses: dtolnay/rust-toolchain@stable
636636

637+
- name: Authenticate to crates.io
638+
uses: rust-lang/crates-io-auth-action@v1
639+
id: auth
640+
637641
- name: Publish to crates.io
638642
env:
639-
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
643+
CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
640644
run: cargo publish --no-verify
641645

642646
# Publish TypeScript package to npm
@@ -645,6 +649,9 @@ jobs:
645649
needs: [build-ios, build-android]
646650
runs-on: ubuntu-latest
647651
if: startsWith(github.ref, 'refs/tags/') && github.event.inputs.dry_run != 'true'
652+
permissions:
653+
contents: read
654+
id-token: write
648655
steps:
649656
- name: Checkout sources
650657
uses: actions/checkout@v4
@@ -669,6 +676,4 @@ jobs:
669676
670677
- name: Publish to npm
671678
working-directory: typescript
672-
env:
673-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
674679
run: npm publish --access public

0 commit comments

Comments
 (0)