-
Notifications
You must be signed in to change notification settings - Fork 24
44 lines (37 loc) · 1.36 KB
/
run.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
on: push
jobs:
test_and_publish:
name: Test and publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '18'
registry-url: https://registry.npmjs.org/
- name: Install dependencies
run: yarn
- name: Check code style
run: yarn check-prettier
- name: Run tests
run: yarn coverage
- name: Update code coverage
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
- name: Publish on npm
if: startsWith(github.ref, 'refs/tags/')
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Add card file to release
if: startsWith(github.ref, 'refs/tags/')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: card.js
asset_name: card.js
tag: ${{ github.ref }}
- name: Purge jsDelivr cache
if: startsWith(github.ref, 'refs/tags/')
run: curl https://purge.jsdelivr.net/npm/rgb-light-card