Skip to content

Commit 2223e54

Browse files
committed
ci(release): create release via commit-and-tag-version
1 parent 49e5739 commit 2223e54

File tree

6 files changed

+1196
-1410
lines changed

6 files changed

+1196
-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 pnpm
14+
uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
15+
with:
16+
version: 9
17+
run_install: true
18+
19+
- name: Install Node.js
20+
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
21+
with:
22+
node-version: "22"
23+
cache: pnpm
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: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,15 @@
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+
"release": "npm run lint:all && npm run test && commit-and-tag-version"
4442
},
4543
"devDependencies": {
46-
"@release-it/conventional-changelog": "^10.0.1",
4744
"@types/node": "^24.7.0",
45+
"commit-and-tag-version": "^12.6.0",
4846
"dotenv-cli": "^10.0.0",
4947
"esbuild": "^0.25.10",
5048
"eslint": "^9.37.0",
5149
"neostandard": "^0.12.2",
52-
"release-it": "^19.0.5",
5350
"typescript": "^5.9.3",
5451
"vitest": "^3.2.4"
5552
},
@@ -61,8 +58,10 @@
6158
"array.prototype.flatmap": "npm:@nolyfill/array.prototype.flatmap@^1",
6259
"array.prototype.tosorted": "npm:@nolyfill/array.prototype.tosorted@^1",
6360
"es-iterator-helpers": "npm:@nolyfill/es-iterator-helpers@^1",
61+
"es-set-tostringtag": "npm:@nolyfill/es-set-tostringtag@^1",
6462
"hasown": "npm:@nolyfill/hasown@^1",
6563
"is-core-module": "npm:@nolyfill/is-core-module@^1",
64+
"isarray": "npm:@nolyfill/isarray@^1",
6665
"object.assign": "npm:@nolyfill/object.assign@^1",
6766
"object.entries": "npm:@nolyfill/object.entries@^1",
6867
"object.fromentries": "npm:@nolyfill/object.fromentries@^1",

0 commit comments

Comments
 (0)