-
Notifications
You must be signed in to change notification settings - Fork 119
90 lines (73 loc) · 2.22 KB
/
release.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Build, Test, Release
# On pushes to master (i.e. merging a PR)
# run all tests, on win, macos, linux, on node 12 & 14
on:
push:
branches:
- main
- beta
# Dont run if it's just markdown or doc files
paths-ignore:
# UNCOMMENT THIS AFTER
# - "**.md"
- "docs/**"
- "demos/**"
- "scripts/**"
jobs:
# First, build and test on multiple os's
# and multuple versions of node
build_and_test:
name: Build and Test
runs-on: ${{ matrix.os }}
# PRs will run tests on node 14,16 on ubuntu, macos and windows
# so for the release, we're just running node 16@ubuntu
strategy:
matrix:
os: [ubuntu-latest]
node: [18]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Test in Chrome
run: npm run test:chrome:ci
- name: Test in Node
run: npm run test:node
- uses: codecov/codecov-action@v1
with:
directory: ./coverage
# If the build and test works, run a release
release:
name: Release
needs: [build_and_test]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# This parameter is required to make sure sematic-relase exactly use the provided GitHub Token
# See https://semantic-release.gitbook.io/semantic-release/recipes/ci-configurations/github-actions#pushing-package.json-changes-to-your-repository
persist-credentials: false
- uses: actions/setup-node@v3
with:
node-version: 18
- name: Configure npm
run: |
echo '//registry.npmjs.org/:_authToken=${NPM_TOKEN}' > .npmrc
cat .npmrc
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Install
run: npm ci
- name: Build
run: npm run build
- name: Release
env:
# GH_TOKEN is maintained in the repository secrets. See RELEASE.md for more information.
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: npm run release