Skip to content

Release

Release #66

Workflow file for this run

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
- 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
- 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. Since we want to use the Docker image for cargo-zigbuild to be able
# to build a universal binary, we cross-compile from a ubuntu-latest runner.
release-macos:
name: Release universal binary for MacOS
runs-on: ubuntu-latest
steps:
- run: |
podman pull docker.io/messense/cargo-zigbuild
podman run --rm \
-v ${GITHUB_WORKSPACE}:/io \
-w /io docker.io/messense/cargo-zigbuild \
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
- 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