Skip to content

rgo is a tiny script to release a Homebrew-tap recipe, Scoop App Manifest, and a winget manifest built with GoReleaser

License

Notifications You must be signed in to change notification settings

suzuki-shunsuke/rgo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

rgo

License | script

rgo is a tiny script to release a Homebrew-tap recipe, Scoop App Manifest, and a winget manifest built with GoReleaser

⚠️ Winget isn't support yet.

Why is rgo necessary?

To release Homebrew-tap recipe, Scoop App Manifest, and a winget manifest built with GoReleaser without passing a GitHub Personal Access Token or GitHub App to CI.

When we build and release Go Application using GoReleaser in CI, we usually release files such as Homebrew-tap recipe in CI too. But these files are hosted in different repositories from Go code, so GitHub Actions token isn't available to release them. Either a personal access token or GitHub App is required, which is undesirable in terms of security because these secrets may be leaked and abused.

rgo is a tool to resolve this issue. CI builds files such as Homebrew-tap recipe and uploads them to GitHub Actions Artifacts, and rgo downloads and releases them from out of CI (probably your machine). Then you don't need to pass secrets to CI.

The drawback of rgo is that rgo depends on the environment out of CI (probably your machine). But released files are built in CI. rgo only downloads and releases them. So we think we can accept the drawback.

Requirements

  • Bash
  • Git
  • GitHub CLI

How To Install

Please copy rgo into $PATH.

How does it work?

rgo does the following things:

  1. Create and push a given tag
  2. Wait until the release workflow completes
  3. Create a temporary directory to work on
  4. Downloads files from GitHub Actions Artifacts
  5. Checkout repositories (homebrew-*, scoop-bucket, and winget-pkgs)
  6. Push Homebrew-tap recipe and Scoop App Manifest
  7. Create a pull request to winget-pkgs

How To Use

  1. Edit .goreleaser.yml:

skip_upload: true

  1. Edit the release workflow to upload files to GitHub Actions Artifacts:
- name: Run GoReleaser
  run: goreleaser release --clean
  env:
    GITHUB_TOKEN: ${{ github.token }}
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
  if: "!contains(github.ref_name, '-')" # Skip on prerelease
  with:
    name: goreleaser
    path: |
      dist/homebrew/*.rb
      dist/scoop/*.json
  1. Run rgo on the released repository:
rgo "<released version>"

e.g.

rgo v0.1.0

About

rgo is a tiny script to release a Homebrew-tap recipe, Scoop App Manifest, and a winget manifest built with GoReleaser

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages