Skip to content

Commit b3c951e

Browse files
authored
fix: NPM publish (#176)
1 parent a8fab7c commit b3c951e

File tree

2 files changed

+34
-18
lines changed

2 files changed

+34
-18
lines changed

.github/workflows/publish.yml

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,26 +12,43 @@ name: Publish Package to npmjs
1212
on:
1313
release:
1414
types: [created]
15+
permissions:
16+
id-token: write
17+
contents: read
18+
env:
19+
NODE_OPTIONS: "--max_old_space_size=4096"
1520
jobs:
1621
build:
1722
runs-on: ubuntu-latest
1823
steps:
19-
- uses: actions/checkout@v2
24+
- uses: actions/checkout@v4
25+
26+
# Setup Node.js version first
27+
- uses: actions/setup-node@v3
28+
with:
29+
node-version: "22.18.0"
30+
always-auth: true
31+
registry-url: "https://registry.npmjs.org"
2032

2133
# Note we set an `id` called `release`. We'll use that later...
2234
- name: Validate and extract release information
2335
id: release
2436
uses: manovotny/[email protected]
2537

26-
# Setup .npmrc file to publish to npm
27-
- uses: actions/setup-node@v3
28-
with:
29-
node-version: "16.x"
30-
always-auth: true
31-
registry-url: "https://registry.npmjs.org"
38+
- name: Install dependencies
39+
run: yarn install --frozen-lockfile
40+
41+
- name: Build
42+
run: yarn build
43+
44+
- name: Update npm
45+
run: npm install -g npm@latest
3246

33-
# Perform installs, run tests, run a build step, etc. here, as needed.
34-
- run: yarn
47+
- name: Log Node & npm versions (after update)
48+
# Make sure we hit 11.5.1 version requirement for Trusted Publishing
49+
run: |
50+
node -v
51+
npm -v
3552
3653
# The last two steps will publish the package. Note that we're using
3754
# information from the `release` step above (I told you we'd use it
@@ -53,12 +70,8 @@ jobs:
5370
# This will publish a version of a package.
5471
- name: Publish version
5572
if: steps.release.outputs.tag == ''
56-
run: yarn publish
57-
env:
58-
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
73+
run: npm publish
5974

6075
- name: Publish tagged version
6176
if: steps.release.outputs.tag != ''
62-
run: yarn publish --tag ${{ steps.release.outputs.tag }}
63-
env:
64-
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
77+
run: npm publish --tag ${{ steps.release.outputs.tag }}

package.json

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
{
22
"name": "@across-protocol/constants",
3-
"version": "3.1.92",
3+
"version": "3.1.93",
44
"description": "Export commonly re-used values for Across repositories",
5-
"repository": "https://github.com/across-protocol/constants.git",
5+
"repository": {
6+
"type": "git",
7+
"url": "https://github.com/across-protocol/constants"
8+
},
69
"author": "[email protected]",
710
"license": "AGPL-3.0-only",
811
"private": false,
912
"publishConfig": {
10-
"registry": "https://registry.npmjs.com/",
13+
"registry": "https://registry.npmjs.org/",
1114
"access": "public"
1215
},
1316
"type": "module",

0 commit comments

Comments
 (0)