rust: Build alsa statically #49
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy | |
on: | |
push: | |
branches: | |
- 'main' | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install meson clang | |
sudo apt install musl-dev musl-tools | |
- name: Install Rust dependencies | |
run: | | |
rustup target add x86_64-unknown-linux-musl | |
- name: Compile alsa | |
run: | | |
git clone --depth 1 https://github.com/alsa-project/alsa-lib.git | |
cd alsa-lib | |
libtoolize --force --copy --automake | |
aclocal | |
autoheader | |
automake --foreign --copy --add-missing | |
autoconf | |
./configure --enable-shared=no --enable-static=yes | |
sudo make install | |
- name: Build Rust project | |
run: | | |
export PKG_CONFIG_ALLOW_CROSS=1 | |
export CC=musl-gcc | |
cd libfakedevice-rust | |
./autorun.sh --target=x86_64-unknown-linux-musl | |
- name: Strip C++ binary | |
run: | | |
strip ./libfakedevice-cpp/build/fake-firmware-cpp | |
- name: Strip Rust binary | |
run: | | |
strip ./libfakedevice-rust/target/x86_64-unknown-linux-musl/debug/fake-firmware-rust | |
- name: Strip C binary | |
run: | | |
strip ./libfakedevice-c/build/fake-firmware-c | |
- name: Create a release | |
uses: softprops/action-gh-release@v1 | |
with: | |
tag_name: v0.1.0 | |
files: | | |
./libfakedevice-cpp/build/fake-firmware-cpp | |
./libfakedevice-c/build/fake-firmware-c | |
./libfakedevice-rust/target/x86_64-unknown-linux-musl/debug/fake-firmware-rust | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |