44 release :
55 types : [created]
66
7+ permissions :
8+ contents : write
9+
710jobs :
811 build :
912 environment : automated-release
1013 runs-on : ubuntu-latest
14+
1115 env :
12- GH_TOKEN : ${{secrets.GH_TOKEN}}
16+ GH_TOKEN : ${{secrets.GITHUB_TOKEN}}
17+
1318 steps :
14- - uses : actions/checkout@v2
15- with :
16- ref : ${{ vars.BRANCH_NAME }}
17- - name : Add config details
18- run : |
19- git config --global user.name ${{secrets.NAME}}
20- git config --global user.email ${{secrets.EMAIL}}
21- - name : Move release to draft
22- run : gh release edit $TAG_NAME --draft=true
23- env :
24- TAG_NAME : ${{ github.event.release.tag_name }}
25- - name : Run npm install, build and test
26- run : |
27- npm i
28- npm run build
29- npm run test
30- npm run lint
31- - run : zip -r lib.zip . -x '.*' 'node_modules/*' 'src/*' 'spec/*' 'CVClientLA.md'
32- - name : Upload production artifacts
33- run : |
34- gh release upload $TAG_NAME "lib.zip#build"
35- gh release edit $TAG_NAME --draft=false
36- env :
37- TAG_NAME : ${{ github.event.release.tag_name }}
19+ - name : Checkout repository
20+ uses : actions/checkout@v4
21+
22+ - name : Move release to draft
23+ run : gh release edit "$TAG_NAME" --draft=true
24+ env :
25+ TAG_NAME : ${{ github.event.release.tag_name }}
26+
27+ - name : Install dependencies
28+ run : npm ci
29+
30+ - name : Build
31+ run : npm run build
32+
33+ - name : Test
34+ run : npm run test
35+
36+ - name : Lint
37+ run : npm run lint
38+
39+ - name : Create release archive
40+ run : |
41+ zip -r lib.zip . -x '.*' 'node_modules/*' 'src/*' 'spec/*' 'CVClientLA.md'
42+
43+ - name : Upload production artifacts
44+ run : |
45+ gh release upload $TAG_NAME "lib.zip"
46+ gh release edit $TAG_NAME --draft=false
47+ env :
48+ TAG_NAME : ${{ github.event.release.tag_name }}
0 commit comments