Skip to content

Commit 085c0fc

Browse files
authored
ci(main.yml): added publish job with semantic release (#3)
This should force a publish to npm registry for this package with a semantic version
1 parent 25a84ca commit 085c0fc

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,33 @@ jobs:
3030

3131
- name: Build
3232
run: yarn build
33+
34+
publish:
35+
name: Publish to npm registry with semantic release
36+
37+
if: ${{ github.ref == 'refs/heads/main' }}
38+
needs: [build]
39+
40+
runs-on: ${{ matrix.os }}
41+
strategy:
42+
matrix:
43+
node: ['10.x', '12.x', '14.x']
44+
os: [ubuntu-latest, windows-latest, macOS-latest]
45+
46+
steps:
47+
- name: Checkout repo
48+
uses: actions/checkout@v2
49+
50+
- name: Use Node ${{ matrix.node }}
51+
uses: actions/setup-node@v1
52+
with:
53+
node-version: ${{ matrix.node }}
54+
55+
- name: Install deps and build (with cache)
56+
uses: bahmutov/npm-install@v1
57+
58+
- name: Publish with Semantic Versioning
59+
run: npm run semantic-release
60+
env:
61+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)