-
Notifications
You must be signed in to change notification settings - Fork 0
42 lines (40 loc) · 1.25 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
name: release
on:
push:
branches: [main]
jobs:
semantic:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
HUSKY: 0
CI: true
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GH_TOKEN }}
- uses: actions/setup-node@v4
with:
node-version: "16.x"
- run: printf "//`node -p \"require('url').parse('https://registry.npmjs.org').host\"`/:_authToken=${NPM_TOKEN}\n" >> ~/.npmrc
- run: npm ci
- run: npm run build --if-present
- uses: actions/setup-node@v4
with:
node-version: "lts/*"
- run: previousVersion=$(sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json)
- run: npm i -g release-it release-it-pnpm @release-it/conventional-changelog
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
HUSKY: 0
CI: true
- run: npm run publish
- run: finalVersion=$(sed 's/.*"version": "\(.*\)".*/\1/;t;d' ./package.json)
- run: |
if [ "$previousVersion" != "$finalVersion" ]; then
git push
fi
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}