-
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.
Merge pull request #4 from drewstinnett/chore-github-workflow
Chore: GitHub workflow
- Loading branch information
Showing
8 changed files
with
185 additions
and
4 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,29 @@ | ||
--- | ||
name: Coverage | ||
|
||
on: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
TZ: "America/New_York" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 'stable' | ||
- name: Run coverage | ||
run: go test -coverprofile=coverage.txt -covermode=atomic ./... | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v3 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
fail_ci_if_error: true | ||
files: ./coverage.txt | ||
name: codecov-umbrella | ||
verbose: true |
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Security Scans | ||
on: | ||
push: | ||
pull_request: | ||
jobs: | ||
security: | ||
runs-on: ubuntu-latest | ||
env: | ||
TZ: "America/New_York" | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
- uses: actions/setup-go@v4 | ||
with: | ||
go-version: 'stable' | ||
- id: govulncheck | ||
uses: golang/govulncheck-action@v1 |
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-tap | ||
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,25 @@ | ||
BSD 2-Clause License | ||
|
||
Copyright (c) 2021, Drew Stinnett | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without | ||
modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this | ||
list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, | ||
this list of conditions and the following disclaimer in the documentation | ||
and/or other materials provided with the distribution. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE | ||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, | ||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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
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 |