fail fast, add job names, add windows handling for .zip & .exe suffix

This commit is contained in:
2024-10-03 02:59:30 -05:00
parent 09694717fc
commit 068844ed27

View File

@@ -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