Skip to content

⚙️ A Github Action to easily bump Homebrew formula on new release

License

Notifications You must be signed in to change notification settings

jasonkarns/action-homebrew-bump-formula

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Homebrew bump formula Github Action

An action that wraps brew bump-formula-pr to ease the process of updating the formula on new project releases.

Usage

One should use the Personal Access Token for token input to this Action, not the default GITHUB_TOKEN, because brew bump-formula-pr creates a fork of the formula's tap repository and creates a PR.

It is best to use this Action when a new tag is pushed:

on:
  push:
    tags:
      - '*'

Example of bumping any formula in any user tap:

- name: Get tag
  id: tag
  uses: dawidd6/action-get-tag@v1

- name: Update Homebrew formula
  uses: dawidd6/action-homebrew-bump-formula@v1
  with:
    token: ${{secrets.GITHUB_PAT}}
    formula: USER/REPO/FORMULA
    url: "https://github.com/USER/REPO/archive/${{steps.tag.outputs.tag}}.tar.gz"

Example of bumping lazygit formula in Homebrew/homebrew-core tap:

- name: Get tag
  id: tag
  uses: dawidd6/action-get-tag@v1

- name: Update Homebrew formula
  uses: dawidd6/action-homebrew-bump-formula@v1
  with:
    token: ${{secrets.GITHUB_PAT}}
    formula: lazygit
    url: "https://github.com/jesseduffield/lazygit/archive/${{steps.tag.outputs.tag}}.tar.gz"

... using url input because the formula already specifies it:

class Lazygit < Formula
  desc "Simple terminal UI for git commands"
  homepage "https://github.com/jesseduffield/lazygit/"
  url "https://github.com/jesseduffield/lazygit/archive/v0.16.2.tar.gz"
  sha256 "76c043e59afc403d7353cdb188ac6850ce4c4125412e291240c787b0187e71c6"

Example of bumping lazydocker formula in Homebrew/homebrew-core tap:

- name: Get tag
  id: tag
  uses: dawidd6/action-get-tag@v1

- name: Update Homebrew formula
  uses: dawidd6/action-homebrew-bump-formula@v1
  with:
    token: ${{secrets.GITHUB_PAT}}
    formula: lazydocker
    tag: ${{steps.tag.outputs.tag}}
    revision: ${{github.sha}}

... using tag and revision inputs because the formula already specifies them:

class Lazydocker < Formula
  desc "The lazier way to manage everything docker"
  homepage "https://github.com/jesseduffield/lazydocker"
  url "https://github.com/jesseduffield/lazydocker.git",
      :tag      => "v0.8",
      :revision => "cea67bc570daaa757a886813ff3c2763189efef6"

About

⚙️ A Github Action to easily bump Homebrew formula on new release

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 97.6%
  • Dockerfile 2.4%