Multiple chats #55
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
permissions: | |
actions: read | |
checks: read | |
contents: write | |
deployments: read | |
id-token: write | |
issues: write | |
packages: read | |
pages: read | |
pull-requests: write | |
repository-projects: read | |
on: | |
pull_request: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.ref }} | |
cancel-in-progress: true | |
env: | |
GH_TOKEN: ${{ github.token }} | |
jobs: | |
clippy: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
components: clippy | |
# https://github.com/Spotifyd/spotifyd/issues/659#issuecomment-737730954 | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: librust-alsa-sys-dev | |
version: 1.0 | |
- run: cargo clippy | |
unit-test: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: librust-alsa-sys-dev | |
version: 1.0 | |
- run: cargo test | |
smoke-test-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: librust-alsa-sys-dev | |
version: 1.0 | |
- uses: actions/cache@v4 | |
with: | |
path: $HOME/.cache/ort.pyke.io # <- onnxruntime libs are placed here by ort | |
key: ${{ runner.os }}-ort.pyke.io | |
- run: cargo run --release -- 'Create a LoFi song' --secs 1 --model small-quant --no-interactive --no-playback | |
smoke-test-mac: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: actions/cache@v4 | |
with: | |
path: $HOME/Library/Caches/ort.pyke.io # <- onnxruntime libs are placed here by ort | |
key: ${{ runner.os }}-ort.pyke.io | |
- run: cargo run --release -- 'Create a LoFi song' --secs 1 --model small-quant --no-interactive --no-playback | |
smoke-test-windows: | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
# - uses: actions/cache@v4 | |
# with: | |
# path: TODO: Where are pyke files located | |
# key: ${{ runner.os }}-ort.pyke.io | |
- run: cargo run --release -- 'Create a LoFi song' --secs 1 --model small-quant --no-interactive --no-playback | |
tag: | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
needs: | |
- unit-test | |
- clippy | |
- smoke-test-linux | |
- smoke-test-mac | |
- smoke-test-windows | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: '0' # https://github.com/actions/checkout/issues/217 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo install cargo-release | |
- name: Bump versions | |
run: | | |
SEM_VER=$(.github/semver.sh) | |
cargo release version $SEM_VER -x --no-confirm | |
- name: Tag | |
id: tag | |
run: | | |
version=`grep '^version = ' Cargo.toml | sed 's/version = //; s/\"//; s/\"//'` | |
git config user.name github-actions | |
git config user.email [email protected] | |
git add . | |
git commit -m "ci: v$version" | |
git tag "v$version" | |
git push | |
git push --tags | |
echo "version=$version" >> "$GITHUB_OUTPUT" | |
- run: gh release create "v${{ steps.tag.outputs.version }}" | |
outputs: | |
version: ${{ steps.tag.outputs.version }} | |
cargo-release: | |
needs: tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: librust-alsa-sys-dev | |
version: 1.0 | |
- run: cargo publish | |
env: | |
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} | |
homebrew-release: | |
needs: tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
repository: gabotechs/homebrew-taps | |
token: ${{ secrets.CI_TOKEN }} | |
- uses: actions/checkout@v4 | |
with: | |
path: repo | |
- run: sed "s/<version>/${{ needs.tag.outputs.version }}/g" repo/.github/musicgpt.rb > musicgpt.rb | |
- run: | | |
git add musicgpt.rb | |
git config user.name github-actions | |
git config user.email [email protected] | |
git commit -m "Brew formula update for musicgpt version v${{ needs.tag.outputs.version }}" | |
git push | |
upload-x86_64-unknown-linux-gnu: | |
needs: tag | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: librust-alsa-sys-dev | |
version: 1.0 | |
- run: cargo build --release --features cuda | |
- run: ./.github/bundle-release.sh x86_64-unknown-linux-gnu | |
- run: gh release upload v${{ needs.tag.outputs.version }} x86_64-unknown-linux-gnu.tar.gz | |
upload-aarch64-apple-darwin: | |
needs: tag | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
- run: cargo build --release | |
- run: ./.github/bundle-release.sh aarch64-apple-darwin | |
- run: gh release upload v${{ needs.tag.outputs.version }} aarch64-apple-darwin.tar.gz | |
upload-x86_64-apple-darwin: | |
needs: tag | |
runs-on: macos-latest # <- this is an M1. | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
# Cross compile on a M1 for Intel processors. | |
targets: x86_64-apple-darwin | |
- run: cargo build --release --target x86_64-apple-darwin | |
- run: ./.github/bundle-release.sh x86_64-apple-darwin | |
- run: gh release upload v${{ needs.tag.outputs.version }} x86_64-apple-darwin.tar.gz | |
upload-x86_64-pc-windows-msvc: | |
needs: tag | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dtolnay/rust-toolchain@stable | |
with: | |
targets: x86_64-pc-windows-msvc | |
- run: | | |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
- run: cargo build --release --target x86_64-pc-windows-msvc | |
- run: ./.github/bundle-release.sh x86_64-pc-windows-msvc | |
shell: bash | |
- run: gh release upload v${{ needs.tag.outputs.version }} x86_64-pc-windows-msvc.tar.gz |