Skip to content

Commit 9bcce0f

Browse files
committed
fix building of armhf and aarch64 binaries upon CD
1 parent 4e35cd4 commit 9bcce0f

File tree

1 file changed

+40
-40
lines changed

1 file changed

+40
-40
lines changed

.github/workflows/cd.yml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,44 @@ on:
99

1010
jobs:
1111

12-
windows:
13-
runs-on: windows-2019
12+
gnu_linux_aarch64:
13+
runs-on: ubuntu-20.04
1414
steps:
15-
- run: git config --global core.autocrlf false
16-
1715
- name: Checkout the repository
18-
uses: actions/checkout@v2
16+
uses: actions/checkout@v4
17+
18+
- name: Prepare cross-platform environment
19+
run: |
20+
sudo mkdir /cross-build
21+
sudo touch /etc/apt/sources.list.d/arm64.list
22+
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main" | sudo tee -a /etc/apt/sources.list.d/arm64.list
23+
sudo apt-get update
24+
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
25+
sudo apt-get download libssl1.1:arm64 libssl-dev:arm64
26+
sudo dpkg -x libssl1.1*.deb /cross-build
27+
sudo dpkg -x libssl-dev*.deb /cross-build
28+
rustup target add aarch64-unknown-linux-gnu
29+
echo "C_INCLUDE_PATH=/cross-build/usr/include" >> $GITHUB_ENV
30+
echo "OPENSSL_INCLUDE_DIR=/cross-build/usr/include/aarch64-linux-gnu" >> $GITHUB_ENV
31+
echo "OPENSSL_LIB_DIR=/cross-build/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
32+
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
33+
echo "RUSTFLAGS=-C linker=aarch64-linux-gnu-gcc -L/usr/aarch64-linux-gnu/lib -L/cross-build/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
1934
2035
- name: Build the executable
21-
run: cargo build --release
36+
run: cargo build --release --target=aarch64-unknown-linux-gnu --no-default-features --features cli
2237

23-
- uses: Shopify/[email protected]
38+
- name: Attach artifact to the release
39+
uses: Shopify/[email protected]
2440
with:
25-
name: monolith.exe
26-
path: target\release\monolith.exe
41+
name: monolith-gnu-linux-aarch64
42+
path: target/aarch64-unknown-linux-gnu/release/monolith
2743
repo-token: ${{ secrets.GITHUB_TOKEN }}
2844

2945
gnu_linux_armhf:
3046
runs-on: ubuntu-20.04
3147
steps:
3248
- name: Checkout the repository
33-
uses: actions/checkout@v2
49+
uses: actions/checkout@v4
3450

3551
- name: Prepare cross-platform environment
3652
run: |
@@ -50,7 +66,7 @@ jobs:
5066
echo "RUSTFLAGS=-C linker=arm-linux-gnueabihf-gcc -L/usr/arm-linux-gnueabihf/lib -L/cross-build/usr/lib/arm-linux-gnueabihf -L/cross-build/lib/arm-linux-gnueabihf" >> $GITHUB_ENV
5167
5268
- name: Build the executable
53-
run: cargo build --release --target=arm-unknown-linux-gnueabihf
69+
run: cargo build --release --target=arm-unknown-linux-gnueabihf --no-default-features --features cli
5470

5571
- name: Attach artifact to the release
5672
uses: Shopify/[email protected]
@@ -59,50 +75,34 @@ jobs:
5975
path: target/arm-unknown-linux-gnueabihf/release/monolith
6076
repo-token: ${{ secrets.GITHUB_TOKEN }}
6177

62-
gnu_linux_aarch64:
78+
gnu_linux_x86_64:
6379
runs-on: ubuntu-20.04
6480
steps:
6581
- name: Checkout the repository
66-
uses: actions/checkout@v2
67-
68-
- name: Prepare cross-platform environment
69-
run: |
70-
sudo mkdir /cross-build
71-
sudo touch /etc/apt/sources.list.d/arm64.list
72-
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports/ focal main" | sudo tee -a /etc/apt/sources.list.d/arm64.list
73-
sudo apt-get update
74-
sudo apt-get install -y gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
75-
sudo apt-get download libssl1.1:arm64 libssl-dev:arm64
76-
sudo dpkg -x libssl1.1*.deb /cross-build
77-
sudo dpkg -x libssl-dev*.deb /cross-build
78-
rustup target add aarch64-unknown-linux-gnu
79-
echo "C_INCLUDE_PATH=/cross-build/usr/include" >> $GITHUB_ENV
80-
echo "OPENSSL_INCLUDE_DIR=/cross-build/usr/include/aarch64-linux-gnu" >> $GITHUB_ENV
81-
echo "OPENSSL_LIB_DIR=/cross-build/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
82-
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
83-
echo "RUSTFLAGS=-C linker=aarch64-linux-gnu-gcc -L/usr/aarch64-linux-gnu/lib -L/cross-build/usr/lib/aarch64-linux-gnu" >> $GITHUB_ENV
82+
uses: actions/checkout@v4
8483

8584
- name: Build the executable
86-
run: cargo build --release --target=aarch64-unknown-linux-gnu
85+
run: cargo build --release
8786

88-
- name: Attach artifact to the release
89-
uses: Shopify/[email protected]
87+
- uses: Shopify/[email protected]
9088
with:
91-
name: monolith-gnu-linux-aarch64
92-
path: target/aarch64-unknown-linux-gnu/release/monolith
89+
name: monolith-gnu-linux-x86_64
90+
path: target/release/monolith
9391
repo-token: ${{ secrets.GITHUB_TOKEN }}
9492

95-
gnu_linux_x86_64:
96-
runs-on: ubuntu-20.04
93+
windows:
94+
runs-on: windows-2019
9795
steps:
96+
- run: git config --global core.autocrlf false
97+
9898
- name: Checkout the repository
99-
uses: actions/checkout@v2
99+
uses: actions/checkout@v4
100100

101101
- name: Build the executable
102102
run: cargo build --release
103103

104104
- uses: Shopify/[email protected]
105105
with:
106-
name: monolith-gnu-linux-x86_64
107-
path: target/release/monolith
106+
name: monolith.exe
107+
path: target\release\monolith.exe
108108
repo-token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)