Skip to content

Commit 80c5fc3

Browse files
committed
feat: use release please manifest configuration
1 parent e5d3d0e commit 80c5fc3

20 files changed

+223
-80
lines changed

.github/matchers/tap.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
]
3030
}
3131
]
32-
}
32+
}

.github/workflows/release-please.yml

+1-9
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,4 @@ jobs:
1515
- uses: google-github-actions/release-please-action@v3
1616
id: release
1717
with:
18-
release-type: node
19-
changelog-types: >
20-
[
21-
{"type":"feat","section":"Features","hidden":false},
22-
{"type":"fix","section":"Bug Fixes","hidden":false},
23-
{"type":"docs","section":"Documentation","hidden":false},
24-
{"type":"deps","section":"Dependencies","hidden":false},
25-
{"type":"chore","hidden":true}
26-
]
18+
command: manifest

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
!/.github/
2020
!/.gitignore
2121
!/.npmrc
22+
!/.release-please-manifest.json
2223
!/CODE_OF_CONDUCT.md
2324
!/SECURITY.md
2425
!/bin/
2526
!/lib/
2627
!/package.json
28+
!/release-please-config.json

.release-please-manifest.json

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

lib/content/index.js

+23-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,26 @@
11
const { name: NAME, version: LATEST_VERSION } = require('../../package.json')
22

3+
const releasePlease = (ws = false) => ({
4+
[`.github/workflows/release-please${ws ? '-{{pkgNameFs}}' : ''}.yml`]: {
5+
file: 'release-please.yml',
6+
filter: (o) => !o.pkg.private,
7+
},
8+
'.release-please-manifest.json': {
9+
file: 'release-please-manifest.json',
10+
filter: (o) => !o.pkg.private,
11+
parser: (p) => class NoCommentJson extends p.JsonMerge {
12+
comment = null
13+
},
14+
},
15+
'release-please-config.json': {
16+
file: 'release-please-config.json',
17+
filter: (o) => !o.pkg.private,
18+
parser: (p) => class NoCommentJson extends p.JsonMerge {
19+
comment = null
20+
},
21+
},
22+
})
23+
324
// Changes applied to the root of the repo
425
const rootRepo = {
526
add: {
@@ -14,10 +35,7 @@ const rootRepo = {
1435
'.github/workflows/codeql-analysis.yml': 'codeql-analysis.yml',
1536
'.github/workflows/post-dependabot.yml': 'post-dependabot.yml',
1637
'.github/workflows/pull-request.yml': 'pull-request.yml',
17-
'.github/workflows/release-please.yml': {
18-
file: 'release-please.yml',
19-
filter: (o) => !o.pkg.private,
20-
},
38+
...releasePlease(),
2139
},
2240
}
2341

@@ -43,10 +61,7 @@ const rootModule = {
4361
// Changes for each workspace but applied to the root of the repo
4462
const workspaceRepo = {
4563
add: {
46-
'.github/workflows/release-please-{{pkgNameFs}}.yml': {
47-
file: 'release-please.yml',
48-
filter: (o) => !o.pkg.private,
49-
},
64+
...releasePlease(true),
5065
'.github/workflows/ci-{{pkgNameFs}}.yml': 'ci.yml',
5166
},
5267
}
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"separate-pull-requests": true,
3+
"changelog-sections": [
4+
{"type":"feat","section":"Features","hidden":false},
5+
{"type":"fix","section":"Bug Fixes","hidden":false},
6+
{"type":"docs","section":"Documentation","hidden":false},
7+
{"type":"deps","section":"Dependencies","hidden":false},
8+
{"type":"chore","hidden":true}
9+
],
10+
"packages": {
11+
"{{#unless pkgRelPath}}.{{/unless}}{{pkgRelPath}}": {}
12+
}
13+
}
+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"{{#unless pkgRelPath}}.{{/unless}}{{pkgRelPath}}": "{{pkg.version}}"
3+
}

lib/content/release-please.yml

+1-14
Original file line numberDiff line numberDiff line change
@@ -24,20 +24,7 @@ jobs:
2424
- uses: google-github-actions/release-please-action@v3
2525
id: release
2626
with:
27-
release-type: node
28-
{{#if pkgRelPath}}
29-
monorepo-tags: true
30-
path: {{pkgRelPath}}
31-
# name can be removed after this is merged
32-
# https://github.com/google-github-actions/release-please-action/pull/459
33-
package-name: "{{pkgName}}"
34-
{{/if}}
35-
changelog-types: >
36-
[
37-
{{#each changelogTypes}}
38-
{{{json .}}}{{#unless @last}},{{/unless}}
39-
{{/each}}
40-
]
27+
command: manifest
4128
{{#if isWorkspace}}
4229
{{> setupGit}}
4330
{{> setupNode}}

lib/util/parser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,7 @@ class Json extends Base {
198198
comment = (c) => ({ [`//${this.options.config.__NAME__}`]: c })
199199

200200
toString (s) {
201-
return JSON.stringify(s, (_, v) => v === this.DELETE ? undefined : v, 2)
201+
return JSON.stringify(s, (_, v) => v === this.DELETE ? undefined : v, 2).trim() + '\n'
202202
}
203203

204204
parse (s) {

release-please-config.json

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"separate-pull-requests": true,
3+
"changelog-sections": [
4+
{
5+
"type": "feat",
6+
"section": "Features",
7+
"hidden": false
8+
},
9+
{
10+
"type": "fix",
11+
"section": "Bug Fixes",
12+
"hidden": false
13+
},
14+
{
15+
"type": "docs",
16+
"section": "Documentation",
17+
"hidden": false
18+
},
19+
{
20+
"type": "deps",
21+
"section": "Dependencies",
22+
"hidden": false
23+
},
24+
{
25+
"type": "chore",
26+
"hidden": true
27+
}
28+
],
29+
"packages": {
30+
".": {}
31+
}
32+
}

0 commit comments

Comments
 (0)