build: migrate to clap v4 #20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Origin config by @Kilerd | |
name: Build Release | |
on: | |
push: | |
branches: [ master ] | |
jobs: | |
release: | |
name: Pre-Release on ${{ matrix.platform }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
platform: [macos-x86_64, linux_glibc-x86_64, linux_musl-x86_64] | |
include: | |
- platform: macos-x86_64 | |
target: x86_64-apple-darwin | |
os: macos-latest | |
bin: fibonacci | |
- platform: linux_glibc-x86_64 | |
target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
bin: fibonacci | |
- platform: linux_musl-x86_64 | |
target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
bin: fibonacci | |
steps: | |
- name: Install toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
target: ${{ matrix.target }} | |
toolchain: stable | |
override: true | |
- name: Checkout code | |
uses: actions/checkout@v1 | |
- name: some tricks for featrues | |
run: export RUSTC_BOOTSTRAP=1 | |
- name: Run code build | |
uses: actions-rs/cargo@v1 | |
with: | |
toolchain: stable | |
command: build | |
args: --release --target ${{ matrix.target }} | |
- name: Prepare assets | |
shell: bash | |
run: | | |
mv target/${{ matrix.target }}/release/${{ matrix.bin }} . | |
tar -cvf ${{ matrix.target }}.tar LICENSE ${{ matrix.bin }} | |
- name: Release | |
uses: softprops/action-gh-release@v1 | |
with: | |
files: ${{ matrix.target }}.tar | |
tag_name: v0.4.1 | |
prerelease: true | |