This repository has been archived by the owner on Feb 8, 2024. It is now read-only.
Release #3
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: | |
workflow_dispatch: {} | |
push: | |
tags: | |
- v[0-9].* | |
jobs: | |
release: | |
name: Release | |
strategy: | |
matrix: | |
include: | |
- os: windows-2022 | |
target: x86_64-pc-windows-msvc | |
- os: ubuntu-22.04 | |
target: x86_64-unknown-linux-musl | |
- os: macos-12 | |
target: x86_64-apple-darwin | |
- os: macos-12 | |
target: aarch64-apple-darwin | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install dependencies (Ubuntu) | |
if: matrix.os == 'ubuntu-22.04' | |
run: sudo apt-get update && sudo apt-get install -y libxdo-dev | |
- name: Setup Rust Toolchain | |
uses: actions-rust-lang/setup-rust-toolchain@v1 | |
- name: Install target | |
run: rustup target add ${{ matrix.target }} | |
if: contains(fromJSON('["x86_64-unknown-linux-musl", "aarch64-apple-darwin"]'), matrix.target) | |
- name: Install musl-tools | |
if: matrix.target == 'x86_64-unknown-linux-musl' | |
run: sudo apt-get update && sudo apt-get install musl-tools | |
- name: Build | |
run: cargo build --verbose --locked -F bin --release --target ${{ matrix.target }} | |
- name: Package | |
shell: bash | |
run: | | |
shopt -s extglob | |
staging="keep-active-${{ github.head_ref || github.ref_name }}-${{ matrix.target }}" | |
mkdir $staging | |
cp target/${{ matrix.target }}/release/keep-active@(|.exe) $staging/ | |
cp README.md CHANGELOG.md LICENSE $staging/ | |
tar zcf $staging.tar.gz $staging | |
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV | |
- uses: actions/upload-artifact@v3 | |
with: | |
name: release | |
path: ${{ env.ASSET }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
draft: true | |
files: ${{ env.ASSET }} |