@@ -3,7 +3,7 @@ name: Publish
33on :
44 push :
55 branches :
6- - " +([1-9])?(.{+([1-9]),x}).x "
6+ - " [12].[0-9x]+.[0-9x]+ "
77 - main
88 - next
99 - alpha
@@ -19,30 +19,32 @@ jobs:
1919 uses : actions/setup-node@v2
2020 with :
2121 node-version : 12
22- - id : yarn-cache-dir
22+ - id : vars
2323 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)"
2527 - name : Cache node modules
2628 uses : actions/cache@v2
2729 id : yarn-cache
28- env :
29- cache-name : cache-node-modules
3030 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') }}
3333 restore-keys : |
34- ${{ runner.os }}-yarn-${{ env.cache-name }}-
35- ${{ runner.os }}-yarn-
36- ${{ runner.os }}-
34+ ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
3735 - name : Install dependencies
3836 # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
3937 env :
4038 CI : true
4139 run : |
4240 yarn install
4341 yarn ci
44- - name : Build All Packages
42+ - name : Build
4543 run : yarn run build
44+ - name : Test
45+ env :
46+ CI : true
47+ run : yarn run test --coverage
4648
4749 publish :
4850 needs : tests
@@ -53,21 +55,19 @@ jobs:
5355 - uses : actions/setup-node@v2
5456 with :
5557 node-version : 12
56- - id : yarn-cache-dir
58+ - id : vars
5759 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)"
5963 - name : Cache node modules
6064 uses : actions/cache@v2
6165 id : yarn-cache
62- env :
63- cache-name : cache-node-modules
6466 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') }}
6769 restore-keys : |
68- ${{ runner.os }}-yarn-${{ env.cache-name }}-
69- ${{ runner.os }}-yarn-
70- ${{ runner.os }}-
70+ ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
7171 - name : Install dependencies
7272 # if: ${{ !steps.yarn-cache.outputs.cache-hit }}
7373 env :
8181 GH_TOKEN : ${{ secrets.GH_TOKEN }}
8282 GITHUB_TOKEN : ${{ secrets.GH_TOKEN }}
8383 NPM_TOKEN : ${{ secrets.NPM_TOKEN }}
84- run : npx semantic-release
84+ run : yarn semantic-release
0 commit comments