Skip to content

Commit 9cc1e33

Browse files
authored
feat: build Ubuntu arm64 (#12)
* feat: build Ubuntu arm64 * fix: build and upload both amd64 and arm64 Linux assets in release workflow * fix: add latest tag * fix matrix * chore: bump connectorx → ^0.4.3 so ARM64 wheel is available * fix docker multi arch step --------- Co-authored-by: 8ball030 <35799987+8ball030@users.noreply.github.com>
2 parents 3197031 + f890d75 commit 9cc1e33

3 files changed

Lines changed: 49 additions & 37 deletions

File tree

.github/workflows/publish.yaml

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,18 @@ jobs:
1616
include:
1717
- platform: 'macos-latest' # for Arm based macs (M1 and above).
1818
args: '--target aarch64-apple-darwin'
19-
docker_platform: 'linux/arm64,linux/amd64'
2019
- platform: 'macos-latest' # for Intel based macs.
2120
args: '--target x86_64-apple-darwin'
22-
docker_platform: 'linux/arm64,linux/amd64'
2321
- platform: 'ubuntu-22.04'
2422
args: ''
25-
docker_platform: 'linux/amd64'
26-
- platform: 'ubuntu-22.04' #ARM64
23+
- platform: 'ubuntu-22.04-arm'
2724
args: ''
2825
docker_platform: 'linux/arm64'
26+
- platform: 'ubuntu-22.04'
27+
args: ''
28+
docker_platform: 'linux/amd64'
2929
- platform: 'windows-latest'
3030
args: ''
31-
docker_platform: 'windows/amd64' # adjust based on your image build support
3231

3332

3433
runs-on: ${{ matrix.platform }}
@@ -41,7 +40,7 @@ jobs:
4140
steps:
4241
- uses: actions/checkout@v4
4342
- name: install dependencies (ubuntu only)
44-
if: matrix.platform == 'ubuntu-22.04' # This must match the platform value defined above.
43+
if: startsWith(matrix.platform, 'ubuntu-22.04')
4544
run: |
4645
sudo apt-get update
4746
sudo apt-get install -y libwebkit2gtk-4.1-dev libappindicator3-dev librsvg2-dev patchelf
@@ -84,10 +83,16 @@ jobs:
8483
args: ${{ matrix.args }}
8584

8685
- name: Package Linux binary
87-
if: matrix.platform == 'ubuntu-22.04'
86+
if: startsWith(matrix.platform, 'ubuntu-22.04')
8887
id: package-linux
8988
run: |
90-
BIN_NAME=agent_runner_${RELEASE_VERSION}_amd64
89+
ARCH="$(uname -m)"
90+
if [ "$ARCH" = "aarch64" ]; then
91+
SUFFIX="arm64"
92+
else
93+
SUFFIX="amd64"
94+
fi
95+
BIN_NAME="agent_runner_${RELEASE_VERSION}_${SUFFIX}"
9196
TAR_NAME=${BIN_NAME}.tar.gz
9297
9398
cp ./src-tauri/target/release/agent_runner $BIN_NAME
@@ -96,7 +101,7 @@ jobs:
96101
echo "file=third_party/agent_runner/${TAR_NAME}" >> $GITHUB_OUTPUT
97102
98103
- name: Upload Linux binary to GitHub release
99-
if: matrix.platform == 'ubuntu-22.04'
104+
if: startsWith(matrix.platform, 'ubuntu-22.04')
100105
uses: softprops/action-gh-release@v1
101106
with:
102107
tag_name: ${{ env.RELEASE_VERSION }}
@@ -111,6 +116,7 @@ jobs:
111116
RELEASE_VERSION: 0.1.21
112117
IMAGE_NAME: ${{ secrets.DOCKER_USERNAME }}/${{ secrets.DOCKER_REPO_NAME }}
113118

119+
114120
# Needed
115121
strategy:
116122
fail-fast: false
@@ -130,6 +136,7 @@ jobs:
130136
args: '--target aarch64-unknown-linux-gnu'
131137
docker_platform: 'linux/arm64'
132138
tag_suffix: 'linux-arm64'
139+
133140
runs-on: ubuntu-22.04
134141
steps:
135142
- uses: actions/checkout@v4
@@ -145,13 +152,13 @@ jobs:
145152
username: ${{ secrets.DOCKER_USERNAME }}
146153
password: ${{ secrets.DOCKER_PASSWORD }}
147154

148-
- name: Build platform specific image using buildx
149-
run: |
150-
export PLATFORM_TAG=$(echo ${{ matrix.docker_platform }} | tr '/' '-')
151-
docker buildx build \
152-
--platform=${{ matrix.docker_platform }} \
153-
--tag $IMAGE_NAME:${RELEASE_VERSION} \
154-
--tag $IMAGE_NAME:latest \
155-
--push \
156-
.
157-
shell: bash
155+
- name: Build & push multi-arch
156+
uses: docker/build-push-action@v6
157+
with:
158+
context: .
159+
push: true
160+
platforms: linux/amd64,linux/arm64
161+
tags: |
162+
${{ env.IMAGE_NAME }}:${{ env.RELEASE_VERSION }}
163+
${{ env.IMAGE_NAME }}:latest
164+

poetry.lock

Lines changed: 22 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ autonomy-dev = {version = "==0.2.153", extras = ["all"]}
2626
paradigm-flood = "^0.3.1"
2727
lxml = {extras = ["html-clean"], version = "^5.3.1"}
2828
aioprometheus = "^23.12.0"
29+
connectorx = "^0.4.3"
2930

3031
[tool.poetry.group.dev.dependencies]
3132

0 commit comments

Comments
 (0)