Skip to content

Commit c4b2fbe

Browse files
committed
ci: updated ci config to use oidc auth for npm publish instead of old token system
1 parent 11fccd5 commit c4b2fbe

3 files changed

Lines changed: 40 additions & 18 deletions

File tree

.github/actions/setup/action.yml

Lines changed: 39 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,30 +9,60 @@ runs:
99
with:
1010
node-version-file: .nvmrc
1111

12-
- name: Restore dependencies
13-
id: yarn-cache
12+
# Create a minimal .yarnrc.yml without any plugin references
13+
- name: Create minimal Yarn config
14+
run: |
15+
cat > .yarnrc.yml << EOF
16+
nodeLinker: node-modules
17+
nmHoistingLimits: workspaces
18+
EOF
19+
shell: bash
20+
21+
# Setup Corepack for proper Yarn version management
22+
- name: Setup Corepack and Yarn
23+
run: |
24+
corepack enable
25+
corepack prepare yarn@4.9.2 --activate
26+
yarn --version
27+
shell: bash
28+
29+
- name: Configure Yarn and Generate .yarnrc.yml
30+
run: |
31+
yarn set version 4.9.2
32+
yarn config set nodeLinker node-modules
33+
yarn config set nmHoistingLimits workspaces
34+
shell: bash
35+
36+
- name: Verify .yarnrc.yml
37+
run: |
38+
cat .yarnrc.yml
39+
shell: bash
40+
41+
- name: Restore Yarn Cache
1442
uses: actions/cache/restore@v4
43+
id: yarn-cache
1544
with:
1645
path: |
1746
**/node_modules
47+
.yarn/cache
48+
.yarn/unplugged
1849
.yarn/install-state.gz
1950
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}-${{ hashFiles('**/package.json', '!node_modules/**') }}
2051
restore-keys: |
2152
${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
2253
${{ runner.os }}-yarn-
2354
2455
- name: Install dependencies
25-
if: steps.yarn-cache.outputs.cache-hit != 'true'
26-
run: |
27-
yarn install --cwd example --frozen-lockfile
28-
yarn install --frozen-lockfile
56+
run: yarn install
2957
shell: bash
3058

31-
- name: Cache dependencies
32-
if: steps.yarn-cache.outputs.cache-hit != 'true'
59+
- name: Save Yarn Cache
3360
uses: actions/cache/save@v4
61+
if: steps.yarn-cache.outputs.cache-hit != 'true'
3462
with:
3563
path: |
3664
**/node_modules
65+
.yarn/cache
66+
.yarn/unplugged
3767
.yarn/install-state.gz
38-
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}
68+
key: ${{ steps.yarn-cache.outputs.cache-primary-key }}

.github/workflows/ci.yml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,8 @@ jobs:
184184
uses: actions/setup-node@v4
185185
with:
186186
node-version: "lts/*" # Use the latest LTS version of Node.js
187-
registry-url: 'https://registry.npmjs.org/' # Specify npm registry
188-
189-
- name: Verify the integrity of provenance attestations and registry signatures for installed dependencies
190-
run: npm audit signatures # Check the signatures to verify integrity
191187

192188
- name: Release
193189
run: npx semantic-release # Run semantic-release to manage versioning and publishing
194190
env:
195-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication
196-
197-
# Why NODE_AUTH_TOKEN instead of NPM_TOKEN: https://github.com/semantic-release/semantic-release/issues/2313
198-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # npm token for publishing package
191+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # GitHub token for authentication

release.config.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ module.exports = {
1414
'@semantic-release/npm',
1515
{
1616
npmPublish: true,
17-
tag: 'beta', // Publishes with a 'beta' tag to npm
1817
},
1918
],
2019
'@semantic-release/github', // Handles GitHub releases

0 commit comments

Comments
 (0)