Skip to content

Commit

Permalink
Properly generate bottles.
Browse files Browse the repository at this point in the history
Use zsh.

Standardize formatting.

Resolve #66

Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
  • Loading branch information
rgoldberg committed Dec 22, 2024
1 parent 36a7f1d commit 18d5856
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 15 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: brew pr-pull

on:
pull_request_target:
types:
- labeled

types: [labeled]
defaults:
run:
shell: /bin/zsh -Negku {0}
jobs:
pr-pull:
if: contains(github.event.pull_request.labels.*.name, 'pr-pull')
Expand All @@ -21,18 +21,18 @@ jobs:

- name: Pull bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{ github.token }}
PULL_REQUEST: ${{ github.event.pull_request.number }}
run: brew pr-pull --debug --tap="$GITHUB_REPOSITORY" "$PULL_REQUEST"
HOMEBREW_GITHUB_API_TOKEN: ${{github.token}}
PULL_REQUEST: ${{github.event.pull_request.number}}
run: brew pr-pull --debug --tap="${GITHUB_REPOSITORY}" "${PULL_REQUEST}"

- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{ github.token }}
token: ${{github.token}}
branch: main

- name: Delete branch
if: github.event.pull_request.head.repo.fork == false
env:
BRANCH: ${{ github.event.pull_request.head.ref }}
run: git push --delete origin "$BRANCH"
BRANCH: ${{github.event.pull_request.head.ref}}
run: git push --delete origin "${BRANCH}"
25 changes: 20 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
name: brew test-bot

on:
push:
branches:
- main
branches: [main]
pull_request:

defaults:
run:
shell: /bin/zsh -Negku {0}
jobs:
test-bot:
strategy:
matrix:
os: [macos-13, macos-14, macos-15]
os: [macos-13, macos-15]
runs-on: ${{matrix.os}}
steps:
- name: Set up Homebrew
Expand All @@ -33,6 +33,21 @@ jobs:
- run: brew test-bot --only-formulae
if: github.event_name == 'pull_request'

- name: Rename bottle
if: github.event_name == 'pull_request'
run: |
autoload zmv
if [[ "${ImageOS}" = macos15 ]]; then
(zmv 'mas-(*).arm64_sequoia.bottle.tar.gz' 'mas-$1.arm64_big_sur.bottle.tar.gz') || true
else
(zmv 'mas-(*).ventura.bottle.tar.gz' 'mas-$1.high_sierra.bottle.tar.gz') || true
fi
- name: Download 1.8.6 bottle
if: github.event_name == 'pull_request' && matrix.os == 'macos-15'
run: |
curl -LO https://github.com/mas-cli/mas/releases/download/v1.8.6/mas-1.8.6.el_capitan.bottle.tar.gz
- name: Upload bottles as artifact
if: always() && github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
Expand Down

0 comments on commit 18d5856

Please sign in to comment.