Skip to content

Commit

Permalink
chore: try 2fa publish
Browse files Browse the repository at this point in the history
  • Loading branch information
hardfist committed Jan 23, 2025
1 parent 37b59a9 commit ac208b3
Showing 1 changed file with 22 additions and 1 deletion.
23 changes: 22 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ permissions:
jobs:
release:
name: Release
environment: npm
permissions:
contents: write
# To publish packages with provenance
Expand All @@ -67,13 +68,33 @@ jobs:

- name: Run Test
run: pnpm run test

- name: Obtain OIDC token
id: oidc
run: |
token=$(curl --fail -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" \
"$ACTIONS_ID_TOKEN_REQUEST_URL&audience=cfa.rspack.dev" | jq -r '.value')
echo "::add-mask::${token}"
echo "token=${token}" >> $GITHUB_OUTPUT
shell: bash
- name: Obtain GitHub credentials
id: github_creds
run: |
token=$(curl --fail "https://cfa.rspack.dev/api/request/${{ secrets.CFA_PROJECT_ID }}/github/credentials" \
-X POST \
-H "Content-Type: application/json" \
-H "Authorization: bearer ${{ secrets.CFA_SECRET }}" \
--data "{\"token\":\"${{ steps.oidc.outputs.token }}\"}" | jq -r '.GITHUB_TOKEN')
echo "::add-mask::${token}"
echo "token=${token}" >> $GITHUB_OUTPUT
shell: bash
- name: Try release to npm
run: pnpm run release
env:
DRY_RUN: ${{ inputs.dry_run }}
TAG: ${{ inputs.tag }}
VERSION: ${{ inputs.version }}
GITHUB_TOKEN: ${{ steps.github_creds.outputs.token }}
GITHUB_OIDC_TOKEN: ${{ steps.oidc.outputs.token }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}


0 comments on commit ac208b3

Please sign in to comment.