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
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