Skip to content

Commit

Permalink
Add goreleaser
Browse files Browse the repository at this point in the history
  • Loading branch information
winebarrel committed Jun 17, 2023
1 parent 07e79c3 commit 71785ed
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 0 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: goreleaser
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+
jobs:
cronplan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-go@v4
with:
go-version: ">=1.20.5"
- name: Release cronplan
uses: goreleaser/goreleaser-action@v4
with:
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
20 changes: 20 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
before:
hooks:
- go mod tidy
builds:
- main: ./cmd/jhol
ldflags:
- -X main.version={{.Version}}
env:
- CGO_ENABLED=0
checksum:
name_template: "checksums.txt"
brews:
- tap:
owner: winebarrel
name: homebrew-jhol
homepage: https://github.com/winebarrel/jhol
description: CLI to display and check Japanese holidays.
license: MIT
install: |
bin.install 'jhol'
41 changes: 41 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,3 +45,44 @@ func main() {
fmt.Println(holidays) //=> [2023-07-17 海の日 2023-08-11 山の日]
}
```

## CLI

### Installation

```
brew install winebarrel/jhol/jhol
```

## Usage

```
Usage: main --api-key=STRING <command>
Flags:
-h, --help Show context-sensitive help.
--version
--api-key=STRING Google API Key ($GOOGLE_API_KEY)
--lang="ja" Calendar language (ja, en).
Commands:
next --api-key=STRING [<n>]
Show next holidays.
is-holiday --api-key=STRING [<date>]
Check whether the specified date is a holiday.
Run "main <command> --help" for more information on a command.
```

```
$ export GOOGLE_API_KEY=...
$ jhol next
2023-07-17 海の日
2023-08-11 山の日
2023-09-18 敬老の日
$ jhol is-holiday 2023-07-17
true
```

0 comments on commit 71785ed

Please sign in to comment.