Skip to content

Bump to v1.0.5

Bump to v1.0.5 #33

Workflow file for this run

name: Rust CI & Release
on:
push:
branches: [ "main" ]
tags:
- 'v*'
pull_request:
branches: [ "main" ]
permissions:
contents: write
env:
CARGO_TERM_COLOR: always
jobs:
test_and_build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- name: Install latest stable Rust
uses: dtolnay/rust-toolchain@stable
- name: Build (Release mode)
run: cargo build --verbose --release
- name: Run tests
run: cargo test --verbose
release_build:
name: Build & Release for ${{ matrix.os }}
if: startsWith(github.ref, 'refs/tags/v')
needs: [test_and_build]
runs-on: ${{ matrix.runner }}
strategy:
matrix:
include:
# Linux
- os: linux
runner: ubuntu-latest
target: x86_64-unknown-linux-gnu
bin_suffix: ""
asset_name: linux-x64
# Windows
- os: windows
runner: windows-latest
target: x86_64-pc-windows-msvc
bin_suffix: ".exe"
asset_name: windows-x64
steps:
- uses: actions/checkout@v5
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build
run: cargo build --release --locked --target ${{ matrix.target }}
- name: Set Binary Path and Name
id: vars
shell: bash
run: |
BIN_NAME="lsb_hide"
echo "bin_path=target/${{ matrix.target }}/release/${BIN_NAME}${{ matrix.bin_suffix }}" >> $GITHUB_OUTPUT
echo "asset_name=${BIN_NAME}-${{ github.ref_name }}-${{ matrix.asset_name }}" >> $GITHUB_OUTPUT
- name: Compress Binary (Linux)
if: matrix.os == 'linux'
run: |
mkdir staging
cp ${{ steps.vars.outputs.bin_path }} staging/
tar -c -C staging . | zstd -19 -o ${{ steps.vars.outputs.asset_name }}.tar.zst
echo "archive_path=${{ steps.vars.outputs.asset_name }}.tar.zst" >> $GITHUB_ENV
- name: Compress Binary (Windows)
if: matrix.os == 'windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Path staging
Copy-Item "${{ steps.vars.outputs.bin_path }}" staging/
Compress-Archive -Path staging/* -DestinationPath "${{ steps.vars.outputs.asset_name }}.zip"
echo "archive_path=${{ steps.vars.outputs.asset_name }}.zip" >> $env:GITHUB_ENV
- name: Upload Release Asset
uses: softprops/action-gh-release@v2
with:
files: ${{ env.archive_path }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}