Files
david 2e58be694d build: check out mpv-natives before downloading release artifacts
actions/checkout runs 'git clean -fdx' on the workspace by default, so
when it ran after actions/download-artifact it deleted the freshly
downloaded untracked artifacts/ directory. The publish step then failed
with 'cp: cannot stat artifacts/mpv-natives-linux-x86_64/libmpv.so'.
Swap the two steps so the download runs after the clean.
2026-10-06 14:53:02 +02:00

83 lines
3.0 KiB
YAML

name: release
# Publishes the self-contained libmpv for all three platforms as a GitHub
# Release. Triggered by pushing a tag of the form v<mpv-version> (e.g.
# v0.41.0). It reuses the three per-platform build workflows and re-uploads
# their single-file artifacts as bare release assets plus a combined
# checksums.txt.
#
# Asset names are derived from each build job's output and the mpv version
# read from the mpv source tree, so the release tag and the mpv version stay
# in sync:
# mpv-natives-linux-x86_64-<ver>.so
# mpv-natives-windows-x86_64-<ver>.dll
# mpv-natives-macos-universal-<ver>.dylib
# LICENSE-NOTICE.txt
# checksums.txt
#
# jlibmpv's RemoteNativeLocator resolves the download URL deterministically
# from (platform, mpv version) against these names.
on:
push:
tags: ['v*']
permissions:
contents: write
jobs:
build-linux:
uses: ./.github/workflows/build-linux.yml
build-windows:
uses: ./.github/workflows/build-windows.yml
build-macos:
uses: ./.github/workflows/build-macos.yml
publish:
needs: [build-linux, build-windows, build-macos]
runs-on: ubuntu-24.04
steps:
# Check out first: actions/checkout runs `git clean -fdx` on the
# workspace by default, which would delete the untracked artifacts/
# directory if it ran after the download.
- name: Check out mpv-natives (for LICENSE-NOTICE.txt)
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Download platform artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Assemble bare release assets
run: |
# The mpv version comes from each build workflow's top-level
# workflow_call output (a reusable workflow exposes only those to
# the caller, not its job outputs). All three build the same
# pinned mpv, so any one of them yields the version.
VER="${{ needs.build-linux.outputs.version }}"
[ -n "$VER" ] || { echo "ERROR: mpv version not set"; exit 1; }
mkdir -p release
# linux: single self-contained libmpv.so
cp "artifacts/mpv-natives-linux-x86_64/libmpv.so" \
"release/mpv-natives-linux-x86_64-${VER}.so"
# windows: single self-contained libmpv-*.dll (static CRT, no closure)
cp artifacts/mpv-natives-windows-x86_64/libmpv-*.dll \
"release/mpv-natives-windows-x86_64-${VER}.dll"
# macos: single universal libmpv.dylib
cp "artifacts/mpv-natives-macos-universal/libmpv.dylib" \
"release/mpv-natives-macos-universal-${VER}.dylib"
cp LICENSE-NOTICE.txt release/
(cd release && sha256sum * > checksums.txt)
echo "=== release assets ==="
ls -l release
echo "=== checksums ==="
cat release/checksums.txt
- name: Publish GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
files: release/*
generate_release_notes: false