55 tags :
66 - ' v*'
77jobs :
8- release :
8+ create_release :
99 runs-on : ubuntu-latest
1010 outputs :
1111 upload_url : ${{ steps.create_release.outputs.upload_url }}
@@ -22,84 +22,43 @@ jobs:
2222 release_name : Release ${{ github.ref }}
2323 draft : false
2424 prerelease : false
25- unix :
25+ build :
26+ uses : BrosSquad/hosts/.github/workflows/build.yml@master
27+ with :
28+ profile : dist
29+ release :
30+ needs : [create_release, build]
2631 strategy :
2732 matrix :
28- os : [ubuntu-latest, macos-latest]
29- go : [1.16.x]
30- runs-on : ${{ matrix.os }}
31- needs : release
33+ os :
34+ - ubuntu-latest
35+ - windows-latest
36+ - macos-latest
37+ runs-on : ubuntu-latest
3238 steps :
33- - name : Checkout
34- uses : actions/checkout@v2
35- -
uses :
olegtarasov/[email protected] 36- id : git_tag
39+ - name : Download 'Hosts-Edit' binary
40+ uses : actions/download-artifact@v3
3741 with :
38- tagRegex : ' v(.*)'
39- tagRegexGroup : 1
40- - name : Install Go
41- uses : actions/setup-go@v2
42- with :
43- go-version : ${{ matrix.go }}
44- - uses : actions/cache@v2
45- with :
46- path : ~/go/pkg/mod
47- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
48- restore-keys : |
49- ${{ runner.os }}-go-
50- - name : Test
51- run : make test RACE=1 ENVIRONMENT=production
52- - name : Build
53- run : make build VERSION=${{ steps.git_tag.outputs.tag }} RACE=0 ENVIRONMENT=production
54- env :
55- CGO_ENABLED : 0
42+ name : hosts-edit-binary-${{ matrix.os }}
5643 - name : Upload Release Asset
57- id : upload-release-asset
44+ id : upload-release-asset-windows
45+ if : ${{ matrix.os == 'windows-latest' }}
5846 uses : actions/upload-release-asset@v1
5947 env :
6048 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6149 with :
62- upload_url : ${{ needs.release .outputs.upload_url }}
63- asset_path : ./bin/ hosts
64- asset_name : hosts-${{ matrix.os }}-${{ steps.git_tag.outputs.tag }}
50+ upload_url : ${{ needs.create_release .outputs.upload_url }}
51+ asset_path : ./hosts-edit.exe
52+ asset_name : hosts-edit- ${{ matrix.os }}.exe
6553 asset_content_type : application/octet-stream
66- windows :
67- strategy :
68- matrix :
69- go : [1.16.x]
70- runs-on : windows-latest
71- needs : release
72- steps :
73- - name : Checkout
74- uses : actions/checkout@v2
75- -
uses :
olegtarasov/[email protected] 76- id : git_tag
77- with :
78- tagRegex : ' v(.*)'
79- tagRegexGroup : 1
80- - name : Install Go
81- uses : actions/setup-go@v2
82- with :
83- go-version : ${{ matrix.go }}
84- - uses : actions/cache@v2
85- with :
86- path : ~/go/pkg/mod
87- key : ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
88- restore-keys : |
89- ${{ runner.os }}-go-
90- - name : Test
91- run : make test RACE=1 ENVIRONMENT=production
92- - name : Build
93- run : make build VERSION=${{ steps.git_tag.outputs.tag }} RACE=0 ENVIRONMENT=production EXT=.exe
94- env :
95- CGO_ENABLED : 0
9654 - name : Upload Release Asset
97- id : upload-release-asset
55+ id : upload-release-asset-unix
56+ if : ${{ matrix.os != 'windows-latest' }}
9857 uses : actions/upload-release-asset@v1
9958 env :
10059 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
10160 with :
102- upload_url : ${{ needs.release .outputs.upload_url }}
103- asset_path : ./bin/ hosts.exe
104- asset_name : hosts-windows -${{ steps.git_tag.outputs.tag }}.exe
61+ upload_url : ${{ needs.create_release .outputs.upload_url }}
62+ asset_path : ./hosts-edit
63+ asset_name : hosts-edit -${{ matrix.os }}
10564 asset_content_type : application/octet-stream
0 commit comments