From 08876f2aa3adf932e3c3953659df32bed5676ee0 Mon Sep 17 00:00:00 2001 From: pancake Date: Wed, 30 Sep 2026 11:02:37 +0200 Subject: [PATCH] Binary dists optimized for r2pm -b --- .github/workflows/ci.yml | 44 +++++++++++++++++++++++++++++++++++++++- .gitignore | 3 +++ Makefile | 10 ++++++++- 3 files changed, 55 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d40d0a5..8797bcd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -166,11 +166,45 @@ jobs: Compress-Archive -Path "$package\*" -DestinationPath $archive -Force "archive=$archive" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append + - name: Package r2pm binary + shell: pwsh + run: | + New-Item -ItemType Directory -Force -Path bindist\plugins,bindist\bin | Out-Null + Copy-Item build-windows\core_r2unity.dll,build-windows\bin_r2unity.dll bindist\plugins + Copy-Item build-windows\r2unity.exe bindist\bin + Compress-Archive -Path bindist\* -DestinationPath "r2unity-$((r2 -qv).Trim())-windows-x86-64.zip" -Force + - name: Upload Windows package artifact uses: actions/upload-artifact@v7 with: name: windows-package - path: ${{ steps.package.outputs.archive }} + path: | + ${{ steps.package.outputs.archive }} + r2unity-*-windows-x86-64.zip + if-no-files-found: error + + bindist: + name: Build r2pm binary (${{ matrix.os }}) + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Install radare2 + uses: radareorg/github-actions@v3 + + - name: Package r2pm binary + run: make bindist + + - name: Upload r2pm binary artifact + uses: actions/upload-artifact@v7 + with: + name: bindist-${{ matrix.os }} + path: r2unity-*.zip if-no-files-found: error release: @@ -181,6 +215,7 @@ jobs: - meson - debian - windows + - bindist runs-on: ubuntu-latest permissions: contents: write @@ -203,6 +238,13 @@ jobs: name: windows-package path: dist/artifacts + - name: Download r2pm binary artifacts + uses: actions/download-artifact@v8 + with: + pattern: bindist-* + path: dist/artifacts + merge-multiple: true + - name: Generate release notes run: ./release.sh notes > release-notes.md diff --git a/.gitignore b/.gitignore index 067c703..2fc11cb 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ # Third-party reference checkouts (radare2, il2cpp dumper, etc.) /third_party/ + +# r2pm binary packages +/r2unity-*.zip diff --git a/Makefile b/Makefile index 047d7ca..c1b7af8 100644 --- a/Makefile +++ b/Makefile @@ -66,6 +66,14 @@ user-install: install-plugin user-uninstall: uninstall-plugin rm -f "$(R2PM_BINDIR)/$(EXEC)" +# Binary package for r2pm -bi: plugins/ and bin/ for this r2 version and platform +BINDIST_ZIP = r2unity-$(shell r2 -qv)-$(shell r2pm -H R2PM_OS)-$(shell r2pm -H R2PM_ARCH)-$(shell r2pm -H R2PM_BITS).zip + +bindist: $(EXEC) $(PLUGINS) + rm -rf build/bindist $(BINDIST_ZIP) + $(MAKE) user-install R2_USER_PLUGINS=$(CURDIR)/build/bindist/plugins R2PM_BINDIR=$(CURDIR)/build/bindist/bin + cd build/bindist && zip -r $(CURDIR)/$(BINDIST_ZIP) plugins bin + $(EXEC): $(OBJS) $(CC) -o $@ $^ $(LDFLAGS) @@ -88,4 +96,4 @@ clean: rm -f $(EXEC) $(OBJS) $(LEGACY_OBJS) $(PLUGINS) $(CONFIG_H) -.PHONY: all clean plugin install-plugin uninstall-plugin fmt +.PHONY: all clean plugin install-plugin uninstall-plugin fmt bindist