diff --git a/.github/workflows/build-latest.yml b/.github/workflows/build-latest.yml deleted file mode 100644 index b45e6b8..0000000 --- a/.github/workflows/build-latest.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: Build latest - -on: - push: - branches: - - master - pull_request: - branches: - - master - -env: - CARGO_TERM_COLOR: always - -jobs: - - 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: - tag_name: latest - release_name: Latest Build - - build: - runs-on: ${{ matrix.platform }} - needs: create_release - strategy: - fail-fast: false - matrix: - platform: [macos-latest, ubuntu-latest, windows-latest] - include: - - platform: macos-latest - target: macos-x86_64 - - platform: ubuntu-latest - target: linux-x86_64 - - platform: windows-latest - target: windows-x86_64 - # platform: [ubuntu-latest] - steps: - - uses: actions/checkout@v3 - - 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: | - sudo apt-get update - sudo apt-get install -y libasound2-dev gcc alsa - - name: Build - run: | - cargo build --verbose --release - - if: matrix.platform == 'windows-latest' - name: Rename binary - run: | - 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 }} - - name: Upload - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: target/release/spotify-dl.${{ matrix.target }} - asset_name: spotify-dl.${{ matrix.target }} - asset_content_type: application/octet-stream diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml new file mode 100644 index 0000000..626ab01 --- /dev/null +++ b/.github/workflows/linux.yml @@ -0,0 +1,49 @@ +name: Build latest - Linux + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + CARGO_TERM_COLOR: always + +permissions: + contents: write + +jobs: + + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable + - name: Setup alsa + run: | + sudo apt-get update + sudo apt-get install -y libasound2-dev gcc alsa + - name: Build + run: | + cargo build --verbose --release + - name: Rename binary + run: | + mv target/release/spotify-dl target/release/spotify-dl.linux-x86_64 + - name: Upload Linux Artifact + uses: ncipollo/release-action@v1 + with: + allowUpdates: True + makeLatest: True + omitBody: True + omitBodyDuringUpdate: True + omitNameDuringUpdate: True + artifacts: target/release/spotify-dl.linux-x86_64 + token: ${{ secrets.GITHUB_TOKEN }} + diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml new file mode 100644 index 0000000..14f774d --- /dev/null +++ b/.github/workflows/macos.yml @@ -0,0 +1,44 @@ +name: Build latest - MacOS + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + CARGO_TERM_COLOR: always + +permissions: + contents: write + +jobs: + + build: + runs-on: macos-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable + - name: Build + run: | + cargo build --verbose --release + - name: Rename binary + run: | + mv target/release/spotify-dl target/release/spotify-dl.macos-x86_64 + - name: Upload MacOS Artifact + uses: ncipollo/release-action@v1 + with: + allowUpdates: True + makeLatest: True + omitBody: True + omitBodyDuringUpdate: True + omitNameDuringUpdate: True + artifacts: target/release/spotify-dl.macos-x86_64 + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 0000000..5e9fb2a --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,44 @@ +name: Build latest - Windows + +on: + push: + branches: + - master + pull_request: + branches: + - master + +env: + CARGO_TERM_COLOR: always + +permissions: + contents: write + +jobs: + + build: + runs-on: windows-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v3 + - name: Setup cmake + uses: jwlawson/actions-setup-cmake@v1.13 + - name: install Rust stable + uses: dtolnay/rust-toolchain@stable + - name: Build + run: | + cargo build --verbose --release + - name: Rename binary + run: | + mv target/release/spotify-dl.exe target/release/spotify-dl.windows-x86_64 + - name: Upload Windows Artifact + uses: ncipollo/release-action@v1 + with: + allowUpdates: True + makeLatest: True + omitBody: True + omitBodyDuringUpdate: True + omitNameDuringUpdate: True + artifacts: target/release/spotify-dl.windows-x86_64 + token: ${{ secrets.GITHUB_TOKEN }}