From 771fa5c4f2ba2a67f1bef7fcfb7813fc87ee9ef7 Mon Sep 17 00:00:00 2001 From: Prakhar Gurunani Date: Mon, 4 Mar 2024 21:43:50 +0530 Subject: [PATCH] CI: Setup distributable binary (#12) * wip: fix commits * fix: workflow order * Release do --------- Co-authored-by: Vicente Eduardo Ferrer Garcia <7854099+viferga@users.noreply.github.com> --- .github/workflows/test.yml | 12 ++++++++++++ build.sh | 6 ++++++ 2 files changed, 18 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7d2491b..fb2ea91 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -2,6 +2,10 @@ name: Build and Test Homebrew MetaCall on: push: + branches: + - main + tags: + - "v*.*.*" pull_request: workflow_dispatch: @@ -59,3 +63,11 @@ jobs: # Test Homebrew recipe - name: Test run: ./test.sh + + # Release package + - name: Release + uses: softprops/action-gh-release@v1 + if: startsWith(github.ref, 'refs/tags/') + with: + fail_on_unmatched_files: true + files: pkg/*.pkg diff --git a/build.sh b/build.sh index 795fea6..63d54cb 100755 --- a/build.sh +++ b/build.sh @@ -10,3 +10,9 @@ fi # Build metacall brew recipe export HOMEBREW_NO_AUTO_UPDATE=1 brew install ./metacall.rb --build-from-source --overwrite -v + +# Build distributable binary using brew pkg +mkdir pkg && cd pkg +brew tap timsutton/formulae +brew install brew-pkg +brew pkg --with-deps --without-kegs metacall