Release #81
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: Release | |
permissions: | |
contents: write | |
on: | |
workflow_dispatch: | |
push: | |
tags: | |
- v[0-9]+.* | |
jobs: | |
release-linux-musl-amd64: | |
name: Release for Linux/amd64/musl | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-unknown-linux-musl | |
- name: Install Musl dev tools | |
run: sudo apt-get update && sudo apt-get install musl-dev musl-tools | |
- name: Install protobuf compiler | |
run: sudo apt-get install protobuf-compiler | |
- run: cargo build --release --target x86_64-unknown-linux-musl | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: target/x86_64-unknown-linux-musl/release/dash-mpd-cli | |
asset_name: dash-mpd-cli-linux-amd64 | |
overwrite: true | |
release-linux-aarch64: | |
name: Release for Linux/aarch64 | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: aarch64-unknown-linux-gnu | |
- name: Install GCC cross-compiler for aarch64 | |
run: sudo apt-get update && sudo apt-get install gcc-aarch64-linux-gnu | |
- name: Install protobuf compiler | |
run: sudo apt-get install protobuf-compiler | |
- run: | | |
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc | |
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc | |
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++ | |
cargo build --release --target aarch64-unknown-linux-gnu | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: target/aarch64-unknown-linux-gnu/release/dash-mpd-cli | |
asset_name: dash-mpd-cli-linux-aarch64 | |
overwrite: true | |
# Some of the GitHub MacOS runners (M1 processor) do not support nested virtualization, so can't | |
# run Docker/Podman in a VM. | |
release-macos: | |
name: Release universal binary for MacOS | |
runs-on: macos-14 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-apple-darwin,aarch64-apple-darwin | |
- uses: korandoru/setup-zig@v1 | |
with: | |
zig-version: 0.10.1 | |
- run: | | |
brew install protobuf cmake | |
cargo install --locked cargo-zigbuild | |
CXX=g++-14 CC=gcc-14 SDKROOT=/Applications/Xcode_15.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.5.sdk cargo zigbuild --release --target universal2-apple-darwin | |
# podman pull docker.io/messense/cargo-zigbuild | |
# podman run --rm \ | |
# -v ${GITHUB_WORKSPACE}:/io \ | |
# -w /io docker.io/messense/cargo-zigbuild \ | |
# brew install cmake && \ | |
# cargo zigbuild --release --target universal2-apple-darwin | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: target/universal2-apple-darwin/release/dash-mpd-cli | |
asset_name: dash-mpd-cli-macos | |
overwrite: true | |
release-windows: | |
name: Release for Windows/amd64 | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: msys2/setup-msys2@v2 | |
with: | |
msystem: UCRT64 | |
update: true | |
install: base-devel autotools mingw-w64-ucrt-x86_64-toolchain mingw-w64-ucrt-x86_64-rust mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake git | |
- name: install protobuf compiler | |
run: choco install --yes --limit-output protoc | |
- name: install NASM for rustls build | |
run: | | |
choco install nasm | |
echo "C:\Program Files\NASM" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
- run: cargo build --release | |
shell: msys2 {0} | |
- name: Upload binaries to release | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
tag: ${{ github.ref }} | |
file: target/release/dash-mpd-cli.exe | |
asset_name: dash-mpd-cli-windows.exe | |
overwrite: true | |