Skip to content

Commit 058cb3d

Browse files
ci: add linux arm64 support to build and release workflows
- Add aarch64-unknown-linux-musl build steps to build workflow - Remove ubuntu-24.04-arm exclusion guard - Add ubuntu-24.04-arm to release matrix - Add linux-arm64 artifact download, upx compression, and zip in release - Add aarch64-linux-musl-gcc linker to .cargo/config.toml - Add panic=abort and exclude crates/.claude to Cargo.toml
1 parent fcaa94e commit 058cb3d

4 files changed

Lines changed: 70 additions & 1 deletion

File tree

.cargo/config.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
[target.x86_64-unknown-linux-musl]
22
linker = "x86_64-linux-musl-gcc"
33

4+
[target.aarch64-unknown-linux-musl]
5+
linker = "aarch64-linux-musl-gcc"
6+
47
[target.x86_64-pc-windows-gnu]
58
linker = "x86_64-w64-mingw32-gcc"

.github/workflows/build-datadog-serverless-compat.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ jobs:
2323
- uses: mozilla-actions/sccache-action@65101d47ea8028ed0c98a1cdea8dd9182e9b5133 #v0.0.8
2424
build-datadog-serverless-compat:
2525
name: Build Datadog Serverless Compat
26-
if: ${{ inputs.runner != 'ubuntu-24.04-arm' }}
2726
needs: setup
2827
runs-on: ${{ inputs.runner }}
2928
steps:
@@ -43,6 +42,18 @@ jobs:
4342
name: linux-amd64
4443
path: target/x86_64-unknown-linux-musl/release/datadog-serverless-compat
4544
retention-days: 3
45+
- if: ${{ inputs.runner == 'ubuntu-24.04-arm' }}
46+
shell: bash
47+
run: |
48+
sudo apt-get update
49+
rustup target add aarch64-unknown-linux-musl && sudo apt-get install -y musl-tools
50+
cargo build --release -p datadog-serverless-compat --target aarch64-unknown-linux-musl
51+
- if: ${{ inputs.runner == 'ubuntu-24.04-arm' }}
52+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # 4.6.2
53+
with:
54+
name: linux-arm64
55+
path: target/aarch64-unknown-linux-musl/release/datadog-serverless-compat
56+
retention-days: 3
4657
- if: ${{ inputs.runner == 'windows-2022' }}
4758
shell: bash
4859
run: cargo build --release -p datadog-serverless-compat --features windows-pipes
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Release Datadog Serverless Compat (Per Platform)
2+
3+
on: workflow_dispatch
4+
5+
permissions: {}
6+
7+
jobs:
8+
build:
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
runner: [ubuntu-24.04, ubuntu-24.04-arm, windows-2022]
13+
uses: ./.github/workflows/build-datadog-serverless-compat.yml
14+
with:
15+
runner: ${{matrix.runner}}
16+
release:
17+
runs-on: ubuntu-24.04
18+
needs: build
19+
permissions:
20+
contents: write
21+
steps:
22+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # 4.3.0
23+
with:
24+
name: linux-amd64
25+
path: target/linux-amd64
26+
- run: |
27+
chmod +x target/linux-amd64/datadog-serverless-compat
28+
upx target/linux-amd64/datadog-serverless-compat --lzma
29+
- run: zip -j datadog-serverless-compat-linux-amd64.zip target/linux-amd64/datadog-serverless-compat
30+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # 4.3.0
31+
with:
32+
name: linux-arm64
33+
path: target/linux-arm64
34+
- run: |
35+
chmod +x target/linux-arm64/datadog-serverless-compat
36+
upx target/linux-arm64/datadog-serverless-compat --lzma
37+
- run: zip -j datadog-serverless-compat-linux-arm64.zip target/linux-arm64/datadog-serverless-compat
38+
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # 4.3.0
39+
with:
40+
name: windows-amd64
41+
path: target/windows-amd64
42+
- run: upx target/windows-amd64/datadog-serverless-compat.exe --lzma
43+
- run: zip -j datadog-serverless-compat-windows-amd64.zip target/windows-amd64/datadog-serverless-compat.exe
44+
- uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 # v2.2.2
45+
with:
46+
draft: true
47+
generate_release_notes: true
48+
files: |
49+
datadog-serverless-compat-linux-amd64.zip
50+
datadog-serverless-compat-linux-arm64.zip
51+
datadog-serverless-compat-windows-amd64.zip

Cargo.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ resolver = "2"
66
members = [
77
"crates/*",
88
]
9+
exclude = [
10+
"crates/.claude",
11+
]
912

1013
[workspace.package]
1114
edition = "2024"
@@ -18,3 +21,4 @@ opt-level = "z"
1821
lto = true
1922
codegen-units = 1
2023
strip = true
24+
panic = "abort"

0 commit comments

Comments
 (0)