mirror of
https://github.com/Xevion/spotify-quickauth.git
synced 2025-12-11 02:08:48 -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:
|
jobs:
|
||||||
build:
|
build:
|
||||||
strategy:
|
strategy:
|
||||||
|
fail-fast: ${{ startsWith(github.ref, 'refs/tags/') }}
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- os: ubuntu-latest
|
- os: ubuntu-latest
|
||||||
@@ -55,7 +56,7 @@ jobs:
|
|||||||
toolchain: stable
|
toolchain: stable
|
||||||
targets: ${{ matrix.target }}
|
targets: ${{ matrix.target }}
|
||||||
- uses: Swatinem/rust-cache@v2
|
- uses: Swatinem/rust-cache@v2
|
||||||
|
|
||||||
- name: Install Linker
|
- name: Install Linker
|
||||||
if: matrix.linker
|
if: matrix.linker
|
||||||
run: |
|
run: |
|
||||||
@@ -71,7 +72,8 @@ jobs:
|
|||||||
- name: Run tests
|
- name: Run tests
|
||||||
run: cargo test --verbose
|
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
|
shell: sh
|
||||||
|
|
||||||
- name: Package Artifacts
|
- name: Package Artifacts
|
||||||
@@ -88,12 +90,19 @@ jobs:
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
cp target/${{ matrix.target }}/release/spotify-player-quickauth $stage/
|
|
||||||
cd $stage
|
|
||||||
|
|
||||||
RELEASE_VERSION=v${{ env.PACKAGE_VERSION }}
|
RELEASE_VERSION=v${{ env.PACKAGE_VERSION }}
|
||||||
ARCHIVE="spotify-player-quickauth-$RELEASE_VERSION-${{ matrix.target }}.tar.gz"
|
ARCHIVE="spotify-player-quickauth-$RELEASE_VERSION-${{ matrix.target }}"
|
||||||
tar czf "$ARCHIVE" ./spotify-player-quickauth
|
|
||||||
|
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
|
echo "ARCHIVE_PATH=$(pwd)/$ARCHIVE" >> $GITHUB_ENV
|
||||||
|
|
||||||
- name: Release
|
- name: Release
|
||||||
|
|||||||
Reference in New Issue
Block a user