Skip to content

Commit

Permalink
Support install double-entry-generator via homebrew 🎉 (#64)
Browse files Browse the repository at this point in the history
* feat: support homebrew 🎉

add `brews` in `goreleaser.yml`
chore: ignore building `windows/arm64`
use gh app to generate org-scoped access token

Signed-off-by: Triple-Z <me@triplez.cn>

* doc: add homebrew installation

Signed-off-by: Triple-Z <me@triplez.cn>

Signed-off-by: Triple-Z <me@triplez.cn>
  • Loading branch information
Triple-Z authored Aug 31, 2022
1 parent 5f6a012 commit 188118f
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 6 deletions.
15 changes: 13 additions & 2 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,18 @@ permissions:

jobs:
goreleaser:
permissions:
id-token: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Create GitHub App Installation Token
uses: jnwng/github-app-installation-token-action@v2
id: installationToken
with:
appId: 233273
installationId: 28742230
privateKey: ${{ secrets.GH_APP_PRIVATE_KEY }}
-
name: Checkout
uses: actions/checkout@v2
Expand All @@ -25,9 +35,10 @@ jobs:
go-version: 1.16
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v2
uses: goreleaser/goreleaser-action@v3
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ steps.installationToken.outputs.token }}
46 changes: 43 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,34 @@ before:
hooks:
- go mod tidy
builds:
- env:
-
id: double-entry-generator
env:
- CGO_ENABLED=0
binary: double-entry-generator
goos:
- linux
- windows
- darwin
goarch:
- 386
- amd64
- arm64
# List of combinations of GOOS + GOARCH + GOARM to ignore.
ignore:
- goos: darwin
goarch: 386
- goos: windows
goarch: arm64
ldflags:
- -s -w -X github.com/deb-sig/double-entry-generator/pkg/version.VERSION={{.Version}} -X github.com/deb-sig/double-entry-generator/pkg/version.REPOROOT=github.com/deb-sig/double-entry-generator -X github.com/deb-sig/double-entry-generator/pkg/version.COMMIT={{.ShortCommit}}
- -s -w
- -X github.com/deb-sig/double-entry-generator/pkg/version.VERSION={{.Version}}
- -X github.com/deb-sig/double-entry-generator/pkg/version.REPOROOT=github.com/deb-sig/double-entry-generator
- -X github.com/deb-sig/double-entry-generator/pkg/version.COMMIT={{.ShortCommit}}
archives:
- replacements:
-
id: double-entry-generator
replacements:
darwin: Darwin
linux: Linux
windows: Windows
Expand All @@ -30,3 +47,26 @@ changelog:
exclude:
- '^docs:'
- '^test:'
universal_binaries:
- replace: true
brews:
-
name: double-entry-generator
ids:
- double-entry-generator
tap:
owner: deb-sig
name: homebrew-tap
branch: main
commit_author:
name: TripleZ
email: me@triplez.cn
folder: Formula
homepage: https://github.com/deb-sig/double-entry-generator
description: Rule-based double-entry bookkeeping importer (from Alipay/WeChat/Huobi to Beancount).
license: Apache-2.0
# skip_upload: auto
caveats: |
Please run `double-entry-generator help` for more help.
test: |
system "#{bin}/double-entry-generator version"
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,20 @@

## 安装

### Homebrew

使用 Homebrew 安装:

```bash
$ brew install deb-sig/tap/double-entry-generator
```

### 二进制安装

[GitHub Release](https://github.com/deb-sig/double-entry-generator/releases) 页面中下载相应架构的二进制文件到本地即可。

源码安装:
### 源码安装

```bash
go get -u github.com/deb-sig/double-entry-generator
```
Expand Down

0 comments on commit 188118f

Please sign in to comment.