mirror of
https://github.com/Xevion/spotify-quickauth.git
synced 2025-12-09 22:08:38 -06:00
104 lines
2.9 KiB
YAML
104 lines
2.9 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
paths-ignore:
|
|
- README.md
|
|
- .gitignore
|
|
- LICENSE
|
|
- run.sh
|
|
pull_request:
|
|
paths-ignore:
|
|
- README.md
|
|
- .gitignore
|
|
- LICENSE
|
|
- run.sh
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- os: ubuntu-latest
|
|
target: x86_64-unknown-linux-musl
|
|
- os: ubuntu-latest
|
|
target: aarch64-unknown-linux-musl
|
|
linker: gcc-aarch64-linux-gnu
|
|
- os: ubuntu-latest
|
|
target: armv7-unknown-linux-gnueabihf
|
|
linker: gcc-arm-linux-gnueabihf
|
|
- os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
- os: macos-latest
|
|
target: aarch64-apple-darwin
|
|
# - os: windows-latest
|
|
# target: x86_64-pc-windows-msvc
|
|
# - os: windows-latest
|
|
# target: i686-pc-windows-msvc
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
toolchain: stable
|
|
targets: ${{ matrix.target }}
|
|
- uses: Swatinem/rust-cache@v2
|
|
|
|
- name: Install Linker
|
|
if: matrix.linker
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install ${{ matrix.linker }}
|
|
cat .cargo/config.github.toml >> .cargo/config.toml
|
|
|
|
- name: Build
|
|
run: cargo build --verbose --release --target ${{ matrix.target }}
|
|
|
|
- name: Run tests
|
|
run: cargo test --verbose
|
|
|
|
- uses: cargo-bins/cargo-binstall@main
|
|
|
|
- run: cargo binstall toml-cli -y && echo "PACKAGE_VERSION=$(toml get ./Cargo.toml package.version --raw)" >> $GITHUB_ENV
|
|
|
|
- name: Package Artifacts
|
|
shell: bash
|
|
run: |
|
|
src=$(pwd)
|
|
stage=
|
|
case $RUNNER_OS in
|
|
Linux)
|
|
stage=$(mktemp -d)
|
|
;;
|
|
macOS)
|
|
stage=$(mktemp -d -t tmp)
|
|
;;
|
|
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
|
|
echo "ASSET_PATH=$ASSET_PATH" >> $GITHUB_ENV
|
|
|
|
- name: Release
|
|
uses: softprops/action-gh-release@v2
|
|
if: startsWith(github.ref, 'refs/tags/')
|
|
with:
|
|
files: ${{ env.ASSET_PATH }}
|
|
generate_release_notes: true
|
|
fail_on_unmatched_files: true
|
|
|
|
# Publish flow
|
|
# - name: cargo login
|
|
# run: cargo login ${{ secrets.CRATES_IO_API_TOKEN }}
|
|
|
|
# - name: "cargo release publish"
|
|
# run: cargo release publish --workspace --all-features --allow-branch HEAD --no-confirm --no-verify --execute |