-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (68 loc) · 2.01 KB
/
test-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
# A workflow of VICSOLWANG's project
name: test-release-ci
on:
push:
branches: [ master, dev ]
pull_request:
branches: [ master ]
jobs:
test:
strategy:
matrix:
node_version: ['18']
os: [ubuntu-latest, windows-latest, macOS-latest]
runs-on: ${{ matrix.os }}
steps:
- if: matrix.os == 'windows-latest'
run: git config --global core.autocrlf false
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node_version }}
- uses: actions/cache@v3
id: cache-node_modules
with:
path: node_modules
key: ${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ matrix.os }}-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
- run: node --version
- run: npm --version
- run: npm install
- run: npm test
- run: npm run cover:report
- uses: actions/upload-artifact@v3
with:
name: coverage
path: coverage.lcov
codecov:
runs-on: ubuntu-latest
needs:
- test
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v3
with:
name: coverage
- uses: codecov/codecov-action@v3
release:
needs: test
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref_name == 'master'
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v3
with:
node-version: 18
- run: npm install is-ci
- uses: cycjimmy/semantic-release-action@v4
id: semantic
with:
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: steps.semantic.outputs.new_release_published == 'true'
run: echo ${{ steps.semantic.outputs.new_release_version }}