Skip to content

bump up version to 0.2.1 #2

bump up version to 0.2.1

bump up version to 0.2.1 #2

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
permissions:
contents: write
jobs:
build:
strategy:
matrix:
job:
- target: x86_64-unknown-linux-gnu
os: linux
arch: amd64
runs-on: ubuntu-latest
- target: x86_64-apple-darwin
os: darwin
arch: amd64
runs-on: macos-latest
- target: x86_64-pc-windows-msvc
os: windows
arch: amd64
runs-on: windows-latest
- target: aarch64-unknown-linux-gnu
os: linux
arch: arm64
runs-on: ubuntu-latest
- target: aarch64-apple-darwin
os: darwin
arch: arm64
runs-on: macos-latest
runs-on: ${{ matrix.job.runs-on }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build
shell: bash
run: |
if [[ "${{ matrix.job.target }}" == aarch64-* ]]; then
rustup target add "${{ matrix.job.target }}"
if [[ "${{ matrix.job.os }}" == linux ]]; then
sudo apt-get install gcc-aarch64-linux-gnu
export RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc"
fi
fi
cargo build --release --target=${{ matrix.job.target }}
- name: Test
run: cargo test
- name: Run
run: cargo run
- name: Set the asset name
id: asset
shell: bash
run: echo "name=${{ github.event.repository.name }}_${{ github.ref_name }}_${{ matrix.job.os }}_${{ matrix.job.arch }}" >> "$GITHUB_OUTPUT"
- name: Build artifact
shell: bash
run: |
mkdir "${{ steps.asset.outputs.name }}"
cp README.md LICENSE "${{ steps.asset.outputs.name }}"
mv "target/${{ matrix.job.target }}/release/${{ github.event.repository.name }}" "${{ steps.asset.outputs.name }}"
if [[ "${{ matrix.job.os }}" == windows ]]; then
powershell Compress-Archive -Path "${{ steps.asset.outputs.name }}" -DestinationPath "${{ steps.asset.outputs.name }}.zip"
else
zip -r "${{ steps.asset.outputs.name }}.zip" "${{ steps.asset.outputs.name }}"
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ steps.asset.outputs.name }}
path: ${{ steps.asset.outputs.name }}.zip
release:
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3
- name: Create release
uses: ncipollo/release-action@v1
with:
name: Release ${{ github.ref_name }}
artifacts: '*/*.zip'