4
4
workflow_dispatch :
5
5
inputs :
6
6
release_type :
7
- description : ' Release type'
7
+ description : " Release type"
8
8
required : true
9
- default : ' patch'
9
+ default : " patch"
10
10
type : choice
11
11
options :
12
12
- patch
15
15
- prerelease
16
16
17
17
env :
18
- NODE_VERSION : ' 22 '
18
+ NODE_VERSION : " 22 "
19
19
20
20
jobs :
21
21
release :
@@ -41,14 +41,13 @@ jobs:
41
41
uses : actions/setup-node@v4
42
42
with :
43
43
node-version : ${{ env.NODE_VERSION }}
44
- cache : ' pnpm'
44
+ cache : " pnpm"
45
45
46
46
- name : Install dependencies
47
47
run : pnpm install --frozen-lockfile
48
48
49
49
- name : Run tests
50
50
run : |
51
- pnpm typecheck
52
51
pnpm lint
53
52
pnpm test:run
54
53
pnpm build
@@ -64,11 +63,11 @@ jobs:
64
63
# Get current version
65
64
CURRENT_VERSION=$(node -p "require('./package.json').version")
66
65
echo "Current version: $CURRENT_VERSION"
67
-
66
+
68
67
# Bump version
69
68
NEW_VERSION=$(pnpm version ${{ github.event.inputs.release_type }} --no-git-tag-version | tail -1)
70
69
NEW_VERSION="${NEW_VERSION#v}" # Remove 'v' prefix if present
71
-
70
+
72
71
echo "New version: $NEW_VERSION"
73
72
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
74
73
echo "tag=v$NEW_VERSION" >> $GITHUB_OUTPUT
@@ -78,23 +77,23 @@ jobs:
78
77
run : |
79
78
# Get commits since last tag
80
79
LAST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "")
81
-
80
+
82
81
if [ -z "$LAST_TAG" ]; then
83
82
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges)
84
83
else
85
84
COMMITS=$(git log --pretty=format:"- %s (%h)" --no-merges $LAST_TAG..HEAD)
86
85
fi
87
-
86
+
88
87
if [ -z "$COMMITS" ]; then
89
88
COMMITS="- Initial release"
90
89
fi
91
-
90
+
92
91
# Create changelog
93
92
CHANGELOG="## What's Changed
94
93
$COMMITS
95
-
94
+
96
95
**Full Changelog**: https://github.com/${{ github.repository }}/compare/$LAST_TAG...v${{ steps.version.outputs.version }}"
97
-
96
+
98
97
# Save to file and output
99
98
echo "$CHANGELOG" > changelog.md
100
99
echo "changelog<<EOF" >> $GITHUB_OUTPUT
@@ -127,4 +126,4 @@ jobs:
127
126
run : echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc
128
127
129
128
- name : Publish to npm
130
- run : pnpm publish --access public --no-git-checks
129
+ run : pnpm publish --access public --no-git-checks
0 commit comments