Skip to content

Commit

Permalink
Add GitHub Action Files
Browse files Browse the repository at this point in the history
  • Loading branch information
harens committed Jan 20, 2021
1 parent 9ea6d3a commit a79ea3a
Show file tree
Hide file tree
Showing 5 changed files with 167 additions and 0 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/building.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Credit to https://github.com/dawidd6/homebrew-tap

name: Building

on:
pull_request:
paths:
- 'Formula/*'

jobs:
build:
strategy:
fail-fast: false
matrix:
os:
- ubuntu-16.04
- macos-10.15
- macos-11.0
runs-on: ${{matrix.os}}
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Build bottles
run: |
brew test-bot --only-cleanup-before
brew test-bot --only-formulae --skip-recursive-dependents
- name: Upload bottles
if: always()
uses: actions/upload-artifact@v2
with:
name: bottles
path: '*.bottle.*'
23 changes: 23 additions & 0 deletions .github/workflows/bumping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Credit to https://github.com/dawidd6/homebrew-tap

name: Bumping

on:
schedule:
# Every 12 hours
- cron: '0 */12 * * *'
workflow_dispatch:

jobs:
bump:
continue-on-error: true
runs-on: ubuntu-latest
steps:
- name: Install pipgrip
run: brew install pipgrip
- name: Bump formulae
uses: dawidd6/action-homebrew-bump-formula@v3
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
tap: ${{github.repository}}
livecheck: true
27 changes: 27 additions & 0 deletions .github/workflows/checking.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Credit to https://github.com/dawidd6/homebrew-tap

name: Checking

on:
push:
branches:
- master
pull_request:

jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
id: setup
uses: Homebrew/actions/setup-homebrew@master
- name: Cache gems
uses: actions/cache@v1
with:
path: ${{steps.setup.outputs.gems-path}}
key: ${{runner.os}}-rubygems-${{steps.setup.outputs.gems-hash}}
restore-keys: ${{runner.os}}-rubygems-
- name: Install gems
run: brew install-bundler-gems
- name: Check formulae
run: brew test-bot --only-tap-syntax
52 changes: 52 additions & 0 deletions .github/workflows/dispatching.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Credit to https://github.com/dawidd6/homebrew-tap

name: Dispatch

on:
workflow_dispatch:
inputs:
os:
description: OS type
required: true
formula:
description: Formula name
required: true

jobs:
build:
runs-on: ${{github.event.inputs.os}}
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Build bottles
env:
FORMULA: ${{github.event.inputs.formula}}
run: |
brew test-bot --only-cleanup-before
brew test-bot --only-formulae --skip-recursive-dependents $FORMULA
- name: Upload bottles
if: always()
uses: actions/upload-artifact@v2
with:
name: bottles
path: '*.bottle.*'
upload:
needs: build
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up git
uses: Homebrew/actions/git-user-config@master
- name: Download bottles
uses: actions/download-artifact@v2
with:
name: bottles
- name: Pull bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
run: brew pr-upload --debug
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
33 changes: 33 additions & 0 deletions .github/workflows/uploading.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Credit to https://github.com/dawidd6/homebrew-tap

name: Uploading

on:
pull_request_target:
types:
- labeled

jobs:
upload:
if: contains(github.event.pull_request.labels.*.name, 'beary cool')
runs-on: ubuntu-latest
steps:
- name: Set up Homebrew
uses: Homebrew/actions/setup-homebrew@master
- name: Set up git
uses: Homebrew/actions/git-user-config@master
- name: Pull bottles
env:
HOMEBREW_GITHUB_API_TOKEN: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
PULL_REQUEST: ${{github.event.pull_request.number}}
WORKFLOW: building.yml
run: brew pr-pull --debug --tap=$GITHUB_REPOSITORY --workflows=$WORKFLOW $PULL_REQUEST
- name: Push commits
uses: Homebrew/actions/git-try-push@master
with:
token: ${{secrets.HOMEBREW_GITHUB_API_TOKEN}}
- 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

0 comments on commit a79ea3a

Please sign in to comment.