Release v0.5.7 #27
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
# taken from https://github.com/cargo-generate/cargo-generate/blob/master/.github/workflows/release.yml and | |
# https://github.com/cargo-generate/cargo-generate/blob/master/.github/workflows/release-binary-assets.yml and | |
# modified | |
## references: | |
# cache: https://github.com/actions/cache/blob/main/examples.md#rust---cargo | |
# audit: https://github.com/actions-rs/audit-check | |
# "needs": https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#jobsjob_idneeds | |
name: Release | |
on: | |
push: | |
tags: | |
- 'v[0-9]+.[0-9]+.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]-alpha.[0-9]+' | |
- 'v[0-9]+.[0-9]+.[0-9]-beta.[0-9]+' | |
paths-ignore: | |
- "**/docs/**" | |
- "**.md" | |
jobs: | |
check: | |
name: check | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [ 'macos-latest', 'ubuntu-latest', 'windows-latest' ] | |
runs-on: ${{ matrix.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup | rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo check | |
lint: | |
name: lint | |
needs: check | |
strategy: | |
fail-fast: false | |
matrix: | |
version: [ 'macos-latest', 'ubuntu-20.04', 'windows-2022' ] | |
cargo-cmd: | |
- fmt --all -- --check | |
- clippy --all-targets --all-features -- -D warnings | |
runs-on: ${{ matrix.version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: setup | rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy, rustfmt | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo ${{ matrix['cargo-cmd'] }} | |
release: | |
name: post / github release | |
needs: lint | |
runs-on: ubuntu-latest | |
environment: release | |
outputs: | |
version: ${{ steps.tag_name.outputs.current_version }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Get version from tag | |
id: tag_name | |
run: | | |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v} | |
shell: bash | |
- name: Create Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
# This pulls from the "Get Changelog Entry" step above, referencing its ID to get its outputs object. | |
# See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps | |
tag_name: ${{ github.ref }} | |
release_name: Release ${{ steps.tag_name.outputs.current_version }} | |
rba: | |
name: release binary assets | |
needs: release | |
runs-on: ${{ matrix.os }} | |
env: | |
CC_aarch64_unknown_linux_musl: "clang" | |
AR_aarch64_unknown_linux_musl: "llvm-ar" | |
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_MUSL_RUSTFLAGS: "-Clink-self-contained=yes -Clinker=rust-lld" | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-20.04 | |
binName: luminous-ttv | |
- target: aarch64-unknown-linux-musl | |
os: ubuntu-20.04 | |
binName: luminous-ttv | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
binName: luminous-ttv | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
binName: luminous-ttv | |
- target: i686-pc-windows-msvc | |
os: windows-2022 | |
binName: luminous-ttv.exe | |
- target: x86_64-pc-windows-msvc | |
os: windows-2022 | |
binName: luminous-ttv.exe | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install musl tools | |
if: ${{ contains(matrix.os, 'ubuntu') }} | |
run: sudo apt-get install -y musl-dev musl-tools clang llvm | |
- name: Setup Rust | |
uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: ${{ matrix.target }} | |
- uses: Swatinem/rust-cache@v2 | |
- run: cargo build --release --target=${{ matrix.target }} | |
- name: Smoke Test | |
if: ${{ !contains(matrix.target, 'aarch64') }} | |
run: cargo run --release --target=${{ matrix.target }} -- -V | |
- name: Move Binary | |
id: mv | |
run: mv "target/${{ matrix.target }}/release/${{ matrix.binName }}" . | |
- name: chmod binary #not working? ignored by zip action? | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: chmod +x "${{ matrix.binName }}" | |
- name: Zip Files | |
uses: vimtor/action-zip@v1 | |
id: archive | |
with: | |
files: README.md LICENSE-GPL.txt LICENSE-MIT.txt ${{ matrix.binName }} | |
dest: luminous-ttv-${{ needs.release.outputs.version }}-${{ matrix.target }}.zip | |
- name: Upload Archive | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
artifactErrorsFailBuild: true | |
artifacts: luminous-ttv-${{ needs.release.outputs.version }}-${{ matrix.target }}.zip | |
artifactContentType: application/zip | |
omitBodyDuringUpdate: true | |
omitNameDuringUpdate: true | |
omitPrereleaseDuringUpdate: true |