@@ -64,15 +64,12 @@ jobs:
6464 include :
6565 - os : ubuntu-latest
6666 target : x86_64-unknown-linux-gnu
67- artifact_name : streamforge
6867 asset_name : streamforge-linux-x86_64
69- - os : macos-13
70- target : x86_64-apple-darwin
71- artifact_name : streamforge
72- asset_name : streamforge-macos-x86_64
68+ - os : ubuntu-latest
69+ target : aarch64-unknown-linux-gnu
70+ asset_name : streamforge-linux-aarch64
7371 - os : macos-latest
7472 target : aarch64-apple-darwin
75- artifact_name : streamforge
7673 asset_name : streamforge-macos-aarch64
7774
7875 steps :
9289 clang \
9390 libclang-dev
9491
92+ - name : Install cross-compiler (Linux aarch64)
93+ if : matrix.target == 'aarch64-unknown-linux-gnu'
94+ run : |
95+ sudo apt-get install -y \
96+ gcc-aarch64-linux-gnu \
97+ libsasl2-dev:arm64 \
98+ libssl-dev:arm64 \
99+ libzstd-dev:arm64 \
100+ libcurl4-openssl-dev:arm64 || true
101+ echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
102+
95103 - name : Install dependencies (macOS)
96104 if : runner.os == 'macOS'
97105 run : |
@@ -110,26 +118,28 @@ jobs:
110118 - name : Build release binary
111119 run : cargo build --release --locked --target ${{ matrix.target }}
112120
113- - name : Strip binary
114- run : strip target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
121+ - name : Strip binary (Linux x86_64 and macOS)
122+ if : matrix.target != 'aarch64-unknown-linux-gnu'
123+ run : strip target/${{ matrix.target }}/release/streamforge
115124
116125 - name : Upload binary to release
117126 env :
118127 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
119128 run : |
120129 TAG="${{ github.event.inputs.tag || github.ref_name }}"
121- cp target/${{ matrix.target }}/release/${{ matrix.artifact_name }} ${{ matrix.asset_name }}
130+ cp target/${{ matrix.target }}/release/streamforge ${{ matrix.asset_name }}
122131 gh release upload "$TAG" ${{ matrix.asset_name }} --clobber
123132
124133 build-docker-images :
125134 name : Build and Push Docker Images
126135 runs-on : ubuntu-latest
127136 continue-on-error : true
128- env :
129- REGISTRY : ghcr.io
130137 steps :
131138 - uses : actions/checkout@v4
132139
140+ - name : Set up QEMU (for multi-arch)
141+ uses : docker/setup-qemu-action@v3
142+
133143 - name : Set up Docker Buildx
134144 uses : docker/setup-buildx-action@v3
135145
@@ -146,12 +156,13 @@ jobs:
146156 TAG="${{ github.event.inputs.tag || github.ref_name }}"
147157 echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT
148158
149- - name : Build and push Docker image
159+ - name : Build and push multi-arch Docker image
150160 uses : docker/build-push-action@v5
151161 with :
152162 context : .
153163 file : ./Dockerfile
154164 push : true
165+ platforms : linux/amd64,linux/arm64
155166 tags : |
156167 ghcr.io/${{ github.repository }}:${{ steps.version.outputs.VERSION }}
157168 ghcr.io/${{ github.repository }}:latest
@@ -165,6 +176,9 @@ jobs:
165176 steps :
166177 - uses : actions/checkout@v4
167178
179+ - name : Set up QEMU (for multi-arch)
180+ uses : docker/setup-qemu-action@v3
181+
168182 - name : Set up Docker Buildx
169183 uses : docker/setup-buildx-action@v3
170184
@@ -187,43 +201,9 @@ jobs:
187201 context : .
188202 file : ./operator/Dockerfile
189203 push : true
204+ platforms : linux/amd64,linux/arm64
190205 tags : |
191206 ghcr.io/${{ github.repository }}-operator:${{ steps.version.outputs.VERSION }}
192207 ghcr.io/${{ github.repository }}-operator:latest
193208 cache-from : type=gha
194209 cache-to : type=gha,mode=max
195-
196- build-ui-image :
197- name : Build and Push UI Image
198- runs-on : ubuntu-latest
199- continue-on-error : true
200- steps :
201- - uses : actions/checkout@v4
202-
203- - name : Set up Docker Buildx
204- uses : docker/setup-buildx-action@v3
205-
206- - name : Log in to GitHub Container Registry
207- uses : docker/login-action@v3
208- with :
209- registry : ghcr.io
210- username : ${{ github.actor }}
211- password : ${{ secrets.GITHUB_TOKEN }}
212-
213- - name : Extract version
214- id : version
215- run : |
216- TAG="${{ github.event.inputs.tag || github.ref_name }}"
217- echo "VERSION=${TAG#v}" >> $GITHUB_OUTPUT
218-
219- - name : Build and push UI image
220- uses : docker/build-push-action@v5
221- with :
222- context : ./ui
223- file : ./ui/Dockerfile
224- push : true
225- tags : |
226- ghcr.io/${{ github.repository }}-ui:${{ steps.version.outputs.VERSION }}
227- ghcr.io/${{ github.repository }}-ui:latest
228- cache-from : type=gha
229- cache-to : type=gha,mode=max
0 commit comments