Skip to content

Commit fd7f0c7

Browse files
authored
js: Replace yarn with npm (#2130)
Replace yarn with npm. The yarn version available in the arch repos, and installed on the Ubuntu2404 actions runner is 1.22.22. To publish packages to npmjs with the trusted OIDC publishing, we need the latest yarn (v4.x) or the latest npm. I chose to go with the latest npm, it's much better than yarn 👍
2 parents bab4513 + 7307764 commit fd7f0c7

File tree

5 files changed

+2610
-1412
lines changed

5 files changed

+2610
-1412
lines changed

.github/workflows/javascript-lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,14 @@ jobs:
2828
- name: Install modules
2929
run: |
3030
cd javascript
31-
yarn
31+
npm install
3232
3333
- name: Lint
3434
run: |
3535
cd javascript
36-
yarn run check
36+
npm run check
3737
3838
- name: Test
3939
run: |
4040
cd javascript
41-
yarn run test
41+
npm run test

.github/workflows/javascript-release.yml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ on:
1515
types:
1616
- completed
1717

18+
permissions:
19+
id-token: write
20+
contents: read
21+
1822
jobs:
1923
build:
2024
runs-on: ubuntu-24.04
@@ -28,15 +32,13 @@ jobs:
2832
node-version: 'latest'
2933
registry-url: 'https://registry.npmjs.org'
3034

31-
- name: Install modules
35+
- name: Install modules and update NPM
3236
run: |
3337
cd javascript
34-
yarn
38+
npm install -g npm@latest
39+
npm install
3540
3641
- name: Publish
3742
if: ${{ github.ref_type == 'tag' || startsWith(github.event.workflow_run.head_branch,'v') }}
3843
run: |
39-
cd javascript
40-
yarn publish
41-
env:
42-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
44+
npm publish

0 commit comments

Comments
 (0)