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