add config for different shell #13
Workflow file for this run
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
name: Release | |
on: | |
push: | |
tags: | |
- 'v*' | |
jobs: | |
build-upload: | |
name: release ${{ matrix.target }} | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: write | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
cross: true | |
- target: aarch64-unknown-linux-musl | |
os: ubuntu-latest | |
cross: true | |
- target: x86_64-unknown-linux-gnu | |
os: ubuntu-latest | |
cross: true | |
- target: aarch64-unknown-linux-gnu | |
os: ubuntu-latest | |
cross: true | |
- target: x86_64-apple-darwin | |
os: macos-latest | |
cross: false | |
- target: aarch64-apple-darwin | |
os: macos-latest | |
cross: false | |
- target: x86_64-pc-windows-msvc | |
os: windows-latest | |
cross: false | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
target: ${{ matrix.target }} | |
- name: Run Cross | |
if: ${{ matrix.cross }} | |
run: | | |
cargo install cross --git https://github.com/cross-rs/cross.git | |
cross build --release --target ${{ matrix.target }} | |
- name: Run Cargo | |
if: ${{ !matrix.cross }} | |
run: cargo build --release --target ${{ matrix.target }} | |
- name: create artifact directory | |
shell: bash | |
run: | | |
directory=gpm-${{ matrix.target }} | |
mkdir $directory | |
cp README.md LICENSE $directory | |
if [ -f target/${{ matrix.target }}/release/gpm.exe ]; then | |
cp target/${{ matrix.target }}/release/gpm.exe $directory | |
else | |
cp target/${{ matrix.target }}/release/gpm $directory | |
fi | |
7z a -r $directory.zip $directory | |
- uses: ncipollo/[email protected] | |
with: | |
artifacts: "gpm-${{ matrix.target }}.zip" | |
allowUpdates: true | |
omitNameDuringUpdate: true | |
omitBodyDuringUpdate: true |