Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f3af5ea

Browse files
committedJun 17, 2024·
Add macos-arm64 to the test builds
1 parent 6110d33 commit f3af5ea

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed
 

‎.github/workflows/publish-go-tester-task.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ on:
3030
repository_dispatch:
3131

3232
env:
33+
PROJECT_NAME: arduino-create-agent
3334
GO_VERSION: "1.21"
3435

3536
jobs:
@@ -119,18 +120,36 @@ jobs:
119120
run: task go:build-win # GOARCH=amd64 by default on the runners
120121
if: runner.os == 'Windows' && matrix.arch == '-amd64'
121122

122-
- name: Build the Agent for macos
123+
- name: Build the Agent for macos amd 64
123124
env:
124125
MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac
125126
CGO_CFLAGS: -mmacosx-version-min=10.15
126127
CGO_LDFLAGS: -mmacosx-version-min=10.15
127-
run: task go:build
128+
run: |
129+
task go:build
130+
mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64
131+
if: runner.os == 'macOS'
132+
133+
- name: Build the Agent for macos arm64
134+
env:
135+
MACOSX_DEPLOYMENT_TARGET: 10.15 # minimum supported version for mac
136+
CGO_CFLAGS: -mmacosx-version-min=10.15
137+
CGO_LDFLAGS: -mmacosx-version-min=10.15
138+
run: |
139+
task go:build-macos-arm64
140+
mv ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_arm64
141+
if: runner.os == 'macOS'
142+
143+
- name: Create universal macos executable
144+
run: |
145+
lipo -create -output ${{ env.PROJECT_NAME }} ${{ env.PROJECT_NAME}}_amd64 ${{ env.PROJECT_NAME}}_arm64
146+
rm ${{ env.PROJECT_NAME}}_amd64 ${{ env.PROJECT_NAME}}_arm64
128147
if: runner.os == 'macOS'
129148

130149
- name: Upload artifacts
131150
uses: actions/upload-artifact@v4
132151
with:
133-
name: arduino-create-agent-${{ matrix.os }}${{ matrix.arch }}
152+
name: ${{ env.PROJECT_NAME}}-${{ matrix.os }}${{ matrix.arch }}
134153
path: |
135-
arduino-create-agent*
154+
${{ env.PROJECT_NAME}}*
136155
if-no-files-found: error

‎Taskfile.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ tasks:
4040
PROJECT_NAME: arduino-create-agent_cli
4141
ADDITIONAL_FLAGS: -tags cli
4242

43+
go:build-macos-arm64:
44+
desc: Build the project for macOS arm64
45+
env:
46+
GOOS: "darwin"
47+
GOARCH: "arm64"
48+
cmds:
49+
- task: go:build
50+
4351
go:build-win:
4452
desc: Build the project for win, to build 32bit `export GOARCH=386` and for 64 bit `export GOARCH=amd64` before `task build-win`
4553
cmds:
@@ -84,7 +92,7 @@ tasks:
8492
cmds:
8593
- poetry run pytest tests
8694

87-
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
95+
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/poetry-task/Taskfile.yml
8896
poetry:install-deps:
8997
desc: Install dependencies managed by Poetry
9098
cmds:
@@ -138,7 +146,6 @@ tasks:
138146
- task: go:vet
139147
- task: go:lint
140148

141-
142149
vars:
143150
# Source: https://github.com/arduino/tooling-project-assets/blob/main/workflow-templates/assets/release-go-task/Taskfile.yml
144151
PROJECT_NAME: arduino-create-agent

0 commit comments

Comments
 (0)
Please sign in to comment.