@@ -3,7 +3,7 @@ name: Publish
3
3
on :
4
4
push :
5
5
branches :
6
- - " +([1-9])?(.{+([1-9]),x}).x "
6
+ - " [12].[0-9x]+.[0-9x]+ "
7
7
- main
8
8
- next
9
9
- alpha
@@ -19,30 +19,32 @@ jobs:
19
19
uses : actions/setup-node@v2
20
20
with :
21
21
node-version : 12
22
- - id : yarn-cache-dir
22
+ - id : vars
23
23
name : Find Yarn's cache folder
24
- run : echo "::set-output name=path::$(yarn config get cacheFolder)"
24
+ run : |
25
+ echo "::set-output name=path::$(yarn config get cacheFolder)"
26
+ echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
25
27
- name : Cache node modules
26
28
uses : actions/cache@v2
27
29
id : yarn-cache
28
- env :
29
- cache-name : cache-node-modules
30
30
with :
31
- path : ${{ steps.yarn-cache-dir .outputs.path }}
32
- key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
31
+ path : ${{ steps.vars .outputs.path }}
32
+ key : ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
33
33
restore-keys : |
34
- ${{ runner.os }}-yarn-${{ env.cache-name }}-
35
- ${{ runner.os }}-yarn-
36
- ${{ runner.os }}-
34
+ ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
37
35
- name : Install dependencies
38
36
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
39
37
env :
40
38
CI : true
41
39
run : |
42
40
yarn install
43
41
yarn ci
44
- - name : Build All Packages
42
+ - name : Build
45
43
run : yarn run build
44
+ - name : Test
45
+ env :
46
+ CI : true
47
+ run : yarn run test --coverage
46
48
47
49
publish :
48
50
needs : tests
@@ -53,21 +55,19 @@ jobs:
53
55
- uses : actions/setup-node@v2
54
56
with :
55
57
node-version : 12
56
- - id : yarn-cache-dir
58
+ - id : vars
57
59
name : Find Yarn's cache folder
58
- run : echo "::set-output name=path::$(yarn config get cacheFolder)"
60
+ run : |
61
+ echo "::set-output name=path::$(yarn config get cacheFolder)"
62
+ echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
59
63
- name : Cache node modules
60
64
uses : actions/cache@v2
61
65
id : yarn-cache
62
- env :
63
- cache-name : cache-node-modules
64
66
with :
65
- path : ${{ steps.yarn-cache-dir .outputs.path }}
66
- key : ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
67
+ path : ${{ steps.vars .outputs.path }}
68
+ key : ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
67
69
restore-keys : |
68
- ${{ runner.os }}-yarn-${{ env.cache-name }}-
69
- ${{ runner.os }}-yarn-
70
- ${{ runner.os }}-
70
+ ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
71
71
- name : Install dependencies
72
72
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
73
73
env :
81
81
GH_TOKEN : ${{ secrets.GH_TOKEN }}
82
82
GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
83
83
NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
84
- run : npx semantic-release
84
+ run : yarn semantic-release
0 commit comments