File tree Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Expand file tree Collapse file tree 1 file changed +61
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ push :
5+ tags :
6+ - " v*"
7+ workflow_dispatch :
8+
9+ jobs :
10+ release-npm :
11+ name : Release to NPM (${{ github.ref }})
12+ runs-on : ubuntu-latest
13+ steps :
14+ - name : Checkout Repository
15+ uses : actions/checkout@v3
16+ with :
17+ fetch-depth : 0
18+
19+ - name : Check if Tag on Main
20+ run : |
21+ git checkout main
22+ branch=$(git branch main --contains ${{ github.ref }})
23+ git checkout ${{ github.ref }}
24+ if [ -z $branch ]; then
25+ echo "Tag ${{ github.ref }} is not contained in the main branch."
26+ exit 1
27+ fi
28+
29+ - name : Setup PNPM
30+ uses : pnpm/action-setup@v2.2.4
31+ with :
32+ version : latest
33+ run_install : true
34+
35+ - name : Test
36+ run : pnpm test
37+
38+ - name : Publish
39+ run : |
40+ pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
41+ pnpm publish --verbose --access public --no-git-checks
42+
43+ release-note :
44+ name : Release Note (${{ github.ref }})
45+ runs-on : ubuntu-latest
46+ needs :
47+ - release-npm
48+ steps :
49+ - name : Checkout Repository
50+ uses : actions/checkout@v3
51+ with :
52+ fetch-depth : 0
53+
54+ - name : Publish Release
55+ uses : " marvinpinto/action-automatic-releases@latest"
56+ with :
57+ repo_token : " ${{ secrets.GH_TOKEN }}"
58+ prerelease : false
59+ files : |
60+ README.md
61+ LICENSE
You can’t perform that action at this time.
0 commit comments