@peiyanlu/release 1.3.1 → 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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@peiyanlu/release",
3
- "version": "1.3.1",
4
- "description": "Release project tool.",
3
+ "version": "2.1.0",
4
+ "description": "Tool to automate version bumps, changelogs, and releases.",
5
5
  "license": "MIT",
6
6
  "type": "module",
7
7
  "private": false,
@@ -10,48 +10,55 @@
10
10
  },
11
11
  "exports": {
12
12
  ".": {
13
- "import": {
14
- "types": "./dist/index.d.mts",
15
- "default": "./dist/index.mjs"
16
- }
13
+ "types": "./dist/index.d.mts",
14
+ "default": "./dist/index.mjs"
17
15
  },
18
16
  "./package.json": "./package.json"
19
17
  },
20
18
  "dependencies": {
21
19
  "@actions/core": "^3.0.1",
22
20
  "@actions/github": "^9.1.1",
23
- "@clack/prompts": "^1.7.0",
24
- "@conventional-changelog/template": "^1.2.1",
21
+ "@clack/prompts": "^1.8.1",
22
+ "@conventional-changelog/template": "^1.4.0",
25
23
  "@octokit/rest": "^22.0.1",
26
24
  "@peiyanlu/cli-utils": "^0.0.15",
27
25
  "@peiyanlu/node-utils": "^0.0.4",
28
26
  "@peiyanlu/ts-utils": "^0.0.12",
29
- "ansis": "^4.3.1",
27
+ "ansis": "^4.4.0",
30
28
  "commander": "^15.0.0",
31
- "conventional-changelog": "^8.1.0",
32
- "conventional-changelog-conventionalcommits": "^10.2.1",
29
+ "conventional-changelog": "^8.1.3",
30
+ "conventional-changelog-conventionalcommits": "^10.4.1",
33
31
  "conventional-recommended-bump": "^12.1.0",
34
- "mime-types": "^3.0.2",
35
- "minimatch": "^10.2.5",
36
- "open": "^11.0.0",
37
- "publint": "^0.3.22",
32
+ "handlebars": "^4.7.10",
33
+ "open": "^11.0.4",
34
+ "publint": "^0.3.25",
38
35
  "semver": "^7.8.5",
39
36
  "tinyglobby": "^0.2.17",
40
- "yaml": "^2.9.0"
37
+ "yaml": "^2.9.1"
38
+ },
39
+ "devDependencies": {
40
+ "@peiyanlu/test-tools": "^0.0.7",
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
+ "typescript": "^6.0.3",
46
+ "vitest": "^5.0.5"
41
47
  },
42
48
  "author": {
43
49
  "name": "YanluPei",
44
50
  "email": "peiyanlu@vip.qq.com"
45
51
  },
46
52
  "engines": {
47
- "node": ">=20"
53
+ "node": ">=22.18"
48
54
  },
49
55
  "keywords": [
50
56
  "typescript",
51
57
  "cli"
52
58
  ],
53
59
  "files": [
54
- "dist"
60
+ "dist",
61
+ "template"
55
62
  ],
56
63
  "publishConfig": {
57
64
  "access": "public",
@@ -64,5 +71,13 @@
64
71
  "bugs": {
65
72
  "url": "https://github.com/peiyanlu/release/issues"
66
73
  },
67
- "homepage": "https://github.com/peiyanlu/release#readme"
68
- }
74
+ "homepage": "https://github.com/peiyanlu/release#readme",
75
+ "scripts": {
76
+ "dev": "tsdown -w",
77
+ "build": "tsdown",
78
+ "release": "node index.js",
79
+ "release:dry": "node index.js -C -n",
80
+ "test": "vitest run",
81
+ "test:cov": "vitest run --coverage"
82
+ }
83
+ }
@@ -0,0 +1,29 @@
1
+ {{#if npmOrPnpm}}
2
+ {{#if npm}}
3
+ import { defineConfig, GithubHosting, {{#if monorepo}}NpmWorkspacesProject{{else}}NpmProject{{/if}} } from '@peiyanlu/release'
4
+ {{else}}
5
+ import { defineConfig, GithubHosting, {{#if monorepo}}PnpmWorkspacesProject{{else}}PnpmProject{{/if}} } from '@peiyanlu/release'
6
+ {{/if}}
7
+ {{else}}
8
+ import { defineConfig } from '@peiyanlu/release'
9
+ {{/if}}
10
+
11
+
12
+ export default defineConfig({
13
+ {{#if npmOrPnpm}}
14
+ {{#if monorepo}}
15
+ project: new {{#if npm}}NpmWorkspacesProject{{else}}PnpmWorkspacesProject{{/if}}({
16
+ mode: {{#if fixed}}'fixed'{{else}}'independent'{{/if}},
17
+ }),
18
+ bump: {
19
+ extraScopes: [ 'deps' ],
20
+ },
21
+ {{else}}
22
+ project: new {{#if npm}}NpmProject{{else}}PnpmProject{{/if}}(),
23
+ {{/if}}
24
+ hosting: new GithubHosting(),
25
+ {{/if}}
26
+ releaser: {
27
+ verbose: true,
28
+ },
29
+ })
@@ -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}}