mirror of
https://github.com/Xevion/spotify-quickauth.git
synced 2025-12-10 06:08:42 -06:00
fail fast, add job names, add windows handling for .zip & .exe suffix
This commit is contained in:
23
.github/workflows/build.yaml
vendored
23
.github/workflows/build.yaml
vendored
@@ -26,6 +26,7 @@ env:
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
fail-fast: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||
matrix:
|
||||
include:
|
||||
- os: ubuntu-latest
|
||||
@@ -55,7 +56,7 @@ jobs:
|
||||
toolchain: stable
|
||||
targets: ${{ matrix.target }}
|
||||
- uses: Swatinem/rust-cache@v2
|
||||
|
||||
|
||||
- name: Install Linker
|
||||
if: matrix.linker
|
||||
run: |
|
||||
@@ -71,7 +72,8 @@ jobs:
|
||||
- name: Run tests
|
||||
run: cargo test --verbose
|
||||
|
||||
- run: echo "PACKAGE_VERSION=$(grep '^version = ' Cargo.toml | sed 's/version = \"\(.*\)\"/\1/')" >> $GITHUB_ENV
|
||||
- name: Export Package Version
|
||||
run: echo "PACKAGE_VERSION=$(grep '^version = ' Cargo.toml | sed 's/version = \"\(.*\)\"/\1/')" >> $GITHUB_ENV
|
||||
shell: sh
|
||||
|
||||
- name: Package Artifacts
|
||||
@@ -88,12 +90,19 @@ jobs:
|
||||
;;
|
||||
esac
|
||||
|
||||
cp target/${{ matrix.target }}/release/spotify-player-quickauth $stage/
|
||||
cd $stage
|
||||
|
||||
RELEASE_VERSION=v${{ env.PACKAGE_VERSION }}
|
||||
ARCHIVE="spotify-player-quickauth-$RELEASE_VERSION-${{ matrix.target }}.tar.gz"
|
||||
tar czf "$ARCHIVE" ./spotify-player-quickauth
|
||||
ARCHIVE="spotify-player-quickauth-$RELEASE_VERSION-${{ matrix.target }}"
|
||||
|
||||
if [[ "$RUNNER_OS" == "Windows" ]]; then
|
||||
ARCHIVE="$ARCHIVE.zip"
|
||||
cp target/${{ matrix.target }}/release/spotify-player-quickauth.exe ./
|
||||
zip -r "$ARCHIVE" ./spotify-player-quickauth.exe
|
||||
else
|
||||
ARCHIVE="$ARCHIVE.tar.gz"
|
||||
cp target/${{ matrix.target }}/release/spotify-player-quickauth.exe ./
|
||||
tar czf "$ARCHIVE" ./spotify-player-quickauth
|
||||
fi
|
||||
|
||||
echo "ARCHIVE_PATH=$(pwd)/$ARCHIVE" >> $GITHUB_ENV
|
||||
|
||||
- name: Release
|
||||
|
||||
Reference in New Issue
Block a user