spotify-dl/.github/workflows/rust.yml

57 lines
1.5 KiB
YAML
Raw Normal View History

2022-06-08 17:04:48 +02:00
name: Rust
on:
push:
branches: [ "master" ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
2023-02-10 13:24:03 +01:00
runs-on: ${{ matrix.platform }}
2022-06-08 17:04:48 +02:00
2023-02-10 13:24:03 +01:00
strategy:
fail-fast: false
matrix:
platform: [macos-latest, ubuntu-latest, windows-latest]
include:
- platform: macos-latest
2023-02-10 15:09:30 +01:00
target: macos-x86_64
2023-02-10 13:24:03 +01:00
- platform: ubuntu-latest
2023-02-10 15:09:30 +01:00
target: linux-x86_64
2023-02-10 13:24:03 +01:00
- platform: windows-latest
2023-02-10 15:09:30 +01:00
target: windows-x86_64
2023-02-10 13:24:03 +01:00
# platform: [ubuntu-latest]
2022-06-08 17:04:48 +02:00
steps:
- uses: actions/checkout@v3
2023-02-10 13:24:03 +01:00
- name: Setup cmake
uses: jwlawson/actions-setup-cmake@v1.13
- name: install Rust stable
uses: dtolnay/rust-toolchain@stable
- if: matrix.platform == 'ubuntu-latest'
run: |
2023-02-10 15:09:30 +01:00
sudo apt-get update
sudo apt-get install -y libasound2-dev gcc alsa
2022-06-08 17:04:48 +02:00
- name: Build
2023-02-10 13:24:03 +01:00
run: |
cargo build --verbose --release
2023-02-10 17:46:04 +01:00
- if: matrix.platform == 'windows-latest'
name: Rename binary
2023-02-10 13:24:03 +01:00
run: |
2023-02-10 17:46:04 +01:00
mv target/release/spotify-dl.exe target/release/spotify-dl.${{ matrix.target }}
- if: matrix.platform != 'windows-latest'
name: Rename binary
run: |
mv target/release/spotify-dl target/release/spotify-dl.${{ matrix.target }}
2022-06-08 17:04:48 +02:00
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest"
prerelease: true
title: "Latest Build"
files: |
LICENSE
2023-02-10 13:24:03 +01:00
target/release/spotify-dl*