Skip to content

Commit

Permalink
ci(actions): install musl-tools
Browse files Browse the repository at this point in the history
  • Loading branch information
xrelkd committed Dec 31, 2023
1 parent e56b104 commit 9dfe6ad
Showing 1 changed file with 3 additions and 36 deletions.
39 changes: 3 additions & 36 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,15 @@ jobs:
strategy:
matrix:
target:
- aarch64-unknown-linux-musl
- armv7-unknown-linux-musleabihf
- x86_64-unknown-linux-musl
# TODO: support macOS in the future?
# - x86_64-apple-darwin

include:
- target: aarch64-unknown-linux-musl
arch_deb: arm64
arch_rpm: aarch64
os: ubuntu-latest
target_rustflags: "--codegen linker=aarch64-linux-gnu-gcc"

- target: armv7-unknown-linux-musleabihf
arch_deb: armhf
arch_rpm: armhf # Fedora does not support armv7
os: ubuntu-latest
target_rustflags: "--codegen linker=arm-linux-gnueabihf-gcc"

- target: x86_64-unknown-linux-musl
arch_deb: amd64
arch_rpm: x86_64
os: ubuntu-latest
target_rustflags: ""

# TODO: support macOS in the future?
# - target: x86_64-apple-darwin
# os: macos-latest
# target_rustflags: ""

runs-on: ${{matrix.os}}

steps:
Expand All @@ -61,7 +40,7 @@ jobs:
- name: Install Dependencies
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
sudo apt install -y protobuf-compiler
sudo apt install -y --no-install-recommends musl-tools protobuf-compiler libprotobuf-dev
- name: Install Rust Toolchain Components
uses: actions-rs/toolchain@v1
Expand All @@ -70,18 +49,6 @@ jobs:
target: ${{ matrix.target }}
toolchain: stable

- name: Install AArch64 Toolchain
if: ${{ matrix.target == 'aarch64-unknown-linux-musl' }}
run: |
sudo apt update
sudo apt install -y gcc-aarch64-linux-gnu
- name: Install ARM7 Toolchain
if: ${{ matrix.target == 'armv7-unknown-linux-musleabihf' }}
run: |
sudo apt update
sudo apt install -y gcc-arm-linux-gnueabihf
- name: Create Package
id: package
env:
Expand All @@ -100,7 +67,7 @@ jobs:
ARCH: ${{ matrix.arch_deb }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
run: ./dev-support/bin/prepare-deb-package
if: ${{ matrix.arch_deb == 'amd64' }}
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch_deb == 'amd64' }}
shell: bash

- name: Create DEB Package
Expand All @@ -123,7 +90,7 @@ jobs:
ARCH: ${{ matrix.arch_rpm }}
TARGET_RUSTFLAGS: ${{ matrix.target_rustflags }}
run: ./dev-support/bin/prepare-rpm-package
if: ${{ matrix.arch_rpm == 'x86_64' }}
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.arch_rpm == 'x86_64' }}
shell: bash

- name: Create RPM Package
Expand Down

0 comments on commit 9dfe6ad

Please sign in to comment.