Skip to content

Commit 744545e

Browse files
committed
Update publish release workflow to work with npm trusted publishers
1 parent ecda525 commit 744545e

3 files changed

Lines changed: 29 additions & 18 deletions

File tree

.github/workflows/create-update-pr.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,27 @@
11
name: Create Update PR
2+
23
on:
34
workflow_dispatch:
45
# Auto-update every week on midnight Monday
56
schedule:
67
- cron: '0 0 * * 1'
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
pull-requests: write
13+
714
jobs:
815
update:
916
runs-on: ubuntu-latest
1017
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-node@v4
1320
with:
14-
node-version: 20.x
21+
node-version: '24'
1522
registry-url: 'https://registry.npmjs.org'
16-
- name: Install dependencies
17-
run: yarn
18-
- name: Generate new files
19-
run: yarn generate && yarn build
23+
- run: yarn
24+
- run: yarn generate && yarn build
2025
- name: Update version (major if there are deletions in enums.ts, otherwise minor)
2126
run: git diff src/enums.ts | grep "^-[^-]" && yarn version --major --no-git-tag-version || yarn version --minor --no-git-tag-version
2227
- name: Commit and create PR

.github/workflows/publish-release.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,30 @@
11
name: Publish Release
2+
23
on:
34
workflow_dispatch:
45
push:
56
branches:
67
- main
8+
9+
permissions:
10+
id-token: write
11+
contents: write
12+
713
jobs:
8-
update:
14+
publish:
915
runs-on: ubuntu-latest
1016
steps:
11-
- uses: actions/checkout@v2
12-
- uses: actions/setup-node@v2
17+
- uses: actions/checkout@v4
18+
- uses: actions/setup-node@v4
1319
with:
14-
node-version: 20.x
20+
node-version: '24'
1521
registry-url: 'https://registry.npmjs.org'
16-
- name: Install dependencies
17-
run: yarn
18-
- name: Publish to npm
19-
run: npm publish
20-
env:
21-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
22+
- run: yarn
23+
- run: npm publish
2224
- name: Get package.json info
2325
id: package_json
2426
uses: jaywcjlove/github-action-package@main
25-
- name: Create Release
27+
- name: Create GitHub Release
2628
uses: actions/create-release@latest
2729
env:
2830
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
{
22
"name": "@revoke.cash/chains",
3+
"repository": {
4+
"type": "git",
5+
"url": "https://github.com/RevokeCash/chains.git"
6+
},
37
"version": "75.0.0",
48
"description": "Helper module for getting EVM chains info.",
59
"author": "Revoke.cash",

0 commit comments

Comments
 (0)