From d0a166752934cef666f031347d828aa52e6ee607 Mon Sep 17 00:00:00 2001 From: Jonathan Chang Date: Mon, 24 Feb 2020 03:21:37 +1100 Subject: [PATCH] workflows: add self-hosted bottling workflow (#50468) --- .github/workflows/build-bottles.yml | 61 +++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build-bottles.yml diff --git a/.github/workflows/build-bottles.yml b/.github/workflows/build-bottles.yml new file mode 100644 index 00000000000..157df08bae3 --- /dev/null +++ b/.github/workflows/build-bottles.yml @@ -0,0 +1,61 @@ +name: Build bottles. + +on: + pull_request: + paths: + - 'Formula/*' + +jobs: + build-bottles: + strategy: + matrix: + version: [10.15, 10.14, 10.13] + runs-on: ${{ matrix.version }} + env: + HOMEBREW_GIT_NAME: BrewTestBot + HOMEBREW_GIT_EMAIL: 'homebrew-test-bot@lists.sfconservancy.org' + PATH: '/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin' + HOMEBREW_DEVELOPER: 1 + HOMEBREW_NO_ANALYTICS: 1 + HOMEBREW_NO_AUTO_UPDATE: 1 + steps: + - name: Setup tap + run: | + git -C $(brew --repo) remote set-url origin https://github.com/Homebrew/brew + cd $(brew --repo ${{ github.repository }}) + git config remote.origin.url https://github.com/Homebrew/homebrew-core/ + git fetch origin refs/pull/${{ github.event.pull_request.number }}/merge + git checkout -f FETCH_HEAD + - name: Cleanup + run: | + BREW_LIST=$(brew list 2>/dev/null) + if [ -n "$BREW_LIST" ]; then + echo ">> brew uninstall" + brew uninstall --force --ignore-dependencies $BREW_LIST + fi + rm -rf bottles + rm -rf * + find . /usr/local/Homebrew -name .git/gc.log -delete + brew update-reset /usr/local/Homebrew + brew update + - name: Build bottles + run: | + mkdir bottles + cd bottles + brew test-bot --ci-pr + - name: Upload bottles + if: always() + uses: actions/upload-artifact@v1 + with: + name: bottles + path: bottles + - name: Cleanup + if: always() + run: | + BREW_LIST=$(brew list 2>/dev/null) + if [ -n "$BREW_LIST" ]; then + echo ">> brew uninstall" + brew uninstall --force --ignore-dependencies $BREW_LIST + fi + rm -rf bottles + rm -rf *