File tree Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Expand file tree Collapse file tree 1 file changed +69
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : release
2
+ run-name : " release '${{ github.event.inputs.version }}' version by @${{ github.actor }}"
3
+
4
+ on :
5
+ workflow_dispatch :
6
+ inputs :
7
+ version :
8
+ description : ' Version'
9
+ required : true
10
+ default : ' patch'
11
+ type : choice
12
+ options :
13
+ - ' major'
14
+ - ' minor'
15
+ - ' patch'
16
+
17
+ jobs :
18
+ build :
19
+ runs-on : ubuntu-latest
20
+ permissions :
21
+ id-token : write # Enable OIDC
22
+ pull-requests : write
23
+ contents : write
24
+
25
+ steps :
26
+ - uses : actions/checkout@v4
27
+
28
+ - uses : chainguard-dev/actions/setup-gitsign@main
29
+
30
+ - uses : actions/setup-node@v4
31
+ with :
32
+ node-version : 20
33
+
34
+ - name : Cache node_modules
35
+ id : cache-node_modules
36
+ uses : actions/cache@v4
37
+ with :
38
+ path : node_modules
39
+ key : ${{ runner.os }}-node_modules-${{ hashFiles('**/package-lock.json') }}
40
+ restore-keys : |
41
+ ${{ runner.os }}-node_modules-
42
+ ${{ runner.os }}-
43
+
44
+ - name : Install dependencies
45
+ if : steps.cache-node_modules.outputs.cache-hit != 'true'
46
+ run : |
47
+ npm ci
48
+
49
+ - name : Setup git
50
+ run : |
51
+ git config --global tag.gpgsign true
52
+
53
+ - name : Bump version
54
+ run : |
55
+ npm version ${{ github.event.inputs.version }} --sign-git-tag
56
+
57
+ - name : Push changes
58
+ env :
59
+ GH_TOKEN : ${{ github.token }}
60
+ run : |
61
+ VERSION=$(node -p "require('./package.json').version")
62
+ git push --follow-tags
63
+ gh release create $VERSION --generate-notes
64
+
65
+ - name : Publish to npm
66
+ env :
67
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
68
+ run : |
69
+ npm publish
You can’t perform that action at this time.
0 commit comments