Skip to content

Commit f676e44

Browse files
author
Akash Satheesan
committed
chore(ci): rewrite to use matrix
1 parent 82dfc5a commit f676e44

File tree

1 file changed

+14
-53
lines changed

1 file changed

+14
-53
lines changed

.github/workflows/release.yaml

+14-53
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,27 @@ on:
55

66
name: Build Release
77
jobs:
8-
release-linux-amd64:
9-
name: x86_64 Linux release
8+
release:
9+
name: Build release packages
1010
runs-on: ubuntu-latest
11-
steps:
12-
- uses: actions/checkout@v2
13-
- uses: actions/setup-go@v2
14-
with:
15-
go-version: '^1.15' # The Go version to download (if necessary) and use. - name: compile and release
16-
- run: go build -v -o cloud-agent-linux-amd64
17-
env:
18-
GOARCH: amd64
19-
GOOS: linux
20-
- run: hub release edit -m "" -a ./cloud-agent-linux-amd64 $(echo $GITHUB_REF | cut -d/ -f3)
21-
env:
22-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2311

24-
release-linux-arm64:
25-
name: ARM64 Linux release
26-
runs-on: ubuntu-latest
27-
steps:
28-
- uses: actions/checkout@v2
29-
- uses: actions/setup-go@v2
30-
with:
31-
go-version: '^1.15' # The Go version to download (if necessary) and use. - name: compile and release
32-
- run: go build -v -o cloud-agent-linux-arm64
33-
env:
34-
GOARCH: arm64
35-
GOOS: linux
36-
- run: hub release edit -m "" -a ./cloud-agent-linux-arm64 $(echo $GITHUB_REF | cut -d/ -f3)
37-
env:
38-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
matrix:
13+
goos: [linux, darwin]
14+
goarch: [amd64, arm64]
3915

40-
release-macos-amd64:
41-
name: x86_64 macOS release
42-
runs-on: ubuntu-latest
43-
steps:
44-
- uses: actions/checkout@v2
45-
- uses: actions/setup-go@v2
46-
with:
47-
go-version: '^1.15' # The Go version to download (if necessary) and use. - name: compile and release
48-
- run: go build -v -o cloud-agent-macos-amd64
49-
env:
50-
GOARCH: amd64
51-
GOOS: darwin
52-
- run: hub release edit -m "" -a ./cloud-agent-macos-amd64 $(echo $GITHUB_REF | cut -d/ -f3)
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
env:
17+
GOOS: ${{ matrix.goos }}
18+
GOARCH: ${{ matrix.goarch }}
5519

56-
release-macos-arm64:
57-
name: ARM64 macOS release
58-
runs-on: ubuntu-latest
5920
steps:
6021
- uses: actions/checkout@v2
22+
6123
- uses: actions/setup-go@v2
6224
with:
63-
go-version: '^1.15' # The Go version to download (if necessary) and use. - name: compile and release
64-
- run: go build -v -o cloud-agent-macos-arm64
65-
env:
66-
GOARCH: arm64
67-
GOOS: darwin
68-
- run: hub release edit -m "" -a ./cloud-agent-macos-arm64 $(echo $GITHUB_REF | cut -d/ -f3)
25+
go-version: '^1.15'
26+
27+
- run: go build -v -o cloud-agent-$GOOS-$GOARCH
28+
29+
- run: gh release upload $(echo $GITHUB_REF | cut -d/ -f3) ./cloud-agent-$GOOS-$GOARCH
6930
env:
7031
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)