Skip to content

Commit f8ad5fe

Browse files
authored
Arm builds (#12961)
Release Notes: - N/A
1 parent e2cfbc5 commit f8ad5fe

File tree

3 files changed

+89
-1
lines changed

3 files changed

+89
-1
lines changed

.cargo/config.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,9 @@ rustflags = ["-C", "symbol-mangling-version=v0", "--cfg", "tokio_unstable"]
66
xtask = "run --package xtask --"
77

88
[target.x86_64-unknown-linux-gnu]
9-
linker = "/usr/bin/clang"
9+
linker = "clang"
10+
rustflags = ["-C", "link-arg=-fuse-ld=mold"]
11+
12+
[target.aarch64-unknown-linux-gnu]
13+
linker = "clang"
1014
rustflags = ["-C", "link-arg=-fuse-ld=mold"]

.github/workflows/ci.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,3 +325,86 @@ jobs:
325325
body: ""
326326
env:
327327
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
328+
329+
bundle-linux-aarch64:
330+
timeout-minutes: 60
331+
name: Create arm64 Linux bundle
332+
runs-on:
333+
- hosted-linux-arm-1
334+
if: ${{ startsWith(github.ref, 'refs/tags/v') || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
335+
needs: [linux_tests]
336+
env:
337+
ZED_CLIENT_CHECKSUM_SEED: ${{ secrets.ZED_CLIENT_CHECKSUM_SEED }}
338+
steps:
339+
- name: Checkout repo
340+
uses: actions/checkout@v4
341+
with:
342+
clean: false
343+
- name: "Setup jq"
344+
uses: dcarbone/install-jq-action@v2
345+
346+
- name: Set up Clang
347+
run: |
348+
sudo apt-get update
349+
sudo apt-get install -y llvm-10 clang-10 build-essential cmake pkg-config libasound2-dev libfontconfig-dev libwayland-dev libxkbcommon-x11-dev libssl-dev libzstd-dev libvulkan1 libgit2-dev
350+
echo "/usr/lib/llvm-10/bin" >> $GITHUB_PATH
351+
352+
- uses: rui314/setup-mold@v1
353+
with:
354+
mold_version: 2.32.0
355+
356+
- name: rustup
357+
run: |
358+
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
359+
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
360+
361+
- name: Limit target directory size
362+
run: script/clear-target-dir-if-larger-than 100
363+
364+
- name: Determine version and release channel
365+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
366+
run: |
367+
set -eu
368+
369+
version=$(script/get-crate-version zed)
370+
channel=$(cat crates/zed/RELEASE_CHANNEL)
371+
echo "Publishing version: ${version} on release channel ${channel}"
372+
echo "RELEASE_CHANNEL=${channel}" >> $GITHUB_ENV
373+
374+
expected_tag_name=""
375+
case ${channel} in
376+
stable)
377+
expected_tag_name="v${version}";;
378+
preview)
379+
expected_tag_name="v${version}-pre";;
380+
nightly)
381+
expected_tag_name="v${version}-nightly";;
382+
*)
383+
echo "can't publish a release on channel ${channel}"
384+
exit 1;;
385+
esac
386+
if [[ $GITHUB_REF_NAME != $expected_tag_name ]]; then
387+
echo "invalid release tag ${GITHUB_REF_NAME}. expected ${expected_tag_name}"
388+
exit 1
389+
fi
390+
391+
- name: Create and upload Linux .tar.gz bundle
392+
run: script/bundle-linux
393+
394+
- name: Upload Linux bundle to workflow run if main branch or specific label
395+
uses: actions/upload-artifact@v4
396+
if: ${{ github.ref == 'refs/heads/main' }} || contains(github.event.pull_request.labels.*.name, 'run-bundling') }}
397+
with:
398+
name: zed-${{ github.event.pull_request.head.sha || github.sha }}-aarch64-unknown-linux-gnu.tar.gz
399+
path: target/release/zed-*.tar.gz
400+
401+
- name: Upload app bundle to release
402+
uses: softprops/action-gh-release@v1
403+
if: ${{ env.RELEASE_CHANNEL == 'preview' }}
404+
with:
405+
draft: true
406+
prerelease: ${{ env.RELEASE_CHANNEL == 'preview' }}
407+
files: target/release/zed-linux-aarch64.tar.gz
408+
body: ""
409+
env:
410+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

script/generate-licenses

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ echo -e "# ###### CODE LICENSES ######\n" >> $OUTPUT_FILE
1717
[[ "$(cargo about --version)" == "cargo-about 0.6.1" ]] || cargo install [email protected]
1818

1919
echo "Generating cargo licenses"
20+
cargo install cargo-about
2021
cargo about generate --fail -c script/licenses/zed-licenses.toml script/licenses/template.hbs.md >> $OUTPUT_FILE
2122

2223

0 commit comments

Comments
 (0)