Skip to content

Commit e1ce2ad

Browse files
authored
ci: swap release process to release-please (#508)
**What is the purpose of this pull request?** To improve the release process by swapping to release-please. Fixes #506 **What changes did you make? (Give an overview)** Removed `cycjimmy/semantic-release-action` and added `googleapis/release-please-action`
1 parent 948c097 commit e1ce2ad

File tree

6 files changed

+72
-48
lines changed

6 files changed

+72
-48
lines changed

.github/release-please/config.json

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/v16.12.0/schemas/config.json",
3+
"release-type": "node",
4+
"include-component-in-tag": false,
5+
"changelog-sections": [
6+
{ "type": "feat", "section": "🌟 Features", "hidden": false },
7+
{ "type": "fix", "section": "🩹 Fixes", "hidden": false },
8+
{ "type": "docs", "section": "📚 Documentation", "hidden": false },
9+
10+
{ "type": "chore", "section": "🧹 Chores", "hidden": false },
11+
{ "type": "perf", "section": "🧹 Chores", "hidden": false },
12+
{ "type": "refactor", "section": "🧹 Chores", "hidden": false },
13+
{ "type": "test", "section": "🧹 Chores", "hidden": false },
14+
15+
{ "type": "build", "section": "🤖 Automation", "hidden": false },
16+
{ "type": "ci", "section": "🤖 Automation", "hidden": true }
17+
],
18+
"packages": {
19+
".": {}
20+
}
21+
}

.github/release-please/manifest.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{ ".": "7.0.0" }

.github/workflows/ci.yml

+2-45
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ name: CI
22
on:
33
push:
44
branches:
5-
# default semantic-release branches
6-
- +([0-9])?(.{+([0-9]),x}).x
75
- main
8-
- next
9-
- next-major
10-
- beta
11-
- alpha
126
pull_request:
137

148
concurrency:
@@ -26,10 +20,10 @@ jobs:
2620
- name: ⎔ Setup Node
2721
uses: actions/setup-node@v4
2822
with:
29-
node-version: 18
23+
node-version: lts/*
3024

3125
- name: 📥 Install dependencies
32-
run: npm install
26+
run: npm ci
3327

3428
- name: ▶️ Run lint script
3529
run: npm run lint
@@ -81,40 +75,3 @@ jobs:
8175

8276
- name: ⬆️ Upload coverage report
8377
uses: codecov/codecov-action@v4
84-
85-
release:
86-
name: 🚀 Release
87-
needs: [lint, test]
88-
runs-on: ubuntu-latest
89-
if:
90-
github.repository == 'eslint-community/eslint-plugin-promise' &&
91-
contains('refs/heads/main,refs/heads/next,refs/heads/beta,refs/heads/alpha',
92-
github.ref) && github.event_name == 'push'
93-
steps:
94-
- name: ⬇️ Checkout repo
95-
uses: actions/checkout@v4
96-
97-
- name: ⎔ Setup node
98-
uses: actions/setup-node@v4
99-
with:
100-
node-version: 18
101-
102-
- name: 📥 Install dependencies
103-
run: npm install
104-
105-
- name: 🚀 Release
106-
uses: cycjimmy/semantic-release-action@v4
107-
with:
108-
semantic_version: 19
109-
branches: |
110-
[
111-
'+([0-9])?(.{+([0-9]),x}).x',
112-
'main',
113-
'next',
114-
'next-major',
115-
{name: 'beta', prerelease: true},
116-
{name: 'alpha', prerelease: true}
117-
]
118-
env:
119-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
120-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/format.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ jobs:
2121
- name: ⎔ Setup node
2222
uses: actions/setup-node@v4
2323
with:
24-
node-version: 18
24+
node-version: lts/*
2525

2626
- name: 📥 Install deps
27-
run: npm install
27+
run: npm ci
2828

2929
- name: 👔 Format
3030
run: npm run format

.github/workflows/release-please.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Release Please
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
release_please:
13+
name: release-please
14+
runs-on: ubuntu-latest
15+
outputs:
16+
releaseCreated: ${{ steps.release.outputs.release_created }}
17+
permissions:
18+
contents: write
19+
pull-requests: write
20+
steps:
21+
- uses: googleapis/release-please-action@v4
22+
id: release
23+
with:
24+
config-file: .github/release-please/config.json
25+
manifest-file: .github/release-please/manifest.json
26+
27+
npm_publish:
28+
name: Publish to npm
29+
runs-on: ubuntu-latest
30+
needs: release_please
31+
if: needs.release_please.outputs.releaseCreated
32+
permissions:
33+
id-token: write
34+
steps:
35+
- uses: actions/checkout@v4
36+
with:
37+
show-progress: false
38+
- uses: actions/setup-node@v4
39+
with:
40+
node-version: lts/*
41+
registry-url: 'https://registry.npmjs.org'
42+
- run: npm ci
43+
- run: npm publish --provenance --access public
44+
env:
45+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "eslint-plugin-promise",
3-
"version": "0.0.0-semantically-released",
3+
"version": "7.0.0",
44
"description": "Enforce best practices for JavaScript promises",
55
"keywords": [
66
"eslint",

0 commit comments

Comments
 (0)