Skip to content

pr-upload

pr-upload #6

Workflow file for this run

name: Build Homebrew bottle
on:
workflow_dispatch:
push:
branches: [build-bottle]
env:
HOMEBREW_DEVELOPER: 1
HOMEBREW_GITHUB_ACTIONS: 1
HOMEBREW_NO_AUTO_UPDATE: 1
HOMEBREW_NO_INSTALL_FROM_API: 1
HOMEBREW_NO_INSTALL_CLEANUP: 1
HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK: 1
BOTTLE_ROOT_URL: https://ghcr.io/v2/rbenv/tap
defaults:
run:
shell: bash -xeuo pipefail {0}
# concurrency: bottle-${{ github.event.inputs.formula }}
permissions:
contents: read
jobs:
build:
strategy:
matrix:
formula: [[email protected], [email protected]]
os: [macos-13, macos-14, macos-15]
runs-on: ${{ matrix.os }}
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: false
cask: false
test-bot: false
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v3
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems
- name: Uninstall existing formula
run: brew uninstall --force --ignore-dependencies --formula "$FORMULA_NAME"
env:
FORMULA_NAME: ${{ matrix.formula }}
- name: Install formula
run: brew install --build-bottle "$FORMULA_NAME"
env:
FORMULA_NAME: rbenv/tap/${{ matrix.formula }}
- name: Build bottle
run: brew bottle --json "$FORMULA_NAME" --root-url "$BOTTLE_ROOT_URL" --keep-old
env:
FORMULA_NAME: rbenv/tap/${{ matrix.formula }}
- run: ls -l
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: bottle_${{ matrix.formula }}_${{ matrix.os }}
if-no-files-found: error
path: |
*.bottle.*.tar.gz
*.bottle.json
upload:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
with:
core: false
cask: false
test-bot: false
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v3
with:
path: ${{ steps.set-up-homebrew.outputs.gems-path }}
key: ${{ runner.os }}-rubygems-${{ steps.set-up-homebrew.outputs.gems-hash }}
restore-keys: ${{ runner.os }}-rubygems-
- name: Install Homebrew Bundler RubyGems
if: steps.cache.outputs.cache-hit != 'true'
run: brew install-bundler-gems
- name: Download artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
- run: ls -l
- name: Upload bottles
run: brew pr-upload --root-url "$BOTTLE_ROOT_URL" --committer "Mislav Marohnić <[email protected]>" --warn-on-upload-failure
env:
HOMEBREW_GITHUB_PACKAGES_USER: mislav
HOMEBREW_GITHUB_PACKAGES_TOKEN: ${{ secrets.BOTTLE_UPLOAD_TOKEN }}
- run: git log -p origin/HEAD..