Skip to content

Commit f7ddc62

Browse files
authored
Merge pull request #366 from starfy84/feat/trusted-publishing
feat: add crates.io trusted publishing support via OIDC
2 parents df445fd + de4147c commit f7ddc62

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

semantic-release-binary/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,12 +271,17 @@ runs:
271271
working-directory: ${{ env.node_workdir }}
272272
shell: bash
273273

274+
- name: Authenticate with crates.io (Trusted Publishing)
275+
if: inputs.cargo-registry-token == ''
276+
id: crates-io-auth
277+
uses: rust-lang/crates-io-auth-action@v1
278+
274279
- run: |
275280
: semantic-release
276281
${semantic_release}
277282
env:
278283
GITHUB_TOKEN: ${{ inputs.github_token }}
279-
CARGO_REGISTRY_TOKEN: ${{ inputs.cargo-registry-token }}
284+
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token || inputs.cargo-registry-token }}
280285
shell: bash
281286
282287
- run: |

semantic-release-library/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,10 +179,15 @@ runs:
179179
working-directory: ${{ env.node_workdir }}
180180
shell: bash
181181

182+
- name: Authenticate with crates.io (Trusted Publishing)
183+
if: inputs.cargo-registry-token == ''
184+
id: crates-io-auth
185+
uses: rust-lang/crates-io-auth-action@v1
186+
182187
- run: |
183188
: semantic-release
184189
${semantic_release}
185190
env:
186191
GITHUB_TOKEN: ${{ inputs.github_token }}
187-
CARGO_REGISTRY_TOKEN: ${{ inputs.cargo-registry-token }}
192+
CARGO_REGISTRY_TOKEN: ${{ steps.crates-io-auth.outputs.token || inputs.cargo-registry-token }}
188193
shell: bash

0 commit comments

Comments
 (0)