-
Notifications
You must be signed in to change notification settings - Fork 10
44 lines (42 loc) · 1.15 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
name: Node.js CI
on:
push:
branches: [main, feat/*]
tags:
- 'v*.*.*'
pull_request:
branches: [main]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
- name: Build tarballs
if: startsWith(github.ref, 'refs/tags/')
run: yarn build:standalone
- name: Release
uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: dist/**/*.tar.gz
draft: true
body_path: CHANGELOG.md
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v4
if: startsWith(github.ref, 'refs/tags/')
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish to npm
if: startsWith(github.ref, 'refs/tags/')
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}