Skip to content

chore: bump version to v1.6.1 #13

chore: bump version to v1.6.1

chore: bump version to v1.6.1 #13

Workflow file for this run

name: Build
on:
push:
tags:
- 'v*'
workflow_dispatch:
env:
CARGO_TERM_COLOR: always
jobs:
build:
name: Build ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
# Linux x64
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
cross: false
# Linux arm64
- target: aarch64-unknown-linux-gnu
os: ubuntu-latest
cross: true
# macOS x64
- target: x86_64-apple-darwin
os: macos-latest
cross: false
# macOS arm64
- target: aarch64-apple-darwin
os: macos-latest
cross: false
# Windows support is planned for a future milestone
# - target: x86_64-pc-windows-msvc
# os: windows-latest
# cross: false
#
# - target: aarch64-pc-windows-msvc
# os: windows-latest
# cross: false
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.cross
run: cargo install cross
- name: Build binary
run: |
if [ "${{ matrix.cross }}" = "true" ]; then
cross build --release --target ${{ matrix.target }}
else
cargo build --release --target ${{ matrix.target }}
fi
- name: Package binary
shell: bash
run: |
mkdir -p package/lib
cp target/${{ matrix.target }}/release/xvn package/
cp shell/xvn.sh package/lib/
cd package
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
tar czf xvn-${{ matrix.target }}.tar.gz xvn.exe lib/
else
tar czf xvn-${{ matrix.target }}.tar.gz xvn lib/
fi
shasum -a 256 xvn-${{ matrix.target }}.tar.gz > xvn-${{ matrix.target }}.tar.gz.sha256
mv xvn-${{ matrix.target }}.tar.gz* ../target/${{ matrix.target }}/release/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: xvn-${{ matrix.target }}
path: |
target/${{ matrix.target }}/release/xvn-${{ matrix.target }}.tar.gz
target/${{ matrix.target }}/release/xvn-${{ matrix.target }}.tar.gz.sha256
release:
name: Create GitHub Release
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Flatten artifacts
run: |
mkdir -p release-files
find artifacts -type f \( -name "*.tar.gz" -o -name "*.sha256" \) -exec mv {} release-files/ \;
- name: Create release
uses: softprops/action-gh-release@v1
with:
files: release-files/*
draft: false
prerelease: ${{ contains(github.ref, 'beta') || contains(github.ref, 'alpha') }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}