mathaou / termdbms

A TUI for viewing and editing database files.
MIT License
1.7k stars 36 forks source link

Publish a Homebrew package #8

Open jamiew opened 3 years ago

jamiew commented 3 years ago

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 commented 3 years ago

No idea what that even is so go for it!

u5surf commented 3 years ago

@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 commented 3 years ago

@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!