Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish a Homebrew package #8

Open
jamiew opened this issue Sep 4, 2021 · 3 comments
Open

Publish a Homebrew package #8

jamiew opened this issue Sep 4, 2021 · 3 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@jamiew
Copy link

jamiew commented Sep 4, 2021

This app is awesome and you are awesome for making and sharing it. Have you already started on a package for Homebrew? Happy to help contribute if not

@mathaou
Copy link
Owner

mathaou commented Sep 4, 2021

No idea what that even is so go for it!

@mathaou mathaou added help wanted Extra attention is needed enhancement New feature or request labels Sep 4, 2021
@u5surf
Copy link

u5surf commented Sep 5, 2021

@jamiew @mathaou
Hi, I consider that it is easy to use GitHub Actions and GoReleaser.

  1. we should make new repository homebrew-termdbms, it is necessary for publishing with brew tap
    https://github.com/Homebrew/brew/blob/master/docs/Taps.md
  2. we should prepare the .github/workflows/release.yml and .goreleaser.yml like that

.github/workflows/release.yml

name: release
on:
  push:
    tags:
      - "v[0-9]+.[0-9]+.[0-9]+"
jobs:
  goreleaser:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v2
        with:
          fetch-depth: 1
      - name: Setup Go
        uses: actions/setup-go@v2
        with:
          go-version: 1.15
      - name: Run GoReleaser
        uses: goreleaser/goreleaser-action@v2
        with:
          version: latest
          args: release --rm-dist
        env:
          GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN }}

.goreleaser.yml

project_name: termdbms
env:
  - GO111MODULE=on
before:
  hooks:
    - go mod tidy
builds:
  - main: .
    binary: termdbms
    ldflags: -s -w -X main.version={{.Version}} -X main.revision={{.ShortCommit}} -X main.date={{.Date}}
archives:
  - replacements:
      darwin: darwin
      linux: linux
      windows: windows
      amd64: x86_64
    files:
      - LICENSE
      - CREDITS
release:
  prerelease: auto
brews:
  - tap:
      owner: mathaou
      name: homebrew-termdbms
    folder: Formula
    homepage: 'https://github.com/mathaou/termdbms'
    description: 'Generates the URL link in various formats'
    license: "foo"

c.f.:
https://goreleaser.com/ci/actions/
https://goreleaser.com/customization/homebrew/

and, we also have to prepare the two files LICENSE and CREDITS.
CREDITS is necessary in which was written using not only third party library's license but also standard ones
It's suitable for us to use https://github.com/Songmu/gocredits for making CREDITS

@mathaou
Copy link
Owner

mathaou commented Sep 5, 2021

@u5surf sounds good! I'm completely green when it comes to this kind of stuff, but if you feel so inclined I'd greatly appreciate the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants