From ae7a276d920916929859027b5a7df5995a5d2e52 Mon Sep 17 00:00:00 2001 From: Dave Marples Date: Sun, 8 Nov 2026 22:52:14 +0000 Subject: [PATCH] Add release builder --- .github/workflows/build-linux.yml | 1 + .github/workflows/build-osx.yml | 1 + .github/workflows/build-windows.yml | 10 +++ .github/workflows/release.yml | 94 +++++++++++++++++++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build-linux.yml b/.github/workflows/build-linux.yml index d6f06c06..a67739ad 100644 --- a/.github/workflows/build-linux.yml +++ b/.github/workflows/build-linux.yml @@ -3,6 +3,7 @@ name: Build Linux binaries on: - push - pull_request + - workflow_call jobs: linux: diff --git a/.github/workflows/build-osx.yml b/.github/workflows/build-osx.yml index 126c6b68..8e0cb3e2 100644 --- a/.github/workflows/build-osx.yml +++ b/.github/workflows/build-osx.yml @@ -3,6 +3,7 @@ name: Build OSX binaries on: - push - pull_request + - workflow_call jobs: osx: diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index 18e0b221..56cfad76 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -3,6 +3,7 @@ name: Build Windows binaries on: - push - pull_request + - workflow_call jobs: win64: @@ -50,6 +51,15 @@ jobs: - run: meson install -C ./build --destdir ./install --strip working-directory: ./orbuculum - run: cp ./libusb/install/bin/libusb-1.0.dll ./orbuculum/build/install/bin + - name: Bundle MinGW runtime DLLs + working-directory: ./orbuculum/build/install/bin + run: | + # Copy every DLL the binaries pull from the MSYS2 MinGW tree so they run standalone + for f in *.exe *.dll; do + ldd "$f" | awk '{print $3}' | grep -i '^/mingw64/' || true + done | sort -u | while read -r dll; do + cp -v "$dll" . + done - uses: actions/upload-artifact@v4 with: name: orbuculum-win64 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..511c7d2c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,94 @@ +name: Release binaries + +# Builds Linux, OSX and Windows binaries and publishes them to a rolling +# 'latest' release on every push to main. Pushing a v* tag additionally +# creates a versioned release. +# +# Download links: +# https://github.com/orbcode/orbuculum/releases/download/latest/orbuculum-linux.tar.gz +# https://github.com/orbcode/orbuculum/releases/download/latest/orbuculum-osx.tar.gz +# https://github.com/orbcode/orbuculum/releases/download/latest/orbuculum-win64.zip + +on: + push: + branches: + - main + tags: + - 'v*' + workflow_dispatch: + +permissions: + contents: write + +concurrency: + group: release-${{ github.ref }} + cancel-in-progress: true + +jobs: + linux: + uses: ./.github/workflows/build-linux.yml + osx: + uses: ./.github/workflows/build-osx.yml + windows: + uses: ./.github/workflows/build-windows.yml + + release: + needs: [linux, osx, windows] + runs-on: ubuntu-latest + steps: + - uses: actions/download-artifact@v4 + with: + path: dist + + - name: Package + working-directory: dist + run: | + # Artifacts lose the executable bit; restore it on binaries + for p in orbuculum-linux orbuculum-osx; do + find "$p" -path '*/bin/*' -type f -exec chmod +x {} + + tar -czf "$p.tar.gz" -C "$p" . + done + (cd orbuculum-win64 && zip -r ../orbuculum-win64.zip .) + ls -l *.tar.gz *.zip + + - name: Write release notes + run: | + cat > notes.md <<'NOTES' + ## Runtime dependencies + + **Windows (`orbuculum-win64.zip`)** - self-contained; all required DLLs are in `bin/`. + + **Linux (`orbuculum-linux.tar.gz`)** - built on Ubuntu (latest LTS). Install: + ``` + sudo apt install libusb-1.0-0 libzmq5 libsdl2-2.0-0 libdw1 libelf1 libcapstone5 + ``` + + **macOS (`orbuculum-osx.tar.gz`)** - built on macOS 15 (Apple Silicon). Install: + ``` + brew install libusb zmq sdl2 libelf + ``` + NOTES + sed -i 's/^ //' notes.md + + - name: Update 'latest' release + if: github.ref == 'refs/heads/main' || github.event_name == 'workflow_dispatch' + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + git_sha=${{ github.sha }} + gh release delete latest --yes --cleanup-tag || true + gh release create latest dist/*.tar.gz dist/*.zip \ + --target "$git_sha" \ + --prerelease \ + --title "Latest build (${git_sha:0:7})" \ + --notes "$(printf 'Automated build of %s from %s.\n\n' "$git_sha" "$GITHUB_REF_NAME"; cat notes.md)" + + - name: Create versioned release + if: startsWith(github.ref, 'refs/tags/v') + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + run: | + gh release create "$GITHUB_REF_NAME" dist/*.tar.gz dist/*.zip \ + --title "$GITHUB_REF_NAME" --notes-file notes.md --generate-notes