-
Notifications
You must be signed in to change notification settings - Fork 191
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
9 changed files
with
158 additions
and
8 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,22 @@ | ||
{{ range .Versions }} | ||
<a name="{{ .Tag.Name }}"></a> | ||
## {{ if .Tag.Previous }}[{{ .Tag.Name }}]({{ $.Info.RepositoryURL }}/compare/{{ .Tag.Previous.Name }}...{{ .Tag.Name }}){{ else }}{{ .Tag.Name }}{{ end }} ({{ datetime "2006-01-02" .Tag.Date }}) | ||
|
||
{{ range .CommitGroups -}} | ||
### {{ .Title }} | ||
|
||
{{ range .Commits -}} | ||
* {{ .Subject }} | ||
{{ end }} | ||
{{ end -}} | ||
|
||
{{- if .NoteGroups -}} | ||
{{ range .NoteGroups -}} | ||
### {{ .Title }} | ||
|
||
{{ range .Notes }} | ||
{{ .Body }} | ||
{{ end }} | ||
{{ end -}} | ||
{{ end -}} | ||
{{ end -}} |
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,21 @@ | ||
style: github | ||
template: CHANGELOG.tpl.md | ||
info: | ||
title: CHANGELOG | ||
repository_url: https://github.com/IBM/argocd-vault-plugin | ||
options: | ||
commits: | ||
filters: | ||
Type: | ||
- feat | ||
- fix | ||
- perf | ||
- refactor | ||
header: | ||
pattern: "^(\\w*)\\:\\s(.*)$" | ||
pattern_maps: | ||
- Type | ||
- Subject | ||
notes: | ||
keywords: | ||
- BREAKING CHANGE |
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,43 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set Tag | ||
id: tag | ||
run: echo ::set-output name=tag::${GITHUB_REF#refs/*/} | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.16 | ||
|
||
- name: Install git-chglog | ||
run: GO111MODULE=off go get github.com/git-chglog/git-chglog/cmd/git-chglog | ||
|
||
- name: generate changelog | ||
run: | | ||
$(go env GOPATH)/bin/git-chglog \ | ||
-c .chglog/config.yml \ | ||
-o RELEASE_CHANGELOG.md \ | ||
${{ steps.tag.outputs.tag }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --rm-dist --release-notes=RELEASE_CHANGELOG.md | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.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,10 +1,10 @@ | ||
argocd-vault-plugin | ||
RELEASE_CHANGELOG.md | ||
bin | ||
.DS_Store | ||
.chglog | ||
test | ||
cover.out | ||
|
||
# Project workspaces | ||
.idea | ||
.vscode | ||
.vscode |
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,27 @@ | ||
project_name: "argocd-vault-plugin" | ||
|
||
builds: | ||
- binary: "argocd-vault-plugin" | ||
flags: "-trimpath" | ||
ldflags: >- | ||
-s -w | ||
-X "github.com/IBM/argocd-vault-plugin/version.Version={{.Tag}}" | ||
-X "github.com/IBM/argocd-vault-plugin/version.BuildDate={{.Date}}" | ||
-X "github.com/IBM/argocd-vault-plugin/version.CommitSHA={{.Commit}}" | ||
env: | ||
- "CGO_ENABLED=0" | ||
goos: | ||
- darwin | ||
- linux | ||
goarch: | ||
- amd64 | ||
- arm64 | ||
tags: | ||
- netgo | ||
- static_build | ||
|
||
archives: | ||
- format: binary | ||
|
||
changelog: | ||
skip: 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
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,35 @@ | ||
package cmd | ||
|
||
import ( | ||
"bytes" | ||
"io/ioutil" | ||
"strings" | ||
"testing" | ||
|
||
"github.com/IBM/argocd-vault-plugin/version" | ||
) | ||
|
||
func TestVersion(t *testing.T) { | ||
t.Run("will show version", func(t *testing.T) { | ||
args := []string{} | ||
cmd := NewVersionCommand() | ||
|
||
version.Version = "v0.0.1" | ||
version.BuildDate = "1970-01-01T:00:00:00Z" | ||
version.CommitSHA = "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA" | ||
|
||
c := bytes.NewBufferString("") | ||
cmd.SetArgs(args) | ||
cmd.SetOut(c) | ||
cmd.Execute() | ||
out, err := ioutil.ReadAll(c) // Read buffer to bytes | ||
if err != nil { | ||
t.Fatal(err) | ||
} | ||
|
||
expected := "argocd-vault-plugin v0.0.1 (AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA) BuildDate: 1970-01-01T:00:00:00Z" | ||
if !strings.Contains(string(out), expected) { | ||
t.Fatalf("expected to contain: %s but got %s", expected, out) | ||
} | ||
}) | ||
} |
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