Skip to content

Commit bcbc2bd

Browse files
annamcallisterjimthematrix
authored andcommitted
changes for trusted publishing
Signed-off-by: Anna McAllister <anna.mcallister@kaleido.io>
1 parent d577ad3 commit bcbc2bd

File tree

2 files changed

+6
-44
lines changed

2 files changed

+6
-44
lines changed

.github/workflows/release-solidity-package.yaml

Lines changed: 6 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,6 @@ permissions:
55
id-token: write
66
on:
77
workflow_call:
8-
secrets:
9-
NPM_TOKEN:
10-
description: "NPM token"
11-
required: true
128
inputs:
139
ref:
1410
description: "Commit ref for checkout"
@@ -23,30 +19,8 @@ on:
2319
description: 'Semicolon-separated list of tags (e.g., "latest;rc"). First tag is primary.'
2420
required: true
2521
type: string
26-
workflow_dispatch:
27-
inputs:
28-
ref:
29-
description: "Commit ref for checkout"
30-
required: false
31-
type: string
32-
default: ""
33-
package_version:
34-
description: "The version to publish (e.g. v1.0.0)"
35-
required: true
36-
type: string
37-
package_tag:
38-
description: 'Semicolon-separated list of tags (e.g., "latest;rc"). First tag is primary.'
39-
required: true
40-
type: string
41-
continue_on_error:
42-
description: "Continue workflow even if publish fails (default: false)"
43-
required: true
44-
type: boolean
45-
default: false
4622
jobs:
4723
publish:
48-
env:
49-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5024
runs-on: ubuntu-latest
5125
steps:
5226
- uses: actions/checkout@v4
@@ -65,9 +39,12 @@ jobs:
6539
6640
- uses: actions/setup-node@v4
6741
with:
68-
node-version: "20"
42+
node-version: "22.x"
6943
registry-url: "https://registry.npmjs.org"
7044

45+
- name: Install latest npm
46+
run: npm install -g npm@latest
47+
7148
- name: Install dependencies
7249
working-directory: solidity
7350
run: npm install
@@ -122,17 +99,16 @@ jobs:
12299
} >> $GITHUB_OUTPUT
123100
124101
- name: Publish to npm with primary tag
125-
continue-on-error: ${{ github.event_name == 'workflow_call' || inputs.continue_on_error != false }}
126102
working-directory: solidity
127103
shell: bash
128104
run: |
129105
set -e
130106
npm publish --provenance --access public --tag ${{ steps.parse_tags.outputs.primary_tag }}
131-
env:
132-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
133107
134108
- name: Add additional dist-tags
135109
if: steps.parse_tags.outputs.additional_tags != ''
110+
# allowing this step to fail until https://github.com/npm/cli/issues/8547 is resolved
111+
continue-on-error: true
136112
working-directory: solidity
137113
shell: bash
138114
run: |
@@ -150,5 +126,3 @@ jobs:
150126
npm dist-tag add "$PACKAGE_SPEC" "$tag"
151127
fi
152128
done <<< "${{ steps.parse_tags.outputs.additional_tags }}"
153-
env:
154-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,18 +97,6 @@ jobs:
9797
${{ runner.temp }}/zeto-artifacts/zeto-qurrency-test-proving-keys*.tar.gz
9898
${{ runner.temp }}/zeto-artifacts/zeto-contracts*.tar.gz
9999
100-
101-
publish-npm:
102-
name: Publish to NPM
103-
needs:
104-
- build
105-
uses: ./.github/workflows/release-solidity-package.yaml
106-
secrets:
107-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
108-
with:
109-
package_version: ${{ github.ref_name }}
110-
package_tag: latest
111-
112100
create-release:
113101
name: Create GitHub Release
114102
needs:

0 commit comments

Comments
 (0)