From b47e8ebc7e76e8ff46bba6dc409f3f2b43e397fc Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:14:37 +0000 Subject: [PATCH 1/7] Add NPM trusted publishing and release please --- .github/workflows/conventional-commit.yml | 29 +++++++++++ .github/workflows/publish.yml | 17 +++++-- .github/workflows/release-please.yml | 18 +++++++ .release-please-manifest.json | 1 + CHANGELOG.md | 38 ++++++++++++++ release-please-config.json | 62 +++++++++++++++++++++++ 6 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/conventional-commit.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 CHANGELOG.md create mode 100644 release-please-config.json diff --git a/.github/workflows/conventional-commit.yml b/.github/workflows/conventional-commit.yml new file mode 100644 index 0000000..facc6f6 --- /dev/null +++ b/.github/workflows/conventional-commit.yml @@ -0,0 +1,29 @@ +name: Conventional Commit + +on: + pull_request: + types: + - edited + - opened + +jobs: + conventional-commit: + name: Conventional Commit + runs-on: ubuntu-latest + steps: + - name: Check PR Conventional Commit title + uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | # mirrors changelog-sections in the /release-please-config.json + feat + fix + infra + ci + docs + deps + perf + refactor + test + chore diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 51d2862..32cb442 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,18 +5,25 @@ on: tags: - '*' +permissions: + id-token: write + contents: read + jobs: package: runs-on: ubuntu-latest name: Publish NPM Package steps: - - name: Check out repository + - name: Cloning repo uses: actions/checkout@v4 - - name: Clone and Install - uses: ./.github/actions/install + - uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + registry-url: 'https://registry.npmjs.org' # required for trusted publishing + # npm>=11.5.1 required for NPM trusted publishing + - run: npm install -g npm@latest + - run: npm i - run: npm run deploy - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..968c75b --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,18 @@ +name: Update release PR + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..57e0617 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1 @@ +{".":"0.2.1"} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0b1e64a --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,38 @@ + +# [0.2.1 - Update Flagsmith sdk](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.2.1) - 2025-03-20 + +Merges [#25](https://github.com/Flagsmith/flagsmith-cli/pull/25) + +[Changes][0.2.1] + + + +# [0.1.3 - Adds prettify flag -p](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.1.3) - 2023-05-29 + +[#12](https://github.com/Flagsmith/flagsmith-cli/pull/12) + +[Changes][0.1.3] + + + +# [0.1.2 - Add Identity flag -i](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.1.2) - 2023-05-29 + +[#11](https://github.com/Flagsmith/flagsmith-cli/pull/11) + +[Changes][0.1.2] + + + +# [0.1.1 - Fix api-input in a wrong const](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.1.1) - 2023-01-20 + +Merges [#10](https://github.com/Flagsmith/flagsmith-cli/pull/10), thank you very much [@vladaCizek](https://github.com/vladaCizek)! 🚀 + +[Changes][0.1.1] + + +[0.2.1]: https://github.com/Flagsmith/flagsmith-cli/compare/0.1.3...0.2.1 +[0.1.3]: https://github.com/Flagsmith/flagsmith-cli/compare/0.1.2...0.1.3 +[0.1.2]: https://github.com/Flagsmith/flagsmith-cli/compare/0.1.1...0.1.2 +[0.1.1]: https://github.com/Flagsmith/flagsmith-cli/tree/0.1.1 + + diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..aa12672 --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,62 @@ +{ + "bootstrap-sha": "1893840aa3f6510d62820fcd291956117fa268d4", + "packages": { + ".": { + "release-type": "node", + "changelog-path": "CHANGELOG.md", + "bump-minor-pre-major": false, + "bump-patch-for-minor-pre-major": false, + "draft": false, + "prerelease": false, + "include-component-in-tag": false + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "changelog-sections": [ + { + "type": "feat", + "hidden": false, + "section": "Features" + }, + { + "type": "fix", + "hidden": false, + "section": "Bug Fixes" + }, + { + "type": "ci", + "hidden": false, + "section": "CI" + }, + { + "type": "docs", + "hidden": false, + "section": "Docs" + }, + { + "type": "deps", + "hidden": false, + "section": "Dependency Updates" + }, + { + "type": "perf", + "hidden": false, + "section": "Performance Improvements" + }, + { + "type": "refactor", + "hidden": false, + "section": "Refactoring" + }, + { + "type": "test", + "hidden": false, + "section": "Tests" + }, + { + "type": "chore", + "hidden": false, + "section": "Other" + } + ] +} From 3e245f48535a8365b10ac2d95acefabe1a3b9536 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:28:50 +0000 Subject: [PATCH 2/7] Use workflow permissions instead --- .github/workflows/conventional-commit.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/conventional-commit.yml b/.github/workflows/conventional-commit.yml index facc6f6..fb6e50f 100644 --- a/.github/workflows/conventional-commit.yml +++ b/.github/workflows/conventional-commit.yml @@ -6,6 +6,9 @@ on: - edited - opened +permissions: + pull-requests: read + jobs: conventional-commit: name: Conventional Commit @@ -13,8 +16,6 @@ jobs: steps: - name: Check PR Conventional Commit title uses: amannn/action-semantic-pull-request@v5 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: types: | # mirrors changelog-sections in the /release-please-config.json feat From db79388946a6a875a2f4b4f3841972c3564129fa Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:37:32 +0000 Subject: [PATCH 3/7] Remove unnecessary npm upgrade --- .github/workflows/publish.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 32cb442..af83801 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -23,7 +23,5 @@ jobs: node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' # required for trusted publishing - # npm>=11.5.1 required for NPM trusted publishing - - run: npm install -g npm@latest - run: npm i - run: npm run deploy From e86c9cfec8b1cd244579921b3533f85d984530c3 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:37:59 +0000 Subject: [PATCH 4/7] Add .nvmrc --- .nvmrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .nvmrc diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..a45fd52 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +24 From 8a01be4153a7506381b34702a0f4de004895bf43 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:38:45 +0000 Subject: [PATCH 5/7] Update (pointless?) reusable action --- .github/actions/install/action.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml index e926861..773235e 100644 --- a/.github/actions/install/action.yml +++ b/.github/actions/install/action.yml @@ -6,7 +6,7 @@ runs: - name: Set up Node uses: actions/setup-node@v4 with: - node-version: '18.x' + node-version-file: .nvmrc registry-url: 'https://registry.npmjs.org' - name: Install dependencies From 7bdb4207921019ab08bbc4969747c4dce2c488b7 Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:39:47 +0000 Subject: [PATCH 6/7] Remove unnecessary reusable action --- .github/actions/install/action.yml | 14 -------------- .github/workflows/pull-request.yml | 11 +++++++++-- 2 files changed, 9 insertions(+), 16 deletions(-) delete mode 100644 .github/actions/install/action.yml diff --git a/.github/actions/install/action.yml b/.github/actions/install/action.yml deleted file mode 100644 index 773235e..0000000 --- a/.github/actions/install/action.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: "Clone and Install" -description: "Clones repository and sets up Node environment" -runs: - using: "composite" - steps: - - name: Set up Node - uses: actions/setup-node@v4 - with: - node-version-file: .nvmrc - registry-url: 'https://registry.npmjs.org' - - - name: Install dependencies - run: npm install - shell: bash diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index aa85da8..c72d0ee 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -18,8 +18,15 @@ jobs: - name: Check out repository uses: actions/checkout@v4 - - name: Clone and Install - uses: ./.github/actions/install + - name: Set up Node + uses: actions/setup-node@v4 + with: + node-version-file: .nvmrc + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: npm install + shell: bash - name: Build run: npm run build From 2539d7ed6873519e98948718f5247ea16d77529c Mon Sep 17 00:00:00 2001 From: Matthew Elwell Date: Thu, 6 Nov 2025 16:42:30 +0000 Subject: [PATCH 7/7] Re-add github token --- .github/workflows/conventional-commit.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/conventional-commit.yml b/.github/workflows/conventional-commit.yml index fb6e50f..facc6f6 100644 --- a/.github/workflows/conventional-commit.yml +++ b/.github/workflows/conventional-commit.yml @@ -6,9 +6,6 @@ on: - edited - opened -permissions: - pull-requests: read - jobs: conventional-commit: name: Conventional Commit @@ -16,6 +13,8 @@ jobs: steps: - name: Check PR Conventional Commit title uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: types: | # mirrors changelog-sections in the /release-please-config.json feat