Skip to content

UI improvements

UI improvements #73

Workflow file for this run

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: ./.github/actions/setup
with:
components: clippy
- run: cargo clippy
unit-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- run: cargo test
smoke-test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/setup
- 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
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: cargo release version $(.github/semver.sh) -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