Skip to content

Commit 23e57ca

Browse files
committed
ci(release): create release via commit-and-tag-version
1 parent 725ca08 commit 23e57ca

File tree

6 files changed

+1197
-1410
lines changed

6 files changed

+1197
-1410
lines changed

.github/workflows/publish.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish to NPM
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
npm-publish:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- name: Checkout
11+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
12+
13+
- name: Install Node.js
14+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
15+
with:
16+
node-version: "22"
17+
cache: pnpm
18+
19+
- name: Install pnpm
20+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
21+
with:
22+
version: 9
23+
run_install: true
24+
25+
- name: Build package
26+
run: pnpm run build
27+
28+
- name: Publish package to npm
29+
run: pnpm publish
30+
env:
31+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: GitHub Release
2+
on:
3+
push:
4+
tags:
5+
- "*"
6+
7+
jobs:
8+
create-release:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
13+
14+
- name: Generate Changelog
15+
id: release_notes
16+
uses: yashanand1910/standard-release-notes@28752849855b451d0d2bee11a83a4da2d794ecf6 # v1.5.0
17+
with:
18+
version: ${{ github.ref }}
19+
20+
- name: Create GitHub Release
21+
uses: softprops/action-gh-release@62c96d0c4e8a889135c1f3a25910db8dbe0e85f7 # v2.3.4
22+
with:
23+
tag_name: ${{ github.ref_name }}
24+
body: ${{ steps.release_notes.outputs.release_notes }}
25+
draft: true

.release-it.json

Lines changed: 0 additions & 27 deletions
This file was deleted.

.versionrc.cjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
module.exports = {
2+
tagPrefix: "",
3+
writerOpts: {
4+
finalizeContext(context) {
5+
if (!context.commitGroups?.length) {
6+
context.commitGroups = [{ commits: [{ header: "No significant changes" }] }];
7+
}
8+
return context;
9+
}
10+
}
11+
};

package.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,16 @@
3838
"lint:js:fix": "npm run lint:js -- --fix",
3939
"lint:all": "npm run lint:ts && npm run lint:js",
4040
"test": "vitest --run",
41-
"release:patch": "dotenv release-it patch",
42-
"release:minor": "dotenv release-it minor",
43-
"release:major": "dotenv release-it major"
41+
"preversion": "npm run lint:all && npm run test",
42+
"release": "commit-and-tag-version"
4443
},
4544
"devDependencies": {
46-
"@release-it/conventional-changelog": "^10.0.1",
4745
"@types/node": "^24.7.0",
46+
"commit-and-tag-version": "^12.6.0",
4847
"dotenv-cli": "^10.0.0",
4948
"esbuild": "^0.25.10",
5049
"eslint": "^9.37.0",
5150
"neostandard": "^0.12.2",
52-
"release-it": "^19.0.5",
5351
"typescript": "^5.9.3",
5452
"vitest": "^3.2.4"
5553
},
@@ -61,8 +59,10 @@
6159
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@^1",
6260
"array.prototype.tosorted": "npm:@nolyfill/array.prototype.tosorted@^1",
6361
"es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@^1",
62+
"es-set-tostringtag": "npm:@nolyfill/es-set-tostringtag@^1",
6463
"hasown": "npm:@nolyfill/hasown@^1",
6564
"is-core-module": "npm:@nolyfill/is-core-module@^1",
65+
"isarray": "npm:@nolyfill/isarray@^1",
6666
"object.assign": "npm:@nolyfill/object.assign@^1",
6767
"object.entries": "npm:@nolyfill/object.entries@^1",
6868
"object.fromentries": "npm:@nolyfill/object.fromentries@^1",

0 commit comments

Comments
 (0)