Skip to content

Commit

Permalink
✨ Add auto bottling action
Browse files Browse the repository at this point in the history
  • Loading branch information
reckter committed Aug 30, 2021
1 parent 701d8d1 commit 43bae6e
Showing 1 changed file with 78 additions and 0 deletions.
78 changes: 78 additions & 0 deletions .github/workfows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
name: Publish

on:
release:
types: [published]

jobs:
formula:
name: Update Homebrew formula
runs-on: ubuntu-latest
steps:
- name: Update the Homebrew formula with latest release
uses: NSHipster/update-homebrew-formula-action@main
with:
repository: opencreek/creekey-cli
tap: opencreek/homebrew-tab
formula: creekey.rb
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

bottle_macos_catalina:
name: Build and distribute Homebrew bottle for macOS Catalina
runs-on: macos-10.15
needs: [formula]
steps:
- name: Build a bottle using Homebrew
run: |
brew tap opecreek/tab
brew install --build-bottle --verbose creekey
brew bottle creekey
- name: Upload the bottle to the GitHub release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./creekey--${{ github.event.release.tag_name }}.catalina.bottle.1.tar.gz
asset_name: creekey-${{ github.event.release.tag_name }}.catalina.bottle.1.tar.gz
asset_content_type: application/gzip

bottle_macos_big_sur:
name: Build and distribute Homebrew bottle for macOS Big Sur
runs-on: macos-11.0
needs: [formula]
steps:
- name: Build a bottle using Homebrew
run: |
brew tap opencreek/tab
brew install --build-bottle --verbose creekey
brew bottle creekey
- name: Upload the bottle to the GitHub release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ./creekey--${{ github.event.release.tag_name }}.big_sur.bottle.1.tar.gz
asset_name: creekey-${{ github.event.release.tag_name }}.big_sur.bottle.1.tar.gz
asset_content_type: application/gzip

update_formula_bottle:
name: Update the Homebrew formula again with bottle
runs-on: ubuntu-latest
needs:
- bottle_macos_catalina
- bottle_macos_big_sur
steps:
- uses: NSHipster/update-homebrew-formula-action@main
with:
repository: opencreek/creekey-cli
tap: opencreek/homebrew-tab
formula: creekey.rb
message: |
Add bottles for creekey ${{ github.event.release.tag_name }}
on macOS 10.15 (Catalina) and macOS 11.0 (Big Sur)
env:
GH_PERSONAL_ACCESS_TOKEN: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}

0 comments on commit 43bae6e

Please sign in to comment.