Skip to content

v0.2.9

v0.2.9 #30

Workflow file for this run

name: Release
on:
release:
types: [published]
env:
CARGO_TERM_COLOR: always
jobs:
set-env:
runs-on: ubuntu-24.04
outputs:
name: ${{steps.vars.outputs.name}}
version: ${{steps.vars.outputs.version}}
steps:
- uses: actions/checkout@v4
- id: vars
run: |
set -e -o pipefail
echo "NAME=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].name')" >> "$GITHUB_OUTPUT"
echo "VERSION=$(cargo metadata --no-deps --format-version 1 | jq -r '.packages[].version')" >> "$GITHUB_OUTPUT"
build-linux-x86_64:
needs: set-env
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Rustfmt Check
run: cargo fmt --check
- name: Add x86_64-unknown-linux-musl target
run: |
rustup target add x86_64-unknown-linux-musl
sudo apt-get -y update
sudo apt-get -y install musl-dev musl-tools
- name: Build
run: cargo build --target=x86_64-unknown-linux-musl --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Compress
run: >
cat "target/x86_64-unknown-linux-musl/release/${{needs.set-env.outputs.name}}"
| bzip2 -9 -c > ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-linux-x86_64.bz2
- name: Upload
uses: diamondburned/[email protected]
with:
files: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-linux-x86_64.bz2
build-linux-arm64:
needs: set-env
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4
- name: Install cross
run: cargo install cross
- name: Build
run: cross build --target aarch64-unknown-linux-musl --release --verbose
- name: Compress
run: >
cat "target/aarch64-unknown-linux-musl/release/${{needs.set-env.outputs.name}}"
| bzip2 -9 -c > ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-linux-arm64.bz2
- name: Upload
uses: diamondburned/[email protected]
with:
files: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-linux-arm64.bz2
build-darwin-x86_64:
needs: set-env
runs-on: macos-13
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release --verbose
- name: Compress
run: >
cat "target/release/${{needs.set-env.outputs.name}}"
| bzip2 -9 -c > ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-darwin-x86_64.bz2
- name: Upload
uses: diamondburned/[email protected]
with:
files: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-darwin-x86_64.bz2
build-darwin-arm64:
needs: set-env
runs-on: macos-14
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release --verbose
- name: Compress
run: >
cat "target/release/${{needs.set-env.outputs.name}}"
| bzip2 -9 -c > ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-darwin-arm64.bz2
- name: Upload
uses: diamondburned/[email protected]
with:
files: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-darwin-arm64.bz2
build-windows-x86_64:
needs: set-env
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Build
run: cargo build --release --verbose
- name: Run tests
run: cargo test --verbose
- name: Compress
run: >
Compress-Archive
target/release/${{needs.set-env.outputs.name}}.exe
${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-windows-x86_64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-x86_64-release
path: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-windows-x86_64.zip
upload-windows-x86_64:
needs: [set-env, build-windows-x86_64]
runs-on: ubuntu-24.04
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: windows-x86_64-release
- name: Upload
uses: diamondburned/[email protected]
with:
files: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-windows-x86_64.zip
build-windows-arm64:
needs: set-env
runs-on: windows-2022
steps:
- uses: actions/checkout@v4
- name: Add aarch64-pc-windows-msvc target
run: |
rustup target add aarch64-pc-windows-msvc
- name: Build
run: cargo build --release --target=aarch64-pc-windows-msvc --verbose
- name: Compress
run: >
Compress-Archive
target/aarch64-pc-windows-msvc/release/${{needs.set-env.outputs.name}}.exe
${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-windows-arm64.zip
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: windows-arm64-release
path: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-windows-arm64.zip
upload-windows-arm64:
needs: [set-env, build-windows-arm64]
runs-on: ubuntu-24.04
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: windows-arm64-release
- name: Upload
uses: diamondburned/[email protected]
with:
files: ${{needs.set-env.outputs.name}}-${{needs.set-env.outputs.version}}-windows-arm64.zip