Skip to content

Commit 038ebe8

Browse files
ci(core): refine release workflow (npm auth, registry, branch fetch)
1 parent 5f44b8a commit 038ebe8

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

.github/workflows/release.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ on:
1616
default: 'main'
1717

1818
permissions:
19+
# Needed for npm provenance or token auth
1920
id-token: write
21+
# Harmless here; no tag push, but keeps flexibility if added later
22+
contents: write
2023

2124
jobs:
2225
release:
@@ -43,6 +46,7 @@ jobs:
4346
with:
4447
node-version: 22
4548
cache: 'pnpm'
49+
registry-url: 'https://registry.npmjs.org'
4650

4751
# Update npm to the latest version to enable OIDC
4852
- name: Update npm
@@ -60,17 +64,22 @@ jobs:
6064
6165
- name: Build and test Packages
6266
run: |
63-
git fetch origin main
67+
git fetch origin ${{ github.event.inputs.branch }} --tags --prune
6468
npx nx run-many --targets=build --projects=tag:type:pkg --skip-nx-cache
6569
npx nx run-many --targets=build --projects=tag:type:metro
6670
ls -l packages/*/dist packages/*/package.json
6771
6872
- name: Publish latest version
6973
if: github.event.inputs.version == 'latest'
74+
env:
75+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
7076
run: |
7177
pnpm -r publish --tag ${{ github.event.inputs.version }} --publish-branch ${{ github.event.inputs.branch }}
7278
7379
- name: Publish preview version
7480
if: github.event.inputs.version == 'next'
81+
env:
82+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
83+
NPM_CONFIG_PROVENANCE: 'true'
7584
run: |
7685
pnpm -r publish --tag next --no-git-checks

0 commit comments

Comments
 (0)