-
Notifications
You must be signed in to change notification settings - Fork 1
52 lines (38 loc) · 1.15 KB
/
ci.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
name: CI
on: [push, pull_request]
jobs:
setup-compile-test-and-publish:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node:
- 20
- 22
include:
- node: 20
publish: true
continue-on-error: false
continue-on-error: ${{ matrix.continue-on-error == true }}
container:
image: node:${{ matrix.node }}
steps:
- name: Checkout the code
uses: actions/checkout@v4
- name: Install the dependencies
run: yarn install --immutable
- name: Check the code formatting
run: yarn prettier --check .
- name: Compile the code
run: yarn run compile
- name: Test
run: yarn run test
- name: Lint package.json
run: yarn run publint --strict
- name: Publish to npmjs
if: "matrix.publish == true && startsWith(github.ref, 'refs/tags/')"
run: |
npm version --no-git-tag-version ${GITHUB_REF#refs/tags/}
yarn npm publish --tolerate-republish --access public
env:
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_REGISTRY_AUTH_TOKEN }}