Skip to content

ensure all bottle blocks are updated #98

ensure all bottle blocks are updated

ensure all bottle blocks are updated #98

Workflow file for this run

# Forked from https://github.com/dawidd6/homebrew-test-tap-new/blob/main/.github/workflows/tests.yml
name: brew test-bot
on:
push:
branches:
- main
env:
package_order: "cfitsio_reentrant casacore-data wcslib casacore aoflagger birli"
jobs:
create_release:
runs-on: ubuntu-latest
outputs:
release: ${{ steps.version.outputs.release }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
root_url: ${{ steps.get_root.outputs.root_url }}
steps:
- name: Get version number from current date
id: version
run: echo "release=$(date +'v%Y.%m.%d.%H.%M')" | tee -a "$GITHUB_OUTPUT"
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ steps.version.outputs.release }}
release_name: Release ${{ steps.version.outputs.release }}
body: |
Brew bottles for cfitsio_reentrant, casacore-data, wcslib, casacore, aoflagger, birli
draft: false
prerelease: false
- name: Get Root URL
id: get_root
run: echo "root_url=${{ github.server_url }}/${{ github.repository }}/releases/download/${{ steps.version.outputs.release }}" | tee -a "$GITHUB_OUTPUT"
style:
runs-on: macos-latest
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
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
- run: brew style Formula/*
- run: brew test-bot --only-cleanup-before Formula/*
- run: brew test-bot --only-setup Formula/*
bottle:
strategy:
matrix:
os:
- macos-13
- macos-14
- macos-15
runs-on: ${{ matrix.os }}
needs: create_release
steps:
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
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: add tap
run: brew tap mwatelescope/tap
- name: bottle
continue-on-error: true
run: |
for package in ${{ env.package_order }}; do
brew uninstall --ignore-dependencies --force $package || true
brew install --formula --build-bottle mwatelescope/tap/$package
brew bottle --json --root-url="${{ needs.create_release.outputs.root_url }}" mwatelescope/tap/$package
echo "${package}_path=$(ls ${package}--*.bottle*.tar.gz)" | tee -a "$GITHUB_ENV"
# this deals with https://github.com/orgs/Homebrew/discussions/4541
# e.g. if path is hello--2.12_98.arm64_ventura.bottle.1.tar.gz, filename should be hello-2.12_98.arm64_ventura.bottle.1.tar.gz
echo "${package}_filename=$(ls ${package}--*.bottle*.tar.gz | sed 's/--/-/')" | tee -a "$GITHUB_ENV"
done
- name: Upload cfitsio_reentrant Release Asset
uses: actions/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.cfitsio_reentrant_path }}
asset_name: ${{ env.cfitsio_reentrant_filename }}
asset_content_type: application/gzip
- name: Upload casacore-data Release Asset
uses: actions/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.casacore-data_path }}
asset_name: ${{ env.casacore-data_filename }}
asset_content_type: application/gzip
- name: Upload wcslib Release Asset
uses: actions/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.wcslib_path }}
asset_name: ${{ env.wcslib_filename }}
asset_content_type: application/gzip
- name: Upload casacore Release Asset
uses: actions/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.casacore_path }}
asset_name: ${{ env.casacore_filename }}
asset_content_type: application/gzip
- name: Upload aoflagger Release Asset
uses: actions/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.aoflagger_path }}
asset_name: ${{ env.aoflagger_filename }}
asset_content_type: application/gzip
- name: Upload birli Release Asset
uses: actions/[email protected]
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.upload_url }}
asset_path: ${{ env.birli_path }}
asset_name: ${{ env.birli_filename }}
asset_content_type: application/gzip
- name: upload bottle artifacts
uses: actions/upload-artifact@v4
with:
name: bottle_${{ matrix.os }}
path: ./*.bottle.json
merge:
needs:
- create_release
- bottle
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Homebrew
id: set-up-homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Cache Homebrew Bundler RubyGems
id: cache
uses: actions/cache@v4
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 bottle artifacts
uses: actions/download-artifact@v4
with:
merge-multiple: true
pattern: bottle_*
- name: add tap
run: brew tap mwatelescope/tap
- name: Merge bottle do blocks and commit
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
brew bottle --merge --write --no-commit ./*.bottle.json
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}.git
for package in ${{ env.package_order }}; do
git diff ./Formula/${package}.rb
done
git add ./Formula/*.rb
git commit -m "[skip ci] Update bottle blocks"
git push origin main