Skip to content

Commit d6fe2bc

Browse files
ci: add NPM trusted publishing and release please (#33)
* Add NPM trusted publishing and release please * Use workflow permissions instead * Remove unnecessary npm upgrade * Add .nvmrc * Update (pointless?) reusable action * Remove unnecessary reusable action * Re-add github token
1 parent fa5d5da commit d6fe2bc

9 files changed

Lines changed: 168 additions & 21 deletions

File tree

.github/actions/install/action.yml

Lines changed: 0 additions & 14 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Conventional Commit
2+
3+
on:
4+
pull_request:
5+
types:
6+
- edited
7+
- opened
8+
9+
jobs:
10+
conventional-commit:
11+
name: Conventional Commit
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Check PR Conventional Commit title
15+
uses: amannn/action-semantic-pull-request@v5
16+
env:
17+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
18+
with:
19+
types: | # mirrors changelog-sections in the /release-please-config.json
20+
feat
21+
fix
22+
infra
23+
ci
24+
docs
25+
deps
26+
perf
27+
refactor
28+
test
29+
chore

.github/workflows/publish.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,23 @@ on:
55
tags:
66
- '*'
77

8+
permissions:
9+
id-token: write
10+
contents: read
11+
812
jobs:
913
package:
1014
runs-on: ubuntu-latest
1115
name: Publish NPM Package
1216

1317
steps:
14-
- name: Check out repository
18+
- name: Cloning repo
1519
uses: actions/checkout@v4
1620

17-
- name: Clone and Install
18-
uses: ./.github/actions/install
21+
- uses: actions/setup-node@v4
22+
with:
23+
node-version-file: .nvmrc
24+
registry-url: 'https://registry.npmjs.org' # required for trusted publishing
1925

26+
- run: npm i
2027
- run: npm run deploy
21-
env:
22-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/pull-request.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,15 @@ jobs:
1818
- name: Check out repository
1919
uses: actions/checkout@v4
2020

21-
- name: Clone and Install
22-
uses: ./.github/actions/install
21+
- name: Set up Node
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version-file: .nvmrc
25+
registry-url: 'https://registry.npmjs.org'
26+
27+
- name: Install dependencies
28+
run: npm install
29+
shell: bash
2330

2431
- name: Build
2532
run: npm run build
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Update release PR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: write
10+
pull-requests: write
11+
12+
jobs:
13+
release-please:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: googleapis/release-please-action@v4
17+
with:
18+
token: ${{ secrets.RELEASE_PLEASE_GITHUB_TOKEN }}

.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24

.release-please-manifest.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{".":"0.2.1"}

CHANGELOG.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<a id="0.2.1"></a>
2+
# [0.2.1 - Update Flagsmith sdk](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.2.1) - 2025-03-20
3+
4+
Merges [#25](https://github.com/Flagsmith/flagsmith-cli/pull/25)
5+
6+
[Changes][0.2.1]
7+
8+
9+
<a id="0.1.3"></a>
10+
# [0.1.3 - Adds prettify flag -p](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.1.3) - 2023-05-29
11+
12+
[#12](https://github.com/Flagsmith/flagsmith-cli/pull/12)
13+
14+
[Changes][0.1.3]
15+
16+
17+
<a id="0.1.2"></a>
18+
# [0.1.2 - Add Identity flag -i](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.1.2) - 2023-05-29
19+
20+
[#11](https://github.com/Flagsmith/flagsmith-cli/pull/11)
21+
22+
[Changes][0.1.2]
23+
24+
25+
<a id="0.1.1"></a>
26+
# [0.1.1 - Fix api-input in a wrong const](https://github.com/Flagsmith/flagsmith-cli/releases/tag/0.1.1) - 2023-01-20
27+
28+
Merges [#10](https://github.com/Flagsmith/flagsmith-cli/pull/10), thank you very much [@vladaCizek](https://github.com/vladaCizek)! 🚀
29+
30+
[Changes][0.1.1]
31+
32+
33+
[0.2.1]: https://github.com/Flagsmith/flagsmith-cli/compare/0.1.3...0.2.1
34+
[0.1.3]: https://github.com/Flagsmith/flagsmith-cli/compare/0.1.2...0.1.3
35+
[0.1.2]: https://github.com/Flagsmith/flagsmith-cli/compare/0.1.1...0.1.2
36+
[0.1.1]: https://github.com/Flagsmith/flagsmith-cli/tree/0.1.1
37+
38+
<!-- Generated by https://github.com/rhysd/changelog-from-release v3.9.0 -->

release-please-config.json

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"bootstrap-sha": "1893840aa3f6510d62820fcd291956117fa268d4",
3+
"packages": {
4+
".": {
5+
"release-type": "node",
6+
"changelog-path": "CHANGELOG.md",
7+
"bump-minor-pre-major": false,
8+
"bump-patch-for-minor-pre-major": false,
9+
"draft": false,
10+
"prerelease": false,
11+
"include-component-in-tag": false
12+
}
13+
},
14+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
15+
"changelog-sections": [
16+
{
17+
"type": "feat",
18+
"hidden": false,
19+
"section": "Features"
20+
},
21+
{
22+
"type": "fix",
23+
"hidden": false,
24+
"section": "Bug Fixes"
25+
},
26+
{
27+
"type": "ci",
28+
"hidden": false,
29+
"section": "CI"
30+
},
31+
{
32+
"type": "docs",
33+
"hidden": false,
34+
"section": "Docs"
35+
},
36+
{
37+
"type": "deps",
38+
"hidden": false,
39+
"section": "Dependency Updates"
40+
},
41+
{
42+
"type": "perf",
43+
"hidden": false,
44+
"section": "Performance Improvements"
45+
},
46+
{
47+
"type": "refactor",
48+
"hidden": false,
49+
"section": "Refactoring"
50+
},
51+
{
52+
"type": "test",
53+
"hidden": false,
54+
"section": "Tests"
55+
},
56+
{
57+
"type": "chore",
58+
"hidden": false,
59+
"section": "Other"
60+
}
61+
]
62+
}

0 commit comments

Comments
 (0)