Skip to content

Commit ded06ae

Browse files
committed
Add release workflow
1 parent 2bcfa72 commit ded06ae

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

.github/workflows/ci.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,20 @@ jobs:
1717
- run: npm ci
1818
- run: npx eslint .
1919

20+
pack:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v3
24+
- uses: actions/setup-node@v3
25+
with:
26+
node-version: 18
27+
- run: npm ci
28+
- run: npm pack
29+
- uses: actions/upload-artifact@v3
30+
with:
31+
name: package
32+
path: '*.tgz'
33+
2034
test:
2135
runs-on: ubuntu-latest
2236
strategy:
@@ -52,3 +66,18 @@ jobs:
5266
node-version: 18
5367
- run: npm ci
5468
- run: npx tsc
69+
70+
release:
71+
runs-on: ubuntu-latest
72+
needs: [eslint, test, pack, prettier, tsc]
73+
if: startsWith(github.ref, 'refs/tags/')
74+
steps:
75+
- uses: actions/setup-node@v3
76+
with:
77+
node-version: 18
78+
registry-url: https://registry.npmjs.org
79+
- uses: actions/download-artifact@v3
80+
with: { name: package }
81+
- run: npm publish *.tgz
82+
env:
83+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)