Bumps the github-actions group with 1 update: [actions/checkout](https://github.com/actions/checkout). Updates `actions/checkout` from 4 to 5 - [Release notes](https://github.com/actions/checkout/releases) - [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md) - [Commits](https://github.com/actions/checkout/compare/v4...v5) --- updated-dependencies: - dependency-name: actions/checkout dependency-version: '5' dependency-type: direct:production update-type: version-update:semver-major dependency-group: github-actions ... Signed-off-by: dependabot[bot] <support@github.com>
96 lines
3.6 KiB
YAML
96 lines
3.6 KiB
YAML
name: CD
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- "v*.*.*"
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
TERM: xterm
|
|
|
|
jobs:
|
|
publish:
|
|
name: Publishing ${{ matrix.build_target }}
|
|
runs-on: ${{ matrix.os }}
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- build_target: linux-x86_64
|
|
os: ubuntu-latest
|
|
target: x86_64-unknown-linux-gnu
|
|
features: ''
|
|
dependencies: 'libpulse-dev libdbus-1-dev libncursesw5-dev libxcb-shape0-dev libxcb-xfixes0-dev'
|
|
- build_target: linux-arm64
|
|
os: ubuntu-24.04-arm
|
|
target: aarch64-unknown-linux-gnu
|
|
features: ''
|
|
dependencies: 'libpulse-dev libdbus-1-dev libncursesw5-dev libxcb-shape0-dev libxcb-xfixes0-dev'
|
|
- build_target: macos-x86_64
|
|
os: macos-latest
|
|
target: x86_64-apple-darwin
|
|
features: '--no-default-features --features rodio_backend,pancurses_backend'
|
|
- build_target: macos-aarch64
|
|
os: macos-14
|
|
target: aarch64-apple-darwin
|
|
artifact_suffix: macos-aarch64
|
|
features: '--no-default-features --features rodio_backend,cursive/pancurses-backend'
|
|
- build_target: windows-x86_64
|
|
os: windows-latest
|
|
target: x86_64-pc-windows-msvc
|
|
features: '--no-default-features --features rodio_backend,pancurses_backend,share_clipboard,notify'
|
|
steps:
|
|
- uses: actions/checkout@v5
|
|
name: Checkout src
|
|
- name: Install rustup
|
|
if: runner.os != 'Windows'
|
|
shell: bash
|
|
run: |
|
|
if ! command -v rustup &>/dev/null; then
|
|
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
|
echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
|
|
fi
|
|
- name: Add cross-compilation target
|
|
run: rustup target add ${{ matrix.target }}
|
|
- name: Install macOS dependencies
|
|
if: matrix.os == 'macos-latest'
|
|
run: brew install portaudio pkg-config
|
|
- name: Install Linux dependencies
|
|
if: runner.os == 'Linux'
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y ${{ matrix.dependencies }}
|
|
- uses: actions/cache@v4
|
|
with:
|
|
path: |
|
|
~/.cargo/registry/index/
|
|
~/.cargo/registry/
|
|
~/.cargo/git/db/
|
|
key: ${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
- name: Running cargo build
|
|
run: cargo build --release --target ${{ matrix.target }} ${{ matrix.features }}
|
|
- name: Extract git tag
|
|
shell: bash
|
|
run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
|
|
id: extract_tag
|
|
- name: Packaging assets
|
|
shell: bash
|
|
run: |
|
|
cd target/${{ matrix.target }}/release
|
|
case ${{ matrix.target }} in
|
|
*-pc-windows-*)
|
|
7z -y a ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.zip ncspot.exe
|
|
sha256sum ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.zip > ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.sha256
|
|
;;
|
|
*)
|
|
tar czvf ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.tar.gz ncspot
|
|
shasum -a 256 ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.tar.gz > ncspot-${{ steps.extract_tag.outputs.tag }}-${{ matrix.build_target }}.sha256
|
|
;;
|
|
esac;
|
|
- name: Releasing assets
|
|
uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: target/${{ matrix.target }}/release/ncspot-*
|
|
env:
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|