-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds GitHub actions for continuous integration and testing and uses the goreleaser GitHub action for continuous deployment.
- Loading branch information
Showing
8 changed files
with
316 additions
and
9 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,69 @@ | ||
name: CI | ||
on: | ||
push: | ||
branches: | ||
- main | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
|
||
jobs: | ||
lint: | ||
name: Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Install Staticcheck | ||
run: go install honnef.co/go/tools/cmd/staticcheck@latest | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Lint Go Code | ||
run: staticcheck ./... | ||
|
||
test: | ||
name: Test | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: go version | ||
|
||
- name: Run Unit Tests | ||
run: go test -v -coverprofile=coverage.txt -covermode=atomic --race ./... | ||
|
||
- name: Upload Coverage report to CodeCov | ||
uses: codecov/[email protected] | ||
with: | ||
token: ${{secrets.CODECOV_TOKEN}} | ||
file: ./coverage.txt | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install Dependencies | ||
run: go version | ||
|
||
- name: Build | ||
run: go build ./cmd/... |
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,37 @@ | ||
name: CD | ||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
|
||
jobs: | ||
release: | ||
name: Release on GitHub | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Import GPG key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v3 | ||
with: | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.PASSPHRASE }} | ||
|
||
- name: Create Release | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} | ||
GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }} |
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,140 @@ | ||
project_name: whisper | ||
dist: dist | ||
builds: | ||
# Define multiple builds as a yaml list, specify by a unique ID | ||
- id: "cmd-whisper-build" | ||
|
||
# Path to project's (sub)directory containing Go code. | ||
dir: . | ||
|
||
# Path to main.go file or main package. | ||
main: ./cmd/whisper | ||
|
||
# Binary name (can be a path to wrap binary in a directory) | ||
binary: whisper | ||
|
||
# Custom flags templates | ||
flags: | ||
- -v | ||
|
||
# Custom ldflags templates. | ||
ldflags: -s -w -X main.version={{.Version}} -X main.commit={{.Commit}} -X main.date={{.Date}} | ||
|
||
# Custom environment variables to be set during the build | ||
env: | ||
- CGO_ENABLED=0 | ||
|
||
# GOOS list to build for | ||
# For more info refer to: https://golang.org/doc/install/source#environment | ||
goos: | ||
- linux | ||
- darwin | ||
|
||
# GOARCH to build for. | ||
# For more info refer to: https://golang.org/doc/install/source#environment | ||
goarch: | ||
- amd64 | ||
- "386" | ||
- arm64 | ||
|
||
# GOARM to build for when GOARCH is arm. | ||
# For more info refer to: https://golang.org/doc/install/source#environment | ||
goarm: | ||
- "6" | ||
|
||
# List of combinations of GOOS + GOARCH + GOARM to ignore. | ||
ignore: | ||
- goos: darwin | ||
goarch: 386 | ||
|
||
# Set the modified timestamp on the output binary, typically | ||
# you would do this to ensure a build was reproducible. Pass | ||
# empty string to skip modifying the output. | ||
mod_timestamp: '{{ .CommitTimestamp }}' | ||
|
||
# Create .tar.gz and .zip archives | ||
archives: | ||
# tar.gz archive of the binaries | ||
- id: "whisper-archive-tgz" | ||
format: tar.gz | ||
builds: | ||
- "cmd-whisper-build" | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
wrap_in_directory: true | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
# zip archive of the binaries | ||
- id: "whisper-archive-zip" | ||
format: zip | ||
builds: | ||
- "cmd-whisper-build" | ||
name_template: "{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}" | ||
wrap_in_directory: true | ||
files: | ||
- LICENSE | ||
- README.md | ||
|
||
# Used to validate if downloaded files are correct | ||
checksum: | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_checksums.txt' | ||
algorithm: sha256 | ||
|
||
# Publish the release on GitHub | ||
release: | ||
# Repo in which the release will be created. | ||
# Default is extracted from the origin remote URL or empty if its private hosted. | ||
# Valid options are either github, gitlab or gitea | ||
github: | ||
owner: rotationalio | ||
name: whisper | ||
|
||
# You can change the name of the release. | ||
name_template: '{{.Tag}}' | ||
|
||
# If set to auto, will mark the release as not ready for production | ||
# in case there is an indicator for this in the tag e.g. v1.0.0-rc1 | ||
# If set to true, will mark the release as not ready for production. | ||
prerelease: auto | ||
|
||
# Header for the release body. | ||
header: | | ||
The whisper service is an internal helper tool used at Rotational Labs to share | ||
secrets and secret files securely. We've made the code open source and are happy to | ||
have general contributions that enhance the project, and have made these releases | ||
freely available with no warranty to anyone who would like to use them. | ||
## Changes | ||
[TODO: describe changes] | ||
# Footer for the release body. | ||
footer: | | ||
### About | ||
Please note that this service is an internal-only tool and has been constructed as | ||
such. Rotational Labs makes no guarantees or warranties about the security of this | ||
software project and provides all compiled binaries as is for general use. Use at | ||
your own risk! | ||
# If set to true, will not auto-publish the release. | ||
disable: false | ||
|
||
changelog: | ||
# Set it to true if you wish to skip the changelog generation. | ||
skip: false | ||
|
||
filters: | ||
# Commit messages matching the regexp listed here will be removed from the changelog | ||
exclude: | ||
- (?i)typo | ||
- (?i)^f$ | ||
|
||
source: | ||
enabled: true | ||
format: 'zip' | ||
|
||
signs: | ||
- artifacts: checksum | ||
args: ["--batch", "-u", "{{ .Env.GPG_FINGERPRINT }}", "--output", "${signature}", "--detach-sign", "${artifact}"] |
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,10 @@ | ||
# Whisper | ||
|
||
[![Go Reference](https://pkg.go.dev/badge/github.com/rotationalio/whisper.svg)](https://pkg.go.dev/github.com/rotationalio/whisper) | ||
[![Go Report Card](https://goreportcard.com/badge/github.com/rotationalio/whisper)](https://goreportcard.com/report/github.com/rotationalio/whisper) | ||
![GitHub Actions CI](https://github.com/rotationalio/whisper/actions/workflows/build.yaml/badge.svg?branch=main) | ||
![GitHub Actions CD](https://github.com/rotationalio/whisper/actions/workflows/release.yaml/badge.svg) | ||
[![codecov](https://codecov.io/gh/bbengfort/whisper/branch/main/graph/badge.svg?token=fntqI5yFeY)](https://codecov.io/gh/bbengfort/whisper) | ||
|
||
|
||
**There are many secrets management utilities, this one is ours … shhh** |
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
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