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

73 lines
2 KiB
YAML
Raw Normal View History

name: Release
2022-06-08 17:04:48 +02:00
on:
push:
tags:
- "v*"
2022-06-08 17:04:48 +02:00
env:
CARGO_TERM_COLOR: always
jobs:
2023-02-10 18:02:09 +01:00
create_release:
name: Create release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Create release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
2023-02-10 18:06:10 +01:00
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
2023-02-10 18:02:09 +01:00
build:
2023-02-10 13:24:03 +01:00
runs-on: ${{ matrix.platform }}
2023-02-10 18:08:17 +01:00
needs: create_release
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 }}
2023-02-10 18:02:09 +01:00
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2022-06-08 17:04:48 +02:00
with:
2023-02-10 18:02:09 +01:00
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: target/release/spotify-dl.${{ matrix.target }}
asset_name: spotify-dl.${{ matrix.target }}
2024-01-17 16:37:51 +01:00
asset_content_type: application/octet-stream