Skip to content

Commit 3b512ff

Browse files
authored
Merge pull request #7 from SergioGasquez/feature/cd-aarch64
Add `aarch64-unknown-linux-gnu` binary
2 parents eef158c + 1869ed1 commit 3b512ff

File tree

5 files changed

+284
-119
lines changed

5 files changed

+284
-119
lines changed

.github/workflows/package.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 77 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -4,47 +4,81 @@ on:
44
release:
55
types: [created]
66

7+
env:
8+
CARGO_TERM_COLOR: always
9+
710
jobs:
8-
# Linux
9-
10-
x86_64-unknown-linux-gnu:
11-
uses: ./.github/workflows/package.yml
12-
with:
13-
runs_on: ubuntu-latest
14-
target: x86_64-unknown-linux-gnu
15-
16-
x86_64-unknown-linux-musl:
17-
uses: ./.github/workflows/package.yml
18-
with:
19-
runs_on: ubuntu-latest
20-
target: x86_64-unknown-linux-musl
21-
22-
# macOS
23-
24-
aarch64-apple-darwin:
25-
uses: ./.github/workflows/package.yml
26-
with:
27-
runs_on: macos-latest
28-
target: aarch64-apple-darwin
29-
30-
x86_64-apple-darwin:
31-
uses: ./.github/workflows/package.yml
32-
with:
33-
runs_on: macos-latest
34-
target: x86_64-apple-darwin
35-
36-
# Windows
37-
38-
x86_64-pc-windows-gnu:
39-
uses: ./.github/workflows/package.yml
40-
with:
41-
runs_on: windows-latest
42-
target: x86_64-pc-windows-gnu
43-
extension: .exe
44-
45-
x86_64-pc-windows-msvc:
46-
uses: ./.github/workflows/package.yml
47-
with:
48-
runs_on: windows-latest
49-
target: x86_64-pc-windows-msvc
50-
extension: .exe
11+
build:
12+
name: Generating artifacts for ${{ matrix.job.target }}
13+
runs-on: ${{ matrix.job.os }}
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
job:
18+
- os: ubuntu-20.04
19+
target: x86_64-unknown-linux-gnu
20+
- os: ubuntu-20.04
21+
target: x86_64-unknown-linux-musl
22+
- os: ubuntu-20.04
23+
target: aarch64-unknown-linux-gnu
24+
- os: windows-latest
25+
target: x86_64-pc-windows-msvc
26+
extension: .exe
27+
- os: windows-latest
28+
target: x86_64-pc-windows-gnu
29+
extension: .exe
30+
- os: macos-latest
31+
target: aarch64-apple-darwin
32+
- os: macos-latest
33+
target: x86_64-apple-darwin
34+
35+
steps:
36+
- name: Checkout repository
37+
uses: actions/checkout@v3
38+
39+
- name: Install Rust toolchain
40+
uses: dtolnay/rust-toolchain@v1
41+
with:
42+
toolchain: stable
43+
targets: ${{ matrix.job.target }}
44+
45+
- name: Install dependencies
46+
if: matrix.job.os == 'ubuntu-20.04'
47+
run: |
48+
sudo apt-get update
49+
sudo apt-get install libudev-dev librust-libudev-sys-dev pkg-config
50+
51+
- name: Setup cross compile env
52+
if: matrix.job.target == 'aarch64-unknown-linux-gnu'
53+
run: |
54+
sudo sed -i 's/azure\.//' /etc/apt/sources.list
55+
sudo apt-get update
56+
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal main universe" | sudo tee -a /etc/apt/sources.list
57+
echo "deb [arch=arm64] http://ports.ubuntu.com/ubuntu-ports focal-updates main universe" | sudo tee -a /etc/apt/sources.list
58+
sudo apt update
59+
sudo dpkg --add-architecture arm64
60+
sudo apt-get install -y curl git libudev-dev musl-tools pkg-config "libudev1:arm64" "libgcc-s1:arm64" "libc6:arm64" "libudev-dev:arm64" gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf gcc-aarch64-linux-gnu pkg-config-aarch64-linux-gnu
61+
echo "PKG_CONFIG_ALLOW_SYSTEM_LIBS=0" >> $GITHUB_ENV
62+
echo "PKG_CONFIG_DIR=/opt/" >> $GITHUB_ENV
63+
echo "PKG_CONFIG_LIBDIR=/opt/usr/lib/pkgconfig:/opt/usr/share/pkgconfig" >> $GITHUB_ENV
64+
echo "PKG_CONFIG_ALLOW_CROSS=1" >> $GITHUB_ENV
65+
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig" >> $GITHUB_ENV
66+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
67+
68+
- name: Build project
69+
run: cargo build --release --all --target ${{ matrix.job.target }}
70+
71+
- name: Compress (Unix)
72+
if: ${{ matrix.job.os != 'windows-latest' }}
73+
run: zip -j web-flash-${{ matrix.job.target }}.zip target/${{ matrix.job.target }}/release/web-flash
74+
75+
- name: Compress (Windows)
76+
if: ${{ matrix.job.os == 'windows-latest' }}
77+
run: Compress-Archive target/${{ matrix.job.target }}/release/web-flash${{ matrix.job.extension }} web-flash-${{ matrix.job.target }}.zip
78+
79+
- name: Upload archives
80+
uses: svenstaro/upload-release-action@v2
81+
with:
82+
repo_token: ${{ secrets.GITHUB_TOKEN }}
83+
file: web-flash-${{ matrix.job.target }}.zip
84+
tag: ${{ github.ref }}

0 commit comments

Comments
 (0)