Build for MUSL #11
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: Build for MUSL | |
on: workflow_dispatch | |
defaults: | |
run: | |
# necessary for windows | |
shell: bash | |
jobs: | |
build-artifacts: | |
strategy: | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
id-token: write | |
env: | |
archive_name: rhai-test | |
steps: | |
- uses: jirutka/setup-alpine@v1 | |
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | |
with: | |
shell-name: alpine.sh | |
packages: > | |
build-base | |
musl-dev | |
rustup | |
cmake | |
- uses: actions/checkout@v4 | |
with: | |
ref: ${{ needs.prepare-release.outputs.sha }} | |
#- uses: actions-rust-lang/setup-rust-toolchain@v1 | |
# with: | |
# target: ${{ matrix.target }} | |
#- uses: arduino/setup-protoc@v3 | |
# with: | |
# repo-token: ${{ secrets.GITHUB_TOKEN }} | |
- name: Install Rust stable toolchain via rustup | |
if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | |
run: rustup-init --target ${{ matrix.target }} --default-toolchain stable --profile minimal -y | |
shell: alpine.sh {0} | |
#- name: Install MUSL tools | |
# if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | |
# run: sudo apt-get update && sudo apt-get install -y musl-tools | |
#- name: Install MUSL tools | |
# if: ${{ matrix.target == 'x86_64-unknown-linux-musl' }} | |
# run: su root -c "apk update && apk add musl-dev build-base" | |
# shell: alpine.sh {0} | |
- name: Build | |
run: cargo build --release --target ${{ matrix.target }} | |
shell: alpine.sh {0} | |
#env: | |
# V8_FROM_SOURCE: ${{ matrix.target == 'x86_64-unknown-linux-musl' && 'true' || 'false' }} |