CI: launch self-tests on Windows and Linux; publish release from main

Tags can't be pushed from the authoring environment, so the release job
creates tag v<VERSION> itself on pushes to main (and still honours v* tags).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01J7imThHV9BMkG24GaxPDeq
This commit is contained in:
Claude 2026-10-09 23:13:54 -05:00
commit 393fb22621
No known key found for this signature in database

View file

@ -43,6 +43,18 @@ jobs:
Get-ChildItem packaging/windows/mpv
- name: PyInstaller
run: pyinstaller packaging/mulberry.spec --noconfirm --distpath build/dist --workpath build/work
- name: Self-test (launch the built app, screenshot, quit)
shell: pwsh
run: |
$env:MULBERRY_SELFTEST = "$PWD\selftest-windows"
$p = Start-Process build/dist/Mulberry/Mulberry.exe -PassThru
if (-not $p.WaitForExit(90000)) { Stop-Process $p.Id; throw "Mulberry did not finish the self-test" }
if (-not (Test-Path selftest-windows.png)) { throw "no screenshot - the app failed to start" }
Get-Content selftest-windows.txt
- uses: actions/upload-artifact@v4
with:
name: selftest-windows
path: selftest-windows.*
- name: Portable zip
shell: pwsh
run: |
@ -78,6 +90,15 @@ jobs:
run: python packaging/make_icons.py
- name: PyInstaller
run: pyinstaller packaging/mulberry.spec --noconfirm --distpath build/dist --workpath build/work
- name: Self-test (launch the built app, screenshot, quit)
run: |
sudo apt-get install -y xvfb libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-xinerama0 libxcb-xkb1 libxkbcommon-x11-0 >/dev/null
MULBERRY_SELFTEST=$PWD/selftest-linux timeout 90 xvfb-run -a build/dist/Mulberry/mulberry
test -f selftest-linux.png && cat selftest-linux.txt
- uses: actions/upload-artifact@v4
with:
name: selftest-linux
path: selftest-linux.*
- name: Tarball
run: |
mkdir -p dist
@ -102,17 +123,28 @@ jobs:
path: dist/*
release:
if: startsWith(github.ref, 'refs/tags/v')
# Publishes on every push to main (tag v<VERSION> is created by the action),
# or when a v* tag is pushed. Same-named assets are replaced on re-runs.
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
needs: [windows, linux]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Version
run: echo "VERSION=$(python3 -c "import re;print(re.search(r'VERSION = \"(.+?)\"', open('mulberry/config.py').read()).group(1))")" >> $GITHUB_ENV
- uses: actions/download-artifact@v4
with:
path: artifacts
- uses: softprops/action-gh-release@v2
with:
files: artifacts/**/*
name: Mulberry ${{ github.ref_name }}
tag_name: v${{ env.VERSION }}
target_commitish: ${{ github.sha }}
name: Mulberry ${{ env.VERSION }}
make_latest: true
overwrite_files: true
files: |
artifacts/windows/*
artifacts/linux/*
body: |
## Downloads
| Platform | File |
@ -122,6 +154,9 @@ jobs:
| Linux, any distro | **Mulberry-x86_64.AppImage** (`chmod +x`, then run) |
| Linux tarball | **Mulberry-Linux-x86_64.tar.gz** (run `Mulberry/mulberry`) |
On Linux, install `mpv` from your package manager for gapless playback, the EQ and CD support.
See the [README](https://github.com/${{ github.repository }}#readme) for everything else.
generate_release_notes: true
On Linux, install `mpv` for gapless playback, the EQ and CD support. The Windows build includes it.
Windows SmartScreen may warn because the installer is unsigned: choose *More info → Run anyway*.
See the [README](https://github.com/${{ github.repository }}#readme) for features and setup.
*Coded by Claude (Anthropic) with @BeamStarTech.*