Skip to content

Commit 0e7c062

Browse files
committed
update build/release to run binary builds in parallel for mac/linux
Signed-off-by: Adam D. Cornett <[email protected]>
1 parent 436b6cd commit 0e7c062

File tree

2 files changed

+33
-9
lines changed

2 files changed

+33
-9
lines changed

.github/workflows/go.yml

Lines changed: 25 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,29 @@ jobs:
4141
github-token: ${{ secrets.GITHUB_TOKEN }}
4242
file: coverage.out
4343

44-
- name: Build Multi-arch-linux
45-
run: make build-multi-arch-linux
44+
build-linux-binaries:
45+
name: Build Multi-arch-linux
46+
runs-on: ubuntu-latest
47+
strategy:
48+
matrix:
49+
platform: [ linux ]
50+
architecture:
51+
- amd64
52+
- arm64
53+
- ppc64le
54+
- s390x
55+
steps:
56+
- uses: actions/checkout@v4
57+
- name: Build linux binary for ${{ matrix.architecture }}
58+
run: make build-linux-${{ matrix.architecture }}
4659

47-
- name: Build Multi-arch-mac
48-
run: make build-multi-arch-mac
60+
build-mac-binaries:
61+
name: Build Multi-arch-mac
62+
runs-on: ubuntu-latest
63+
strategy:
64+
matrix:
65+
architecture: [ amd64, arm64 ]
66+
steps:
67+
- uses: actions/checkout@v4
68+
- name: Build Mac binary for ${{ matrix.architecture }}
69+
run: make build-mac-${{ matrix.architecture }}

.github/workflows/release-artifacts.yml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,13 @@ jobs:
5757
tag: ${{ inputs.tag }}
5858
GH_TOKEN: ${{ secrets.token }}
5959

60-
# an ugly workaround to build binaries for mac. builds locally and pushes to the release.
60+
# builds mac binaries in parallel using matrix strategy
6161
add-darwin-bins:
6262
name: Release binaries for MacOS
6363
runs-on: ubuntu-latest
64+
strategy:
65+
matrix:
66+
architecture: [amd64, arm64]
6467
steps:
6568
- uses: actions/checkout@v4
6669
- name: Set Env Tags
@@ -72,12 +75,12 @@ jobs:
7275
uses: actions/setup-go@v5
7376
with:
7477
go-version-file: go.mod
75-
- name: Build Multi-arch-mac
76-
run: make build-multi-arch-mac
78+
- name: Build Mac binary for ${{ matrix.architecture }}
79+
run: make build-mac-${{ matrix.architecture }}
7780

78-
- name: Upload binaries to the release
81+
- name: Upload binary to the release
7982
run:
80-
gh release upload --repo "${GITHUB_REPOSITORY}" "${tag}" preflight-darwin-*
83+
gh release upload --repo "${GITHUB_REPOSITORY}" "${tag}" preflight-darwin-${{ matrix.architecture }}
8184
env:
8285
tag: ${{ inputs.tag }}
8386
GH_TOKEN: ${{ secrets.token }}

0 commit comments

Comments
 (0)