Skip to content

Bump APP_VERSION from v3.1.0 to v3.1.1 #494

Bump APP_VERSION from v3.1.0 to v3.1.1

Bump APP_VERSION from v3.1.0 to v3.1.1 #494

Workflow file for this run

# Builds the standalone Windows zip for x86_64 and attaches it to the
# GitHub release that triggered the run.
#
# Mirrors build-linux.yml and build-macos.yml. The package bundles EVERYTHING
# (Python runtime, onnxruntime, PyAV/ffmpeg, the ONNX models, embedded
# PostgreSQL via pgserver and embedded Redis), so an installed package needs no
# Docker and no separately-installed database/broker.
#
# The small native build inputs (redis-server.exe, the unaccent/pg_trgm contrib
# modules) are built or downloaded in this workflow, then baked into the bundle
# by the shared AudioMuse-AI.spec.
#
# The ~5 GB of models are NOT in git. This workflow assembles ./model from the
# same GitHub releases the Dockerfile/macOS/Linux builds use, INCLUDING the
# HuggingFace cache (trimmed to just the roberta-base tokenizer the app actually
# loads) so the release assets stay under GitHub's 2 GB per-file limit.
name: Build standalone Windows zip
on:
push:
tags:
- 'v*.*.*' # Build on every version tag
pull_request: # Build on PRs too, to catch bundle breakage early.
types:
- opened
- reopened
- synchronize
workflow_dispatch: # Allow manual runs for testing without a release
concurrency:
group: build-windows-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
env:
# Releases the models live on. Bump these in lockstep with the Dockerfile.
MODEL_RELEASE: v5.0.0-model
DCLAP_RELEASE: v1
jobs:
build:
# Skip draft PRs and fork PRs -- the same guard the other build workflows use.
if: >-
github.event_name != 'pull_request' ||
(github.event.pull_request.draft == false &&
github.event.pull_request.head.repo.full_name == github.repository)
runs-on: windows-2022
permissions:
contents: read
env:
ARCH: amd64
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Sanity-check runner architecture
shell: powershell
run: |
$got = (Get-WmiObject Win32_Processor).Architecture
Write-Host "CPU Architecture: $got (9=amd64, 12=arm64)"
if ($got -ne 9) {
Write-Error "Expected amd64 runner but got architecture $got"
exit 1
}
- name: Install Python dependencies
shell: powershell
run: |
python -m venv .venv-windows
.venv-windows\Scripts\activate
pip install --upgrade pip
pip install -r requirements/windows.txt
- name: Build vendored redis-server.exe
shell: cmd
run: native-build\windows\vendor\build-redis.bat
- name: Verify vendored PostgreSQL contrib is present
shell: powershell
run: |
$dest = "native-build\windows\vendor\pg-contrib\$env:ARCH"
$required = @("lib\unaccent.dll", "lib\pg_trgm.dll", "extension\unaccent.control", "extension\pg_trgm.control", "extension\unaccent--1.1.sql", "extension\pg_trgm--1.3.sql", "tsearch_data\unaccent.rules")
$bad = @()
foreach ($f in $required) {
$p = Join-Path $dest $f
if (-not (Test-Path $p) -or (Get-Item $p).Length -eq 0) { $bad += $f }
}
if ($bad.Count -ne 0) {
Write-Error "Missing or empty vendored pg-contrib files: $($bad -join ', '). Regenerate with native-build/windows/vendor/pg-contrib/build-pg-contrib-cross.sh -- never ship empty placeholders (they silently disable unaccent/pg_trgm search)."
exit 1
}
Write-Host "Vendored pg-contrib present and non-empty."
- name: Assemble ./model (mirrors the Dockerfile/macOS/Linux models stage)
shell: powershell
env:
GH_TOKEN: ${{ github.token }}
run: python scripts/standalone/assemble_model.py
- name: Verify the assembled model/ is complete
shell: powershell
run: python scripts/standalone/assemble_model.py --verify
- name: Build the bundle
shell: powershell
run: .venv-windows\Scripts\python scripts\standalone\build.py --platform windows
- name: Upload bundle as a workflow artifact
uses: actions/upload-artifact@v4
with:
name: AudioMuse-AI-${{ env.ARCH }}-windows-zip
path: dist/AudioMuse-AI/
if-no-files-found: error
# NB: the PR-description "test build links" block is written by the
# dedicated `pr-test-link.yml` workflow (which runs after this build,
# verifies the artifacts exist, and posts the consolidated link block).
# Attach the zip to the release. Runs only for tag pushes.
release:
needs: build
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download built packages
uses: actions/download-artifact@v4
with:
path: artifacts
merge-multiple: true
- name: Create zip for release
run: |
python -c "
import zipfile, pathlib, sys
# upload-artifact strips the directory pointed at by 'path:', so the
# bundle's files land directly under artifacts/ (not artifacts/AudioMuse-AI/).
src = pathlib.Path('artifacts')
out = 'AudioMuse-AI-amd64-windows.zip'
files = [f for f in sorted(src.rglob('*')) if f.is_file()]
if not files:
sys.exit('No files found under artifacts/ -- the build artifact is missing or empty; refusing to ship an empty zip')
with zipfile.ZipFile(out, 'w', zipfile.ZIP_DEFLATED, allowZip64=True) as zf:
for f in files:
zf.write(f, 'AudioMuse-AI/' + f.relative_to(src).as_posix())
print(f'Created {out} with {len(files)} files')
"
- name: Attach packages to the release
uses: softprops/action-gh-release@v2
with:
files: AudioMuse-AI-*-windows.zip
fail_on_unmatched_files: true