-
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.
chore: update release process and to golang117 (#13)
* chore(ci): switch to GH actions and goreleaser * chore: bump to Golang 1.17 * chore(ci): switch to matrix build for testing
- Loading branch information
Showing
153 changed files
with
811 additions
and
28,335 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,28 @@ | ||
<!-- Please replace {Please write here} with your description --> | ||
|
||
|
||
## Expected Behavior | ||
|
||
{Please write here} | ||
|
||
|
||
## Actual Behavior | ||
|
||
{Please write here} | ||
|
||
|
||
## Steps to Reproduce (including precondition) | ||
|
||
{Please write here} | ||
|
||
|
||
## Screenshot on This Problem (if possible) | ||
|
||
{Please write here} | ||
|
||
|
||
## Your Environment | ||
|
||
- OS: {Please write here} | ||
- binary version: {Please write here} | ||
|
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 @@ | ||
<!-- Thank you for your contribution to envplate! Please replace {Please write here} with your description --> | ||
|
||
|
||
## What does this do / why do we need it? | ||
|
||
{Please write here} | ||
|
||
|
||
## How this PR fixes the problem? | ||
|
||
{Please write here} | ||
|
||
|
||
## What should your reviewer look out for in this PR? | ||
|
||
{Please write here} | ||
|
||
|
||
## Check lists | ||
|
||
* [ ] Test passed | ||
* [ ] Coding style (indentation, etc) | ||
|
||
|
||
## Additional Comments (if any) | ||
|
||
{Please write here} | ||
|
||
|
||
## Which issue(s) does this PR fix? | ||
|
||
<!-- | ||
fixes # | ||
fixes # | ||
--> |
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 @@ | ||
name: build | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
types: ['opened', 'synchronize'] | ||
paths: | ||
- '**.go' | ||
- go.mod | ||
- '.github/workflows/**' | ||
|
||
jobs: | ||
binaries: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist --skip-publish --snapshot --skip-sign --debug |
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 @@ | ||
name: goreleaser | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
goreleaser: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Go | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.17 | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v2 | ||
with: | ||
version: latest | ||
args: release --rm-dist | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
GORELEASER_TOKEN: ${{ secrets.GORELEASER_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,31 @@ | ||
name: tests | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- 'README.md' | ||
pull_request: | ||
types: ['opened', 'synchronize'] | ||
paths-ignore: | ||
- 'README.md' | ||
jobs: | ||
unit: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-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.17 | ||
- name: Run tests | ||
run: go test -v -race -cover | ||
|
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 |
---|---|---|
|
@@ -4,3 +4,5 @@ build/ | |
example/test.envs | ||
keys/secret | ||
manifest | ||
.vscode | ||
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,39 @@ | ||
before: | ||
hooks: | ||
- go mod tidy | ||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
goos: | ||
- darwin | ||
- linux | ||
goarch: | ||
- arm64 | ||
- amd64 | ||
- "386" | ||
goarm: | ||
- 6 | ||
main: ./bin/es.go | ||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ incpatch .Tag }}-next" | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
brews: | ||
- tap: | ||
owner: kreuzwerker | ||
name: homebrew-taps | ||
token: "{{ .Env.GORELEASER_TOKEN }}" | ||
homepage: "https://github.com/kreuzwerker/envsec" | ||
description: "git@github.com:kreuzwerker/envsec.git." |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,25 +1,15 @@ | ||
VERSION := "1.1.0" | ||
VERSION := $(shell git describe --abbrev=7 --always) | ||
REPO := envsec | ||
USER := kreuzwerker | ||
FLAGS := "-X=main.build=`git rev-parse --short HEAD` -X=main.version=$(VERSION)" | ||
|
||
GITHUB_TOKEN ?= $(shell cat .token) | ||
export GITHUB_TOKEN | ||
FLAGS := "-X=main.build=$(VERSION) -X=main.version=$(VERSION)" | ||
|
||
.PHONY: build clean release retract | ||
|
||
build: | ||
cd bin && gox -osarch="linux/amd64 linux/arm darwin/amd64" -ldflags $(FLAGS) -output "../build/{{.OS}}-{{.Arch}}/es"; | ||
mkdir -p build | ||
GOOS=linux GOARCH=amd64 go build -ldflags $(FLAGS) -o build/linux-amd64/ep bin/es.go | ||
GOOS=linux GOARCH=arm go build -ldflags $(FLAGS) -o build/linux-arm/ep bin/es.go | ||
GOOS=darwin GOARCH=amd64 go build -ldflags $(FLAGS) -o build/darwin-amd64/ep bin/es.go | ||
|
||
clean: | ||
rm -rf build | ||
|
||
release: clean build | ||
git tag $(VERSION) -f && git push --tags -f | ||
github-release release --user $(USER) --repo $(REPO) --tag $(VERSION) | ||
github-release upload --user $(USER) --repo $(REPO) --tag $(VERSION) --name es-linux --file build/linux-amd64/es | ||
github-release upload --user $(USER) --repo $(REPO) --tag $(VERSION) --name es-linux-arm --file build/linux-arm/es | ||
github-release upload --user $(USER) --repo $(REPO) --tag $(VERSION) --name es-osx --file build/darwin-amd64/es | ||
|
||
retract: | ||
github-release delete --tag $(VERSION) | ||
rm -rf build |
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 @@ | ||
module github.com/kreuzwerker/envsec | ||
|
||
go 1.17 | ||
|
||
require ( | ||
github.com/aws/aws-sdk-go v1.41.6 | ||
github.com/joho/godotenv v1.4.0 | ||
github.com/spf13/cobra v1.2.1 | ||
github.com/stretchr/testify v1.7.0 | ||
github.com/yawn/doubledash v0.0.0-20151212175516-fd8a81db93af | ||
github.com/yawn/envmap v0.0.0-20160813152305-a78254303070 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/inconshreveable/mousetrap v1.0.0 // indirect | ||
github.com/jmespath/go-jmespath v0.4.0 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect | ||
) |
Oops, something went wrong.