Skip to content

v0.5.0

v0.5.0 #13

Workflow file for this run

name: release
on:
release:
types: [published]
env:
RUST_VERSION: "1.89.0"
jobs:
release:
runs-on: ${{ matrix.os }}
permissions:
contents: write
env:
ASSET: ""
CARGO: cargo
strategy:
matrix:
build:
- freebsd-x86_64
- linux-arm64-gnu
- linux-arm64-musl
- linux-x86_64-gnu
- linux-x86_64-musl
- macos-arm64
- macos-x86_64
- windows-x86_64-msvc
include:
- build: freebsd-x86_64
os: ubuntu-latest
target: x86_64-unknown-freebsd
- build: linux-arm64-gnu
os: ubuntu-latest
target: aarch64-unknown-linux-gnu
- build: linux-arm64-musl
os: ubuntu-latest
target: aarch64-unknown-linux-musl
- build: linux-x86_64-gnu
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- build: linux-x86_64-musl
os: ubuntu-latest
target: x86_64-unknown-linux-musl
- build: macos-x86_64
os: macos-latest
target: x86_64-apple-darwin
- build: macos-arm64
os: macos-latest
target: aarch64-apple-darwin
- build: windows-x86_64-msvc
os: windows-latest
target: x86_64-pc-windows-msvc
steps:
- uses: actions/checkout@v3
- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ env.RUST_VERSION }}
target: ${{ matrix.target }}
- name: Install cross
if: ${{ matrix.os == 'ubuntu-latest' }}
run: |
cargo install cross
echo CARGO=cross >> $GITHUB_ENV
- name: Rust cargo build
run: ${{ env.CARGO }} build --release --locked --target ${{ matrix.target }}
- name: Build archive
if: ${{ matrix.os != 'windows-latest' }}
shell: bash
run: |
staging="precompress-${{ github.ref_name }}-${{ matrix.target }}"
cp "target/${{ matrix.target }}/release/precompress" precompress
tar czf "$staging.tar.gz" precompress
echo "ASSET=$staging.tar.gz" >> $GITHUB_ENV
- name: Build archive
if: ${{ matrix.os == 'windows-latest' }}
shell: bash
run: |
staging="precompress-${{ github.ref_name }}-${{ matrix.target }}"
cp "target/${{ matrix.target }}/release/precompress.exe" precompress.exe
7z a "$staging.zip" precompress.exe
echo "ASSET=$staging.zip" >> $GITHUB_ENV
- name: Upload release archive
env:
GH_TOKEN: ${{ github.token }}
run: gh release upload ${{ github.ref_name }} ${{ env.ASSET }}