-
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
Showing
6 changed files
with
158 additions
and
14 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,34 @@ | ||
name: Tests | ||
|
||
on: push | ||
|
||
jobs: | ||
unit-test: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14 | ||
id: go | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Run unit tests | ||
run: make unit | ||
|
||
static: | ||
runs-on: ubuntu-18.04 | ||
steps: | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14 | ||
id: go | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Run static linters | ||
run: make static |
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,26 @@ | ||
name: Release | ||
|
||
on: push | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-18.04 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
steps: | ||
- name: Set up Go 1.14 | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.14 | ||
id: go | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: recursive | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.COMMITER_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,2 +1,3 @@ | ||
/coverage.out | ||
/bin/ | ||
dist/ |
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,57 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- linux | ||
- darwin | ||
ldflags: | ||
- -s -w | ||
- -X github.com/little-angry-clouds/particle/cmd.Version={{.Version}} | ||
- -X github.com/little-angry-clouds/particle/cmd.Commit={{.Commit}} | ||
- -X github.com/little-angry-clouds/particle/cmd.Date={{.Date}} | ||
goarch: | ||
- amd64 | ||
- arm | ||
- arm64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- '^ci:' | ||
release: | ||
github: | ||
owner: little-angry-clouds | ||
name: particle | ||
draft: true | ||
brews: | ||
- name: particle | ||
tap: | ||
owner: little-angry-clouds | ||
name: homebrew-my-brews | ||
url_template: "https://github.com/little-angry-clouds/homebrew-my-brews{{ .Tag }}/{{ .ArtifactName }}" | ||
commit_author: | ||
name: goreleaserbot | ||
email: [email protected] | ||
folder: Formula | ||
homepage: https://github.com/little-angry-clouds/particle/ | ||
description: Particle is a project designed to aid in the development and testing of Helm charts and other kubernetes manifests. | ||
license: "GPL3" | ||
dependencies: | ||
- name: go | ||
- name: helm | ||
type: optional | ||
- name: kind | ||
type: optional | ||
install: | | ||
ENV.prepend "CGO_ENABLED", "0" | ||
system "go", "build", "-a", "-o", "particle.bin", "main.go" | ||
bin.install "particle.bin" => "#{bin}/particle" |
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,30 @@ | ||
package cmd | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
goVersion "go.hein.dev/go-version" | ||
) | ||
|
||
var ( | ||
Version = "dev" | ||
Commit = "none" | ||
Date = "unknown" | ||
shortened = false | ||
output = "json" | ||
versionCmd = &cobra.Command{ | ||
Use: "version", | ||
Short: "Outputs the current build information", | ||
Run: func(_ *cobra.Command, _ []string) { | ||
resp := goVersion.FuncWithOutput(shortened, Version, Commit, Date, output) | ||
fmt.Print(resp) | ||
}, | ||
} | ||
) | ||
|
||
func init() { | ||
versionCmd.Flags().BoolVar(&shortened, "short", false, "Print just the version number.") | ||
versionCmd.Flags().StringVar(&output, "output", "yaml", "Output format. One of 'yaml' or 'json'.") | ||
rootCmd.AddCommand(versionCmd) | ||
} |