Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Automatically update Homebrew taps when you publish new GitHub releases

License

NotificationsYou must be signed in to change notification settings

toolmantim/tap-release

Repository files navigation

Tap Release Logo

Automatically updateHomebrew taps when you publish new releases to GitHub. Built withProbot.


Install the GitHub App


NPM package

Usage

Firstly, you’ll need to install theTap Release GitHub App. This listens out for any releases, or any changes to the configuration.

Then, add a.github/tap-release.yml configuration file to the GitHub repository where you publish new releases to.

For example, given the following.github/tap-release.yml file in amy-org/app/app.rb repository:

asset:app.ziptap:my-org/homebrew-app/app.rbtemplate:|  class App < Formula    desc     "$REPO_DESCRIPTION"    homepage "$REPO_WEBSITE"    version  "$STABLE_VERSION"    url      "$STABLE_ASSET_URL"    sha256   "$STABLE_ASSET_SHA256"    def install      prefix.install "app"    end  end

When a new release is published tomy-org/app (e.g.v4.2.0), containing aapp.zip asset, Tap Release would push a commit to the tap formula in themy-org/homebrew-app repository updating it to:

classApp <Formuladesc"The best app ever"homepage"https://github.com/my-org/app"version"v2.4.0"url"https://github.com/my-org/app/releases/download/v4.2.0/app.zip"sha256"f3832d8966dd39f7ae1316195ebb379cf18aece281bc2f7c43dd799130ebf460"definstallprefix.install"app"endend

If you don't use release assets, you can also just use a URL pattern. For example, given the following template for aNode style tap:

url:"https://registry.npmjs.org/app/-/app-$VERSION_NUMBER.tgz"tap:my-org/homebrew-app/app.rbtemplate:|  class App < Formula    desc     "$REPO_DESCRIPTION"    homepage "$REPO_WEBSITE"    version  "$STABLE_VERSION"    url      "$STABLE_ASSET_URL"    sha256   "$STABLE_ASSET_SHA256"    # ...  end

When a new release is published (e.g.v4.2.0), Tap Release would push a commit to the tap formula in themy-org/homebrew-app repository updating it to:

classApp <Formuladesc"The best app ever"homepage"https://github.com/my-org/app"version"v4.2.0"url"https://registry.npmjs.org/app/-/app-4.2.0.tgz"sha256"f3832d8966dd39f7ae1316195ebb379cf18aece281bc2f7c43dd799130ebf460"# ...end

Template variables

You can use any of the following variables in your formula template, and they'll be substituted when the tap is regenerated:

VariableDescription
$REPO_DESCRIPTIONGitHub repository description.
$REPO_WEBSITEGitHub repository website, or URL if there isn't one.
$STABLE_VERSIONTag name of the latest stable release (e.g.v1.0.2).
$STABLE_VERSION_NUMBERTag name of the latest stable release, without any precedingv (e.g.1.0.2).
$STABLE_ASSET_URLDownload URL of the asset from the latest stable release.
$STABLE_ASSET_SHA256SHA256 of the asset from the latest stable release.
$DEVEL_VERSIONTag name of the latest pre-release (e.g.v2.0.0-beta.1).
$DEVEL_VERSION_NUMBERTag name of the latest pre-release, without any precedingv (e.g.2.0.0-beta.1).
$DEVEL_ASSET_URLDownload URL of the asset from the latest pre-release.
$DEVEL_ASSET_SHA256SHA256 of the asset from the latest pre-release.

Asset & URL variables

You can use any of the following variables in theasset andurl options, and they'll be substituted for each stable and development release when searching for assets or generating URLs:

VariableDescription
$VERSIONThe version (e.g.v1.0.2).
$VERSION_NUMBERThe version without the precedingv (e.g.1.0.2).

Configuration options

You can configure Tap Release using the following key in your.github/tap-release.yml file:

KeyRequiredDescription
tapRequiredThe path to the Homebrew tap repository that should be updated.
templateRequiredThe template string to use to generate the tap. Usevariables to insert the values from the releases.
assetOptionalFilename of the asset to use from the release.
urlOptionalURL pattern to generate the download URLs. UseURL variables to insert the values from the release.
branchesOptionalA list of branches that trigger the tap to be updated when the.github/tap-release.yml file is modified. Useful if you want to test the app on a pull request branch. Default is"master".

Tap Release also supportsProbot Config, if you want to store your configuration files in a central repository.

Developing

If you have Node v8+ installed locally, you can run the tests, and a local app, using the following commands:

# Install dependenciesyarn# Run the testsnpmtest# Run the app locallynpm start

If you don't have Node installed, you can useDocker Compose:

# Run the testsdocker-compose run --rm app npmtest

Contributing

Third-pary contributions are welcome! 🙏🏼 SeeCONTRIBUTING.md for step-by-step instructions.

If you need help or have a question, let me know via a GitHub issue.

Deployment

If you want to deploy your own copy of Tap Release, follow theProbot Deployment Guide.

Releasing

Run the following command:

git checkout master&& git pull&& npm version [major| minor| patch]

The command does the following:

  • Ensures you’re on master and don't have local, un-commited changes
  • Bumps the version number inpackage.json based on major, minor or patch
  • Runs thepostversion npm script inpackage.json, which:
    • Pushes the tag to GitHub
    • Publishes the npm release
    • Opens the GitHub releases page so you can publish the release notes

[8]ページ先頭

©2009-2025 Movatter.jp