From 399caa95107d34ad767dcd68a1edf480015fc6ab Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 18:01:01 +0000 Subject: [PATCH 01/14] Add loglevel verbose --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e16f086..a9af341 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", "deploy": "npm run build && npm publish", - "deploy:beta": "npm run build && npm publish", + "deploy:beta": "npm run build && npm publish --loglevel verbose", "version": "oclif readme && git add README.md" }, "engines": { From 575859546e7e3b8da53a8889fc92216ced81a2e6 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 18:01:12 +0000 Subject: [PATCH 02/14] temp: publish on branch --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af83801..1dc7b1d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,8 @@ on: push: tags: - '*' + branches: + - ci/fix-npm-trusted-publishing permissions: id-token: write From 5cd751b1472b1757670629ff0e406165decdc91e Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 18:14:29 +0000 Subject: [PATCH 03/14] Add log level to correct command... --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index a9af341..b110536 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,8 @@ "posttest": "yarn lint", "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "deploy": "npm run build && npm publish", - "deploy:beta": "npm run build && npm publish --loglevel verbose", + "deploy": "npm run build && npm publish --loglevel verbose", + "deploy:beta": "npm run build && npm publish", "version": "oclif readme && git add README.md" }, "engines": { From d4237bd707e5e2ccc59517b371b313da2d8cb41c Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 18:21:02 +0000 Subject: [PATCH 04/14] add npm install latest --- .github/workflows/publish.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1dc7b1d..399ddfb 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,5 +25,7 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing + - run: npm i -g npm@latest + - run: npm i - run: npm run deploy From 7d9c70fc7654faced4add59f3ac1a744850cb919 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 18:32:35 +0000 Subject: [PATCH 05/14] checkout -> v5, minor tweaks to publish command --- .github/workflows/publish.yml | 4 +--- package.json | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 399ddfb..d20ce7d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,14 +18,12 @@ jobs: steps: - name: Cloning repo - uses: actions/checkout@v4 + uses: actions/checkout@v5 - uses: actions/setup-node@v4 with: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing - - run: npm i -g npm@latest - - run: npm i - run: npm run deploy diff --git a/package.json b/package.json index b110536..f3ced51 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "posttest": "yarn lint", "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "deploy": "npm run build && npm publish --loglevel verbose", + "deploy": "npm run build && npm publish --provenance --access public --loglevel verbose", "deploy:beta": "npm run build && npm publish", "version": "oclif readme && git add README.md" }, From 97e2267717019ab22a9f50935ac33893d3e4181e Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 19:53:09 +0000 Subject: [PATCH 06/14] npm i latest --- .github/workflows/publish.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index d20ce7d..5850637 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,5 +25,8 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing + - run: | + npm i -g npm@latest + npm --version - run: npm i - run: npm run deploy From 3a98b8d226730a28c6bc0decfeb04f214ec53d59 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 19:55:43 +0000 Subject: [PATCH 07/14] npx maybe? --- .github/workflows/publish.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5850637..b84e7e6 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,8 +25,10 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing - - run: | - npm i -g npm@latest - npm --version - run: npm i - - run: npm run deploy + - name: Build + run: npm run build + + # 🔑 Use npm@latest directly for publish + - name: Publish (trusted publishing) + run: npx -y npm@latest publish --provenance --access public --loglevel verbose From 9c386e30984bacf615172c3cca1ed0de7af12ed8 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 19:59:30 +0000 Subject: [PATCH 08/14] Tidying --- .github/workflows/publish.yml | 11 ++--------- package.json | 4 ++-- 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index b84e7e6..af83801 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,8 +4,6 @@ on: push: tags: - '*' - branches: - - ci/fix-npm-trusted-publishing permissions: id-token: write @@ -18,7 +16,7 @@ jobs: steps: - name: Cloning repo - uses: actions/checkout@v5 + uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: @@ -26,9 +24,4 @@ jobs: registry-url: 'https://registry.npmjs.org' # required for trusted publishing - run: npm i - - name: Build - run: npm run build - - # 🔑 Use npm@latest directly for publish - - name: Publish (trusted publishing) - run: npx -y npm@latest publish --provenance --access public --loglevel verbose + - run: npm run deploy diff --git a/package.json b/package.json index f3ced51..41662e4 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,8 @@ "posttest": "yarn lint", "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "deploy": "npm run build && npm publish --provenance --access public --loglevel verbose", - "deploy:beta": "npm run build && npm publish", + "deploy": "npm run build && npx -y npm@latest publish", + "deploy:beta": "npm run build && npx -y npm@latest publish", "version": "oclif readme && git add README.md" }, "engines": { From d821e1e783b1cc8893529938d1c427d4af1ac547 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 20:02:44 +0000 Subject: [PATCH 09/14] Try one final (simpler) change to update npm --- .github/workflows/publish.yml | 3 +++ package.json | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index af83801..0318c0d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,6 +4,8 @@ on: push: tags: - '*' + branches: + - ci/fix-npm-trusted-publishing permissions: id-token: write @@ -23,5 +25,6 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing + - run: npm install -g npm@latest - run: npm i - run: npm run deploy diff --git a/package.json b/package.json index 41662e4..e16f086 100644 --- a/package.json +++ b/package.json @@ -63,8 +63,8 @@ "posttest": "yarn lint", "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "deploy": "npm run build && npx -y npm@latest publish", - "deploy:beta": "npm run build && npx -y npm@latest publish", + "deploy": "npm run build && npm publish", + "deploy:beta": "npm run build && npm publish", "version": "oclif readme && git add README.md" }, "engines": { From 44faf5bfc6636dbbb3e5c97047a97e4303366357 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 20:04:14 +0000 Subject: [PATCH 10/14] add verbose loglevel --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index e16f086..b110536 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "posttest": "yarn lint", "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "deploy": "npm run build && npm publish", + "deploy": "npm run build && npm publish --loglevel verbose", "deploy:beta": "npm run build && npm publish", "version": "oclif readme && git add README.md" }, From c7b3114caeb461f48c0b458628383ae327ca3575 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 20:05:43 +0000 Subject: [PATCH 11/14] verbose log --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0318c0d..88b1437 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,6 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing - - run: npm install -g npm@latest + - run: npm install -g npm@latest --loglevel verbose - run: npm i - run: npm run deploy From 98b93900d6654614c5dc275f480a43af22254e81 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 20:07:14 +0000 Subject: [PATCH 12/14] Add minimum npm version --- package.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index b110536..878a978 100644 --- a/package.json +++ b/package.json @@ -68,7 +68,8 @@ "version": "oclif readme && git add README.md" }, "engines": { - "node": ">=12.0.0" + "node": ">=12.0.0", + "npm": ">=11.5.1" }, "bugs": "https://github.com/Flagsmith/flagsmith-cli/issues", "keywords": [ From 611e86b61bd727933986949945790a3b5943521b Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 20:25:07 +0000 Subject: [PATCH 13/14] Revert all unnecessary changes --- .github/workflows/publish.yml | 4 ++-- package.json | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 88b1437..f7e6422 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -25,6 +25,6 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing - - run: npm install -g npm@latest --loglevel verbose - run: npm i - - run: npm run deploy + - run: npm run build + - run: npx -y npm@latest publish diff --git a/package.json b/package.json index 878a978..e16f086 100644 --- a/package.json +++ b/package.json @@ -63,13 +63,12 @@ "posttest": "yarn lint", "prepack": "yarn build && oclif manifest && oclif readme", "test": "mocha --forbid-only \"test/**/*.test.ts\"", - "deploy": "npm run build && npm publish --loglevel verbose", + "deploy": "npm run build && npm publish", "deploy:beta": "npm run build && npm publish", "version": "oclif readme && git add README.md" }, "engines": { - "node": ">=12.0.0", - "npm": ">=11.5.1" + "node": ">=12.0.0" }, "bugs": "https://github.com/Flagsmith/flagsmith-cli/issues", "keywords": [ From e9bc9b7cce09b0236e6eb27fa9b30e056968a102 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Mon, 24 Nov 2025 20:37:17 +0000 Subject: [PATCH 14/14] Remove temporary branch trigger --- .github/workflows/publish.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f7e6422..adf22b8 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -4,8 +4,6 @@ on: push: tags: - '*' - branches: - - ci/fix-npm-trusted-publishing permissions: id-token: write