Skip to content

new: changed version to 0.29.0 (#244) #177

new: changed version to 0.29.0 (#244)

new: changed version to 0.29.0 (#244) #177

Workflow file for this run

name: Publish
on:
push:
tags:
- 'v*.*.*'
jobs:
publish:
name: Publish for ${{ matrix.name }}
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
strategy:
matrix:
name:
- linux-x86-gnu
- linux-x86-musl
- linux-arm-gnu
- linux-arm-musl
- macos-x86
- macos-arm
- macos-universal
- windows-x86
include:
- name: linux-x86-gnu
os: ubuntu-latest
family: linux
arch: x86_64
target: x86_64-unknown-linux-gnu
archiver: tar.gz
asset: hl-linux-x86_64-gnu.tar.gz
- name: linux-x86-musl
os: ubuntu-latest
family: linux
arch: x86_64
target: x86_64-unknown-linux-musl
archiver: tar.gz
asset: hl-linux-x86_64-musl.tar.gz
cross: true
- name: linux-arm-gnu
os: ubuntu-latest
family: linux
arch: aarch64
target: aarch64-unknown-linux-gnu
archiver: tar.gz
asset: hl-linux-arm64-gnu.tar.gz
cross: true
- name: linux-arm-musl
os: ubuntu-latest
family: linux
arch: aarch64
target: aarch64-unknown-linux-musl
archiver: tar.gz
asset: hl-linux-arm64-musl.tar.gz
cross: true
- name: macos-x86
os: macos-latest
family: macos
arch: x86_64
target: x86_64-apple-darwin
archiver: tar.gz
asset: hl-macos-x86_64.tar.gz
- name: macos-arm
os: macos-latest
family: macos
arch: aarch64
target: aarch64-apple-darwin
archiver: tar.gz
asset: hl-macos-arm64.tar.gz
- name: macos-universal
os: macos-latest
family: macos
arch: '{aarch64,x86_64}'
target: '{aarch64,x86_64}-apple-darwin'
archiver: tar.gz
asset: hl-macos.tar.gz
universal: true
- name: windows-x86
os: windows-latest
family: windows
arch: x86_64
target: x86_64-pc-windows-msvc
archiver: 7z
asset: hl-windows.zip
steps:
- uses: actions/checkout@v4
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
toolchain: stable
rustflags: ''
- name: Install Cross
if: matrix.cross
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
- name: Add Target
if: matrix.cross == false && matrix.target != ''
run: |
rustup target add ${{ matrix.target }}
- name: Build
run: echo ${{ matrix.target }} | xargs -n 1 ${{ env.CARGO }} build --release --locked --verbose --target
- name: Sign
if: matrix.family == 'macos'
run: codesign --force --deep --sign - ./target/${{ matrix.target }}/release/hl
- name: Package using `tar`
if: matrix.archiver == 'tar.gz' && matrix.universal == false
run: tar -C ./target/${{ matrix.target }}/release -cz -f ${{ matrix.asset }} hl
- name: Package using `7z`
if: matrix.archiver == '7z' && matrix.universal == false
run: 7z a ${{ matrix.asset }} .\target\${{ matrix.target }}\release\hl.exe
- name: Make universal binary
if: matrix.family == 'macos' && matrix.universal == true
run: lipo ./target/${{ matrix.target }}/release/hl -create -output ./target/hl
- name: Package universal binary using `tar`
if: matrix.archiver == 'tar.gz' && matrix.universal == true
run: tar -C ./target -cz -f ${{ matrix.asset }} hl
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ${{ matrix.asset }}
tag: ${{ github.ref }}