@peiyanlu/release 2.0.0 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -19
- package/dist/action.mjs +161 -165
- package/dist/cli.mjs +118 -146
- package/dist/index.d.mts +10 -102
- package/dist/index.mjs +80 -263
- package/package.json +16 -16
- package/template/release.workflow.hbs +140 -0
- package/template/release.text +0 -82
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@peiyanlu/release",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"description": "Tool to automate version bumps, changelogs, and releases.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -18,39 +18,39 @@
|
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@actions/core": "^3.0.1",
|
|
20
20
|
"@actions/github": "^9.1.1",
|
|
21
|
-
"@clack/prompts": "^1.
|
|
22
|
-
"@conventional-changelog/template": "^1.
|
|
21
|
+
"@clack/prompts": "^1.8.1",
|
|
22
|
+
"@conventional-changelog/template": "^1.4.0",
|
|
23
23
|
"@octokit/rest": "^22.0.1",
|
|
24
24
|
"@peiyanlu/cli-utils": "^0.0.15",
|
|
25
25
|
"@peiyanlu/node-utils": "^0.0.4",
|
|
26
26
|
"@peiyanlu/ts-utils": "^0.0.12",
|
|
27
|
-
"ansis": "^4.
|
|
27
|
+
"ansis": "^4.4.0",
|
|
28
28
|
"commander": "^15.0.0",
|
|
29
|
-
"conventional-changelog": "^8.1.
|
|
30
|
-
"conventional-changelog-conventionalcommits": "^10.
|
|
29
|
+
"conventional-changelog": "^8.1.3",
|
|
30
|
+
"conventional-changelog-conventionalcommits": "^10.4.1",
|
|
31
31
|
"conventional-recommended-bump": "^12.1.0",
|
|
32
|
-
"
|
|
33
|
-
"
|
|
32
|
+
"handlebars": "^4.7.10",
|
|
33
|
+
"open": "^11.0.4",
|
|
34
|
+
"publint": "^0.3.25",
|
|
34
35
|
"semver": "^7.8.5",
|
|
35
36
|
"tinyglobby": "^0.2.17",
|
|
36
|
-
"yaml": "^2.9.
|
|
37
|
-
"handlebars": "^4.7.9"
|
|
37
|
+
"yaml": "^2.9.1"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@peiyanlu/test-tools": "^0.0.7",
|
|
41
|
-
"@types/node": "^24.
|
|
42
|
-
"@types/semver": "^7.
|
|
43
|
-
"@vitest/coverage-v8": "^
|
|
44
|
-
"tsdown": "^0.23.
|
|
41
|
+
"@types/node": "^24.19.2",
|
|
42
|
+
"@types/semver": "^7.8.0",
|
|
43
|
+
"@vitest/coverage-v8": "^5.0.5",
|
|
44
|
+
"tsdown": "^0.23.4",
|
|
45
45
|
"typescript": "^6.0.3",
|
|
46
|
-
"vitest": "^
|
|
46
|
+
"vitest": "^5.0.5"
|
|
47
47
|
},
|
|
48
48
|
"author": {
|
|
49
49
|
"name": "YanluPei",
|
|
50
50
|
"email": "peiyanlu@vip.qq.com"
|
|
51
51
|
},
|
|
52
52
|
"engines": {
|
|
53
|
-
"node": ">=
|
|
53
|
+
"node": ">=22.18"
|
|
54
54
|
},
|
|
55
55
|
"keywords": [
|
|
56
56
|
"typescript",
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
name: Release Project
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
issue_comment:
|
|
5
|
+
types: [ created, deleted ]
|
|
6
|
+
push:
|
|
7
|
+
branches:
|
|
8
|
+
- master
|
|
9
|
+
workflow_dispatch:
|
|
10
|
+
inputs:
|
|
11
|
+
snapshot:
|
|
12
|
+
description: Snapshot publish tag.
|
|
13
|
+
type: string
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
check:
|
|
17
|
+
if: inputs.snapshot == ''
|
|
18
|
+
name: Context check
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
permissions:
|
|
21
|
+
contents: read
|
|
22
|
+
outputs:
|
|
23
|
+
continue: $\{{ steps.check.outputs.continue }}
|
|
24
|
+
workflow: $\{{ steps.check.outputs.workflow }}
|
|
25
|
+
steps:
|
|
26
|
+
- name: Checkout
|
|
27
|
+
uses: actions/checkout@v7
|
|
28
|
+
with:
|
|
29
|
+
fetch-depth: 0
|
|
30
|
+
fetch-tags: true
|
|
31
|
+
|
|
32
|
+
- name: Context check
|
|
33
|
+
id: check
|
|
34
|
+
uses: peiyanlu/release@master
|
|
35
|
+
with:
|
|
36
|
+
workflow: check
|
|
37
|
+
github-token: $\{{ secrets.GITHUB_TOKEN }}
|
|
38
|
+
|
|
39
|
+
pull-request:
|
|
40
|
+
needs: check
|
|
41
|
+
if: needs.check.outputs.workflow == 'pull-request'
|
|
42
|
+
name: Pull request
|
|
43
|
+
runs-on: ubuntu-latest
|
|
44
|
+
permissions:
|
|
45
|
+
contents: write
|
|
46
|
+
pull-requests: write
|
|
47
|
+
steps:
|
|
48
|
+
- name: Checkout
|
|
49
|
+
uses: actions/checkout@v7
|
|
50
|
+
with:
|
|
51
|
+
fetch-depth: 0
|
|
52
|
+
fetch-tags: true
|
|
53
|
+
|
|
54
|
+
- name: Create or update pull request
|
|
55
|
+
uses: peiyanlu/release@master
|
|
56
|
+
with:
|
|
57
|
+
workflow: pull-request
|
|
58
|
+
github-token: $\{{ secrets.GITHUB_TOKEN }}
|
|
59
|
+
|
|
60
|
+
release:
|
|
61
|
+
needs: check
|
|
62
|
+
if: needs.check.outputs.workflow == 'release'
|
|
63
|
+
name: Release
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
permissions:
|
|
66
|
+
contents: write
|
|
67
|
+
{{#if trusted}}
|
|
68
|
+
id-token: write
|
|
69
|
+
{{/if}}
|
|
70
|
+
steps:
|
|
71
|
+
- name: Checkout
|
|
72
|
+
uses: actions/checkout@v7
|
|
73
|
+
with:
|
|
74
|
+
fetch-depth: 0
|
|
75
|
+
fetch-tags: true
|
|
76
|
+
|
|
77
|
+
- name: Setup pnpm
|
|
78
|
+
uses: pnpm/action-setup@v6
|
|
79
|
+
with:
|
|
80
|
+
version: 12
|
|
81
|
+
|
|
82
|
+
- name: Setup Node.js
|
|
83
|
+
uses: actions/setup-node@v7
|
|
84
|
+
with:
|
|
85
|
+
node-version: 24
|
|
86
|
+
registry-url: https://registry.npmjs.org/
|
|
87
|
+
package-manager-cache: false
|
|
88
|
+
|
|
89
|
+
- name: Install deps
|
|
90
|
+
run: pnpm install --frozen-lockfile
|
|
91
|
+
|
|
92
|
+
- name: Release
|
|
93
|
+
uses: peiyanlu/release@master
|
|
94
|
+
with:
|
|
95
|
+
workflow: release
|
|
96
|
+
github-token: $\{{ secrets.GITHUB_TOKEN }}
|
|
97
|
+
{{#unless trusted}}
|
|
98
|
+
npm-token: $\{{ secrets.NPM_TOKEN }}
|
|
99
|
+
{{/unless}}
|
|
100
|
+
|
|
101
|
+
snapshot:
|
|
102
|
+
if: inputs.snapshot != ''
|
|
103
|
+
name: Snapshot
|
|
104
|
+
runs-on: ubuntu-latest
|
|
105
|
+
permissions:
|
|
106
|
+
contents: read
|
|
107
|
+
{{#if trusted}}
|
|
108
|
+
id-token: write
|
|
109
|
+
{{/if}}
|
|
110
|
+
steps:
|
|
111
|
+
- name: Checkout
|
|
112
|
+
uses: actions/checkout@v7
|
|
113
|
+
with:
|
|
114
|
+
fetch-depth: 0
|
|
115
|
+
fetch-tags: true
|
|
116
|
+
|
|
117
|
+
- name: Setup pnpm
|
|
118
|
+
uses: pnpm/action-setup@v6
|
|
119
|
+
with:
|
|
120
|
+
version: 12
|
|
121
|
+
|
|
122
|
+
- name: Setup Node.js
|
|
123
|
+
uses: actions/setup-node@v7
|
|
124
|
+
with:
|
|
125
|
+
node-version: 24
|
|
126
|
+
registry-url: https://registry.npmjs.org/
|
|
127
|
+
package-manager-cache: false
|
|
128
|
+
|
|
129
|
+
- name: Install deps
|
|
130
|
+
run: pnpm install --frozen-lockfile
|
|
131
|
+
|
|
132
|
+
- name: Publish
|
|
133
|
+
uses: peiyanlu/release@master
|
|
134
|
+
with:
|
|
135
|
+
workflow: snapshot
|
|
136
|
+
github-token: $\{{ secrets.GITHUB_TOKEN }}
|
|
137
|
+
bump-snapshot: $\{{ inputs.snapshot }}
|
|
138
|
+
{{#unless trusted}}
|
|
139
|
+
npm-token: $\{{ secrets.NPM_TOKEN }}
|
|
140
|
+
{{/unless}}
|
package/template/release.text
DELETED
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
name: Release Project
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
issue_comment:
|
|
5
|
-
types: [ created, deleted ]
|
|
6
|
-
push:
|
|
7
|
-
branches:
|
|
8
|
-
- master
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
check:
|
|
12
|
-
name: Context check
|
|
13
|
-
runs-on: ubuntu-latest
|
|
14
|
-
permissions:
|
|
15
|
-
contents: read
|
|
16
|
-
outputs:
|
|
17
|
-
continue: ${{ steps.check.outputs.continue }}
|
|
18
|
-
workflow: ${{ steps.check.outputs.workflow }}
|
|
19
|
-
steps:
|
|
20
|
-
- name: Checkout
|
|
21
|
-
uses: actions/checkout@v7
|
|
22
|
-
|
|
23
|
-
- name: Context check
|
|
24
|
-
id: check
|
|
25
|
-
uses: peiyanlu/release@v2
|
|
26
|
-
with:
|
|
27
|
-
workflow: check
|
|
28
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
29
|
-
|
|
30
|
-
pull-request:
|
|
31
|
-
name: Pull request
|
|
32
|
-
runs-on: ubuntu-latest
|
|
33
|
-
needs: check
|
|
34
|
-
if: needs.check.outputs.workflow == 'pull-request'
|
|
35
|
-
permissions:
|
|
36
|
-
contents: write
|
|
37
|
-
pull-requests: write
|
|
38
|
-
steps:
|
|
39
|
-
- name: Checkout
|
|
40
|
-
uses: actions/checkout@v7
|
|
41
|
-
|
|
42
|
-
- name: Create or update pull request
|
|
43
|
-
uses: peiyanlu/release@v2
|
|
44
|
-
with:
|
|
45
|
-
workflow: pull-request
|
|
46
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
-
|
|
48
|
-
release:
|
|
49
|
-
name: Release
|
|
50
|
-
runs-on: ubuntu-latest
|
|
51
|
-
needs: check
|
|
52
|
-
if: needs.check.outputs.workflow == 'release'
|
|
53
|
-
permissions:
|
|
54
|
-
contents: write
|
|
55
|
-
steps:
|
|
56
|
-
- name: Checkout
|
|
57
|
-
uses: actions/checkout@v7
|
|
58
|
-
with:
|
|
59
|
-
fetch-depth: 0
|
|
60
|
-
fetch-tags: true
|
|
61
|
-
|
|
62
|
-
- name: Setup pnpm
|
|
63
|
-
uses: pnpm/action-setup@v6
|
|
64
|
-
with:
|
|
65
|
-
version: 12
|
|
66
|
-
|
|
67
|
-
- name: Setup Node.js
|
|
68
|
-
uses: actions/setup-node@v7
|
|
69
|
-
with:
|
|
70
|
-
node-version: 24
|
|
71
|
-
registry-url: https://registry.npmjs.org/
|
|
72
|
-
package-manager-cache: false
|
|
73
|
-
|
|
74
|
-
- name: Install dependencies
|
|
75
|
-
run: pnpm install --frozen-lockfile
|
|
76
|
-
|
|
77
|
-
- name: Release
|
|
78
|
-
uses: peiyanlu/release@v2
|
|
79
|
-
with:
|
|
80
|
-
workflow: release
|
|
81
|
-
github-token: ${{ secrets.GITHUB_TOKEN }}
|
|
82
|
-
npm-token: ${{ secrets.NPM_TOKEN }}
|