Skip to content

Commit ee87f78

Browse files
toml01claude
andcommitted
OIDC trusted publishing with minimal changes
Required changes for npm OIDC: - Node 22.x + npm >= 11.5 (required for OIDC) - Remove registry-url from setup-node - Add repository field to package.json - id-token: write permission (already present) Note: --provenance flag not needed, automatic with OIDC TEMPORARY: push trigger for testing Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 368d554 commit ee87f78

2 files changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ name: Publish Cofhe Contracts Package to npmjs
22
on:
33
release:
44
types: [published]
5-
push: # TEMPORARY: for testing OIDC - remove before merge
5+
push: # TEMPORARY: for testing - remove before merge
66
branches: [fix/npm-oidc-provenance]
77

88
permissions:
99
contents: read
10-
id-token: write # Required for NPM provenance
10+
id-token: write # Required for NPM OIDC trusted publishing
1111

1212
jobs:
1313
publish:
@@ -16,28 +16,28 @@ jobs:
1616
- uses: actions/checkout@v3
1717
- uses: actions/setup-node@v4
1818
with:
19-
node-version: 22.x # Node 22 ships with npm 11.x needed for OIDC
20-
# Note: NOT setting registry-url so npm can use OIDC natively
19+
node-version: 22.x # Node 22 for npm 11.x (OIDC requires npm >= 11.5)
2120
- name: Upgrade npm for OIDC support
22-
run: npm install -g npm@latest # Ensure npm >= 11.5 for trusted publishing
21+
run: npm install -g npm@latest
2322
- name: Install pnpm
2423
uses: pnpm/action-setup@v4
2524
with:
2625
version: latest
2726
run_install: false
2827
- name: Install deps
2928
run: cd contracts && pnpm install
30-
29+
3130
- name: Read package version
3231
id: package_version
3332
run: echo "VERSION=$(jq -r .version < ./contracts/package.json)" >> $GITHUB_ENV
3433

3534
- name: Determine prerelease tag
3635
id: prerelease_check
3736
run: |
38-
if [[ "${{ env.VERSION }}" =~ \-(alpha|beta)\.[0-9]+$ ]]; then
37+
if [[ "${{ env.VERSION }}" =~ \-(alpha|beta|test)\.[0-9]+$ ]]; then
3938
echo "PRERELEASE=--tag beta" >> $GITHUB_ENV
4039
else
4140
echo "PRERELEASE=" >> $GITHUB_ENV
4241
fi
43-
- run: cd contracts && npm publish --provenance --access public --tag test # TEMPORARY: testing OIDC with test tag
42+
- name: Publish to npm
43+
run: cd contracts && pnpm publish --no-git-checks ${{ env.PRERELEASE }}

contracts/package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
{
22
"name": "@fhenixprotocol/cofhe-contracts",
33
"description": "Smart Contract Library for the CoFHE with FHE primitives",
4-
"version": "0.0.14-test.7",
4+
"version": "0.0.14-test.9",
55
"author": {
66
"name": "FhenixProtocol",
77
"url": "https://github.com/FhenixProtocol/cofhe-contracts"
88
},
9+
"repository": {
10+
"type": "git",
11+
"url": "https://github.com/FhenixProtocol/cofhe-contracts"
12+
},
913
"files": [
1014
"FHE.sol",
1115
"ICofhe.sol"

0 commit comments

Comments
 (0)