Skip to content

Commit 1a2e7d5

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

File tree

1 file changed

+15
-53
lines changed

1 file changed

+15
-53
lines changed

.github/workflows/release.yaml

Lines changed: 15 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -5,66 +5,28 @@ 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+
strategy:
13+
matrix:
14+
goos: [linux, darwin]
15+
goarch: [amd64, arm64]
3916

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 }}
17+
env:
18+
GOOS: ${{ matrix.goos }}
19+
GOARCH: ${{ matrix.goarch }}
5520

56-
release-macos-arm64:
57-
name: ARM64 macOS release
58-
runs-on: ubuntu-latest
5921
steps:
6022
- uses: actions/checkout@v2
23+
6124
- uses: actions/setup-go@v2
6225
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)
26+
go-version: '^1.15'
27+
28+
- run: go build -v -o cloud-agent-$GOOS-$GOARCH
29+
30+
- run: gh release upload $(echo $GITHUB_REF | cut -d/ -f3) ./cloud-agent-$GOOS-$GOARCH
6931
env:
7032
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)