-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
10cde75
commit 3529dfe
Showing
4 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
branches: | ||
- 'main' | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
env: | ||
TZ: "America/New_York" | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- | ||
name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: "1.21" | ||
- | ||
name: Tests | ||
run: | | ||
go mod tidy | ||
go test ./... | ||
- | ||
name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v5 | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HOMEBREW_TAP_GITHUB_TOKEN: ${{ secrets.HOMEBREW_TAP_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
*.swp | ||
diary.yaml* | ||
places.yaml | ||
dist/ | ||
completions/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
--- | ||
before: | ||
hooks: | ||
- go mod tidy | ||
- ./scripts/completions.sh | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
main: ./cmd/letseat/ | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
ldflags: | ||
- '-s -w' | ||
- -X github.com/drewstinnett/letseat/cmd/letseat/cmd.date={{ .CommitTimestamp }} | ||
- -X github.com/drewstinnett/letseat/cmd/letseat/cmd.version={{ .Tag }} | ||
- -X github.com/drewstinnett/letseat/cmd/letseat/cmd.commit={{ .ShortCommit }} | ||
flags: | ||
- -trimpath | ||
goos: | ||
- darwin | ||
- linux | ||
- windows | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
ignore: | ||
- goos: darwin | ||
goarch: '386' | ||
binary: 'letseat' | ||
archives: | ||
- format: tar.gz | ||
name_template: 'letseat-{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
files: | ||
- completions/* | ||
checksum: | ||
name_template: 'letseat-{{ .Version }}_SHA256SUMS' | ||
algorithm: sha256 | ||
snapshot: | ||
name_template: "{{ .Tag }}-snapshot" | ||
changelog: | ||
skip: true | ||
brews: | ||
- name: 'letseat' | ||
repository: | ||
owner: drewstinnett | ||
name: homebrew-letseat | ||
token: "{{ .Env.HOMEBREW_TAP_GITHUB_TOKEN }}" | ||
description: "Figure out where to go for dinner!" | ||
homepage: "https://github.com/drewstinnett/letseat" | ||
license: BSD-2-Clause | ||
caveats: | | ||
Add the following in your ~/.zshrc or ~/.profile for faster typin': | ||
alias tp="#{opt_bin}/letseat" | ||
install: |- | ||
bin.install "letseat" | ||
bash_completion.install "completions/letseat.bash" => "letseat" | ||
zsh_completion.install "completions/letseat.zsh" => "_letseat" | ||
fish_completion.install "completions/letseat.fish" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#!/bin/sh | ||
set -e | ||
rm -rf completions | ||
mkdir completions | ||
for sh in bash zsh fish; do | ||
go run ./cmd/letseat completion "$sh" >"completions/letseat.$sh" | ||
done |