-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
install CI/CD auto-release, bump dependencies
- Loading branch information
Showing
225 changed files
with
8,379 additions
and
4,907 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,61 @@ | ||
name: build-and-release | ||
|
||
on: | ||
push: | ||
# not not consider simplec commit | ||
branches: | ||
- '!*' | ||
# consider only release and pre-release tags | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
- 'v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: set up go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.15 | ||
|
||
- name: cache go modules | ||
uses: actions/cache@v1 | ||
with: | ||
path: ~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: tests modules | ||
run: | | ||
go mod vendor | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
echo "::error::vendor directory if not synched with go.mod, please run go mod vendor" | ||
exit 1 | ||
fi | ||
go mod tidy | ||
if [ ! -z "$(git status --porcelain)" ]; then | ||
echo "::error::modules are not tidy, please run go mod tidy" | ||
exit 1 | ||
fi | ||
- name: tests | ||
run: | | ||
go test -v ./... | ||
- name: run goreleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
if: success() && startsWith(github.ref, 'refs/tags/') | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
USER: github-actions |
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,45 +1,49 @@ | ||
# This is an example goreleaser.yaml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
before: | ||
hooks: | ||
# you may remove this if you don't use vgo | ||
- go mod download | ||
# you may remove this if you don't need go generate | ||
- go generate ./... | ||
project_name: credhub_exporter | ||
|
||
builds: | ||
- goos: | ||
- linux | ||
- darwin | ||
- | ||
&template | ||
id: binary | ||
binary: credhub_exporter | ||
env: | ||
- CGO_ENABLED=0 | ||
ldflags: | ||
- -s -w | ||
- -s | ||
- -w | ||
- -X github.com/prometheus/common/version.Version={{.Version}} | ||
- -X github.com/prometheus/common/version.Revision={{.Commit}} | ||
- -X github.com/prometheus/common/version.Branch=master | ||
- -X github.com/prometheus/common/version.BuildDate={{.Date}} | ||
- -X github.com/prometheus/common/version.Revision={{.FullCommit}} | ||
- -X github.com/prometheus/common/version.Branch={{.Branch}} | ||
- -X github.com/prometheus/common/version.BuildUser={{.Env.USER}} | ||
- -X github.com/prometheus/common/version.BuildDate={{.Date}} | ||
goos: | ||
- linux | ||
- darwin | ||
goarch: | ||
- amd64 | ||
env: | ||
- CGO_ENABLED=0 | ||
id: binary | ||
main: . | ||
binary: credhub_exporter | ||
|
||
archives: | ||
- id: zip-archive-provider | ||
builds: [binary] | ||
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}" | ||
format: zip | ||
- id: binary-archive-provider | ||
builds: [binary] | ||
name_template: "{{ .Binary }}_{{ .Os }}_{{ .Arch }}" | ||
format: binary | ||
- id: archives | ||
builds: | ||
- binary | ||
format: "tar.gz" | ||
name_template: '{{ .ProjectName }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}' | ||
wrap_in_directory: true | ||
files: | ||
- LICENSE* | ||
- README* | ||
- CHANGELOG* | ||
- docs/* | ||
- assets/* | ||
- static/* | ||
- templates/* | ||
|
||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
name_template: checksums.txt | ||
algorithm: sha256 | ||
|
||
release: | ||
github: | ||
owner: orange-cloudfoundry | ||
name: credhub_exporter | ||
prerelease: auto | ||
name_template: '{{.Tag}}' |
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
Oops, something went wrong.