Release v0.1.7 #8
Workflow file for this run
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 | |
on: | |
push: | |
tags: [ 'v*' ] | |
jobs: | |
build: | |
strategy: | |
fail-fast: false | |
matrix: | |
targets: [ | |
{ os: ubuntu-latest, target: x86_64-unknown-linux-musl, cross: false, name: linux64, ext: '' }, | |
{ os: ubuntu-latest, target: i686-unknown-linux-musl, cross: true, name: linux32, ext: '' }, | |
{ os: ubuntu-latest, target: aarch64-unknown-linux-musl, cross: true, name: linux-arm64, ext: '' }, | |
{ os: macos-latest, target: x86_64-apple-darwin, cross: false, name: mac64, ext: '' }, | |
{ os: macos-latest, target: aarch64-apple-darwin, cross: true, name: mac-arm64, ext: '' }, | |
{ os: windows-latest, target: x86_64-pc-windows-msvc, cross: false, name: windows64, ext: '.exe' }, | |
{ os: windows-latest, target: i686-pc-windows-msvc, cross: false, name: windows32, ext: '.exe' }, | |
{ os: windows-latest, target: aarch64-pc-windows-msvc, cross: false, name: windows-arm64, ext: '.exe' } | |
] | |
runs-on: ${{ matrix.targets.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
profile: minimal | |
override: true | |
target: ${{ matrix.targets.target }} | |
- uses: Swatinem/rust-cache@v2 | |
- name: Add rust target | |
run: rustup target add ${{ matrix.targets.target }} | |
- name: Setup target ${{ matrix.targets.target }} | |
if: ${{ matrix.targets.target == 'aarch64-apple-darwin' }} | |
run: | | |
echo "SDKROOT=$(xcrun -sdk macosx11.1 --show-sdk-path)" >> $GITHUB_ENV | |
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx11.1 --show-sdk-platform-version)" >> $GITHUB_ENV | |
- name: Build mp4_merge | |
env: | |
CARGO_TARGET_DIR: ./target | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.targets.cross }} | |
command: build | |
args: --target ${{ matrix.targets.target }} --release | |
- name: Strip | |
if: ${{ matrix.targets.os != 'windows-latest' }} | |
continue-on-error: true | |
run: strip target/${{ matrix.targets.target }}/release/mp4_merge 2>/dev/null || true | |
- name: Copy dist | |
run: | | |
mkdir dist | |
mv target/${{ matrix.targets.target }}/release/mp4_merge${{ matrix.targets.ext }} dist/mp4_merge-${{ matrix.targets.name }}${{ matrix.targets.ext }} | |
- name: Save Binaries | |
uses: actions/upload-artifact@v3 | |
with: | |
name: mp4_merge | |
path: dist/mp4_merge* | |
github_release: | |
name: Create GitHub release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: mp4_merge | |
- run: ls -l | |
- name: Publish | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ./* | |