Skip to content
This repository was archived by the owner on Jul 14, 2025. It is now read-only.

Commit 313aeb6

Browse files
authored
Merge pull request #147 from vdice/ci/release-add-arm64
ci(release.yaml): add cross-compiled aarch64 config
2 parents b274501 + 4fb7dfd commit 313aeb6

File tree

1 file changed

+51
-5
lines changed

1 file changed

+51
-5
lines changed

.github/workflows/release.yaml

Lines changed: 51 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,38 @@ jobs:
1313
strategy:
1414
matrix:
1515
config:
16-
- { os: "ubuntu-latest", arch: "amd64", extension: "", env: {} }
17-
- { os: "macos-latest", arch: "amd64", extension: "", env: {} }
18-
- { os: "windows-latest", arch: "amd64", extension: ".exe", env: {} }
16+
- {
17+
os: "ubuntu-latest",
18+
arch: "amd64",
19+
extension: "",
20+
args: "--all-features --release",
21+
targetDir: "target/release",
22+
env: {},
23+
}
24+
- {
25+
os: "ubuntu-latest",
26+
arch: "aarch64",
27+
extension: "",
28+
args: "--all-features --release --target aarch64-unknown-linux-gnu",
29+
targetDir: "target/aarch64-unknown-linux-gnu/release",
30+
env: { OPENSSL_DIR: "/usr/local/openssl-aarch64" },
31+
}
32+
- {
33+
os: "macos-latest",
34+
arch: "amd64",
35+
extension: "",
36+
args: "--all-features --release",
37+
targetDir: "target/release",
38+
env: {},
39+
}
40+
- {
41+
os: "windows-latest",
42+
arch: "amd64",
43+
extension: ".exe",
44+
args: "--all-features --release",
45+
targetDir: "target/release",
46+
env: {},
47+
}
1948
steps:
2049
- uses: actions/checkout@v2
2150

@@ -35,6 +64,23 @@ jobs:
3564
OS=$(echo "${{ runner.os }}" | tr '[:upper:]' '[:lower:]')
3665
echo "RUNNER_OS=$OS" >> $GITHUB_ENV
3766
67+
- name: setup for cross-compiled aarch64 build
68+
if: matrix.config.arch == 'aarch64'
69+
run: |
70+
sudo apt update
71+
sudo apt install gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
72+
cd /tmp
73+
git clone https://github.com/openssl/openssl
74+
cd openssl
75+
git checkout OpenSSL_1_1_1l
76+
sudo mkdir -p $OPENSSL_DIR
77+
./Configure linux-aarch64 --prefix=$OPENSSL_DIR --openssldir=$OPENSSL_DIR shared
78+
make CC=aarch64-linux-gnu-gcc
79+
sudo make install
80+
rustup target add aarch64-unknown-linux-gnu
81+
echo '[target.aarch64-unknown-linux-gnu]' >> ${HOME}/.cargo/config.toml
82+
echo 'linker = "aarch64-linux-gnu-gcc"' >> ${HOME}/.cargo/config.toml
83+
3884
# hack: install rustfmt to work around darwin toolchain issues
3985
- name: "(macOS) install dev tools"
4086
if: runner.os == 'macOS'
@@ -47,13 +93,13 @@ jobs:
4793
uses: actions-rs/cargo@v1
4894
with:
4995
command: build
50-
args: "--all-features --release"
96+
args: ${{ matrix.config.args }}
5197

5298
- name: package release assets
5399
shell: bash
54100
run: |
55101
mkdir _dist
56-
cp README.md LICENSE.txt target/release/wagi${{ matrix.config.extension }} _dist/
102+
cp README.md LICENSE.txt ${{ matrix.config.targetDir }}/wagi${{ matrix.config.extension }} _dist/
57103
cd _dist
58104
tar czf wagi-${{ env.RELEASE_VERSION }}-${{ env.RUNNER_OS }}-${{ matrix.config.arch }}.tar.gz README.md LICENSE.txt wagi${{ matrix.config.extension }}
59105

0 commit comments

Comments
 (0)