All Projects → mislav → Bump Homebrew Formula Action

mislav / Bump Homebrew Formula Action

Licence: unlicense
Automatically bump Homebrew formula after a release

Programming Languages

typescript
32286 projects

Labels

Projects that are alternatives of or similar to Bump Homebrew Formula Action

Hbupdater
A simple python app for keeping your switch apps up-to-date using the github api.
Stars: ✭ 37 (-41.27%)
Mutual labels:  homebrew
Homebrew Public
Homebrew formula for open-source software developed by Spotify
Stars: ✭ 45 (-28.57%)
Mutual labels:  homebrew
Mas
📦 Mac App Store command line interface
Stars: ✭ 8,603 (+13555.56%)
Mutual labels:  homebrew
Fugen
Command line tool for exporting resources and generating code from your Figma files
Stars: ✭ 41 (-34.92%)
Mutual labels:  homebrew
Lazyboy
An EDSL implemented in Haskell for programming the Nintendo Game Boy.
Stars: ✭ 44 (-30.16%)
Mutual labels:  homebrew
Homebrew Mingw w64
unofficial mingw-w64 Homebrew sub-command and Formulae. These formulae have been superseded by homebrew's mingw-w64.rb.
Stars: ✭ 49 (-22.22%)
Mutual labels:  homebrew
Goenv
🚙 Like pyenv and rbenv, but for Go.
Stars: ✭ 964 (+1430.16%)
Mutual labels:  homebrew
Brew.vim
🍺 Vim Syntax for Homebrew formulae
Stars: ✭ 55 (-12.7%)
Mutual labels:  homebrew
Cfw2ofw Helper
Providing aid in converting video games.
Stars: ✭ 44 (-30.16%)
Mutual labels:  homebrew
Guide 3ds
A complete guide to 3DS custom firmware, from stock to boot9strap.
Stars: ✭ 1,055 (+1574.6%)
Mutual labels:  homebrew
Formula Patches
🏥 Patches for Homebrew formulae
Stars: ✭ 41 (-34.92%)
Mutual labels:  homebrew
Goreleaser
Deliver Go binaries as fast and easily as possible
Stars: ✭ 9,290 (+14646.03%)
Mutual labels:  homebrew
Homebrew Clickhouse
ClickHouse for MacOS Sierra and High Sierra.
Stars: ✭ 50 (-20.63%)
Mutual labels:  homebrew
Linuxbrew Core
🍻🐧 Core formulae for the Homebrew package manager on Linux
Stars: ✭ 999 (+1485.71%)
Mutual labels:  homebrew
Vitaident
The first system/hardware identity tool for the PS VITA.
Stars: ✭ 53 (-15.87%)
Mutual labels:  homebrew
Homebrew Emacs Plus
Emacs Plus formulae for the Homebrew package manager
Stars: ✭ 965 (+1431.75%)
Mutual labels:  homebrew
Install
📥 Homebrew (un)installer
Stars: ✭ 1,031 (+1536.51%)
Mutual labels:  homebrew
Dotfiles
Get started with your own dotfiles.
Stars: ✭ 1,094 (+1636.51%)
Mutual labels:  homebrew
Homebrew Pothos
Homebrew formulas for Pothos and SoapySDR
Stars: ✭ 52 (-17.46%)
Mutual labels:  homebrew
Cli
The command line vault (Windows, macOS, & Linux).
Stars: ✭ 1,044 (+1557.14%)
Mutual labels:  homebrew

An action that bumps a Homebrew formula after a new release.

Minimal usage example:

on:
  push:
    tags: 'v*'

jobs:
  homebrew:
    name: Bump Homebrew formula
    runs-on: ubuntu-latest
    steps:
      - uses: mislav/[email protected]
        with:
          # A PR will be sent to github.com/Homebrew/homebrew-core to update this formula:
          formula-name: my_formula
        env:
          COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}

The COMMITTER_TOKEN secret is required because this action will want to write to an external repository. You can generate a new PAT here and give it public_repo (or repo if the homebrew tap repository is private) scopes.

Comprehensive usage example:

on:
  push:
    tags: 'v*'

jobs:
  homebrew:
    name: Bump Homebrew formula
    runs-on: ubuntu-latest
    steps:
      - name: Extract version
        id: extract-version
        run: |
          printf "::set-output name=%s::%s\n" tag-name "${GITHUB_REF#refs/tags/}"
      - uses: mislav/[email protected]
        if: "!contains(github.ref, '-')" # skip prereleases
        with:
          formula-name: my_formula
          formula-path: Formula/my_formula.rb
          homebrew-tap: Homebrew/homebrew-core
          base-branch: master
          download-url: https://example.com/foo/${{ steps.extract-version.outputs.tag-name }}.tar.gz
          commit-message: |
            {{formulaName}} {{version}}

            Created by https://github.com/mislav/bump-homebrew-formula-action
        env:
          COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
          # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

You should enable GITHUB_TOKEN only if the repository that runs this Action is private and if COMMITTER_TOKEN has the public_repo scope only. GITHUB_TOKEN will be used for verifying the SHA256 sum of the downloadable archive for this release.

Action inputs

  • formula-name: the name of the Homebrew formula to bump. Defaults to lower-cased repository name.

  • formula-path: the path to the Homebrew formula file to edit. Defaults to Formula/<formula-name>.rb.

  • tag-name: the git tag name to bump the formula to. Defaults to the currently pushed tag.

  • download-url: the package download URL for the Homebrew formula.

    Defaults to https://github.com/OWNER/REPO/archive/<tag-name>.tar.gz

  • homebrew-tap: the repository where the formula should be updated. Defaults to Homebrew/homebrew-core.

  • base-branch: the branch name in the homebrew-tap repository where the formula should be updated. Defaults to the main branch.

  • commit-message: the git commit message template to use when updating the formula. The following placeholders be expanded:

    Placeholder Description
    {{formulaName}} the name of the formula supplied in formula-name
    {{version}} the version number for this release

    It's recommended that commit-message has both subject and body, i.e. that it contains a subject line followed by a blank line followed by body text. Otherwise, pull requests to Homebrew/homebrew-core might get denied by their automation.

    Defaults to:

    {{formulaName}} {{version}}
    
    Created by https://github.com/mislav/bump-homebrew-formula-action
    

How it works

Given a Homebrew formula Formula/my_formula.rb in the homebrew-core repo:

class MyFormula < Formula
  url "https://github.com/me/myproject/archive/v1.2.3.tar.gz"
  sha256 "<OLDSHA>"
  # ...
end

After we push a v2.0.0 git tag to a project that has this action configured, the formula will be updated to:

class MyFormula < Formula
  url "https://github.com/me/myproject/archive/v2.0.0.tar.gz"
  sha256 "<NEWSHA>"
  # ...
end

This action can update the following Homebrew formula fields:

  • version
  • url
  • sha256 - for non-git download-url
  • tag - for git-based download-url
  • revision - for git-based download-url

If the current COMMITTER_TOKEN doesn't have push access to the repo specified by the homebrew-tap input, the formula will be edited in a fork that is automatically created, and a pull request will be opened.

If the token has push access, but the default branch of the tap repo is protected, a pull request will be opened from a new branch in the same repo.

Otherwise, the formula will be edited via a direct push to the default branch.

Manual trigger

Here's an example of how to set up this action to be manually triggered instead of being triggered by pushing to a git tag:

on:
  workflow_dispatch:
    inputs:
      tag-name:
        description: 'The git tag name to bump the formula to'
        required: true

jobs:
  homebrew:
    name: Bump Homebrew formula
    runs-on: ubuntu-latest
    steps:
      - uses: mislav/[email protected]
        with:
          formula-name: my_formula
          tag-name: ${{ github.event.inputs.tag-name }}
          download-url: https://example.com/foo/${{ github.event.inputs.tag-name }}.tar.gz
        env:
          COMMITTER_TOKEN: ${{ secrets.COMMITTER_TOKEN }}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].