@@ -2,13 +2,13 @@ name: 'build-test'
22on :
33 pull_request :
44 push :
5+ branches-ignore :
6+ - master
7+ workflow_call :
58
69jobs :
710 build :
8- strategy :
9- matrix :
10- os : [ubuntu, macos, windows]
11- runs-on : ${{ matrix.os }}-latest
11+ runs-on : ubuntu-latest
1212 steps :
1313 - uses : actions/checkout@v3
1414 - name : Get yarn cache directory path
2424 - run : yarn install --frozen-lockfile
2525 - run : yarn build
2626 - run : yarn package
27+ - uses : actions/upload-artifact@v3
28+ with :
29+ name : dist
30+ path : ./dist/
31+
32+ test :
33+ needs : [build]
34+ strategy :
35+ matrix :
36+ os : [ubuntu, macos, windows]
37+ runs-on : ${{ matrix.os }}-latest
38+ steps :
39+ - uses : actions/download-artifact@v3
40+ with :
41+ name : dist
2742
2843 - name : Install with no params
29- uses : ./dist/
44+ uses : ./
3045 - if : runner.os == 'Linux'
3146 run : chrome --version
3247 - if : runner.os == 'macOS'
3651 # Unable to run with command-line option on windows
3752
3853 - name : Install with version '827102'
39- uses : ./dist/
54+ uses : ./
4055 with :
4156 chrome-version : 827102
4257 - if : runner.os == 'Linux'
4863 # Unable to run with command-line option on windows
4964
5065 - name : install with version 'dev'
51- uses : ./dist/
66+ uses : ./
5267 with :
5368 chrome-version : dev
5469 - if : runner.os == 'Linux'
5873 - if : runner.os == 'Windows'
5974 run : (Get-Item (Get-Command chrome).Source).VersionInfo.ProductVersion
6075 # Unable to run with command-line option on windows
61-
62-
63- deploy :
64- runs-on : ubuntu-latest
65- needs : [build]
66- if : github.ref == 'refs/heads/master'
67- steps :
68- - uses : actions/checkout@v3
69- - name : Get yarn cache directory path
70- id : yarn-cache-dir-path
71- run : echo "::set-output name=dir::$(yarn cache dir)"
72- - uses : actions/cache@v3
73- with :
74- path : ${{ steps.yarn-cache-dir-path.outputs.dir }}
75- key : ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
76- restore-keys : |
77- ${{ runner.os }}-yarn-
78- - uses : actions/checkout@v3
79- with :
80- ref : ' latest'
81- path : ' dist'
82-
83- - run : yarn install --frozen-lockfile
84- - run : yarn build
85- - run : yarn package
86- - name : Setup git
87- run : |
88- git config --global user.name "Shin'ya Ueoka"
89- git config --global user.email "[email protected] " 90-
91- cat >$HOME/.netrc <<EOF
92- machine github.com
93- login ueokande
94- password ${GITHUB_TOKEN}
95- EOF
96-
97- - name : Deploy to latest branch
98- working-directory : ./dist
99- env :
100- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
101- run : |
102- # Abort job successfully when no scripts updated
103- test -z "$(git status --short)" && exit 0
104-
105- git add .
106- git commit --message "Release for ${GITHUB_SHA}"
107- git push origin latest
108-
109- test-latest :
110- runs-on : ubuntu-latest
111- needs : [deploy]
112- steps :
113- - uses : browser-actions/setup-chrome@latest
114- - run : chrome --version
0 commit comments