forked from gojekfarm/iap_auth
-
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.
Merge pull request #1 from goto/fix-ci
fix: ci using goreleaser and github
- Loading branch information
Showing
22 changed files
with
560 additions
and
194 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Lint | ||
on: [push, workflow_dispatch] | ||
|
||
jobs: | ||
golangci-lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21 | ||
- name: golangci-lint | ||
uses: golangci/golangci-lint-action@v2 | ||
with: | ||
skip-go-installation: true | ||
version: v1.54.2 | ||
args: --timeout=10m |
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 @@ | ||
name: release | ||
|
||
on: | ||
push: | ||
tags: | ||
- "v*.*.*" | ||
workflow_dispatch: | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Set up Go 1.x | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21 | ||
id: go | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Test | ||
run: make test | ||
- name: Get release tag | ||
id: get_version | ||
uses: battila7/get-version-action@v2 | ||
- name: Login to DockerHub | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- name: Run GoReleaser | ||
uses: goreleaser/goreleaser-action@v4 | ||
with: | ||
distribution: goreleaser | ||
version: latest | ||
args: release --clean | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GO_RELEASER_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,24 @@ | ||
name: Test | ||
on: [push] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out code into the Go module directory | ||
uses: actions/checkout@v2 | ||
- name: Set up Go 1.21 | ||
uses: actions/setup-go@v2 | ||
with: | ||
go-version: 1.21 | ||
id: go | ||
- name: Install dependencies | ||
run: sudo apt-get install build-essential | ||
- name: Install packages | ||
run: go mod tidy | ||
- name: Run Test | ||
run: make test | ||
- name: Send coverage to coveralls | ||
uses: shogo82148/actions-goveralls@v1 | ||
with: | ||
path-to-profile: coverage.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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,3 +2,5 @@ out/ | |
*.swp | ||
.idea/* | ||
iap.conf.toml | ||
# Output of the go coverage tool, specifically when used with LiteIDE | ||
*.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
linters: | ||
disable: | ||
- errcheck |
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,24 +1,83 @@ | ||
# This is an example goreleaser.yaml file with some sane defaults. | ||
# Make sure to check the documentation at http://goreleaser.com | ||
project_name: iap_auth | ||
|
||
release: | ||
draft: true | ||
prerelease: auto | ||
name_template: "{{.ProjectName}}-v{{.Version}}" | ||
|
||
before: | ||
hooks: | ||
- go mod tidy | ||
- go mod vendor | ||
|
||
builds: | ||
- env: | ||
- CGO_ENABLED=0 | ||
- GO111MODULE=on | ||
- main: ./main.go | ||
id: "iap_auth" | ||
binary: iap_auth | ||
flags: | ||
- -a | ||
ldflags: | ||
- -s -w -X github.com/goto/iap_auth/config.Version={{.Tag}} -X github.com/goto/iap_auth/config.BuildCommit={{.FullCommit}} -X github.com/goto/iap_auth/config.BuildDate={{.Date}} | ||
env: | ||
- CGO_ENABLED=0 | ||
goos: [darwin, linux, windows] | ||
goarch: [amd64, 386] | ||
|
||
|
||
archives: | ||
- replacements: | ||
darwin: Darwin | ||
linux: Linux | ||
windows: Windows | ||
386: i386 | ||
amd64: x86_64 | ||
checksum: | ||
name_template: 'checksums.txt' | ||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
- name_template: >- | ||
{{ .ProjectName }}_ | ||
{{- title .Os }}_ | ||
{{- if eq .Arch "amd64" }}x86_64 | ||
{{- else if eq .Arch "386" }}i386 | ||
{{- else if eq .Arch "windows" }}windows | ||
{{- else if eq .Arch "linux" }}linux | ||
{{- else if eq .Arch "darwin" }}macos | ||
{{- else }}{{ .Arch }}{{ end }} | ||
format_overrides: | ||
- goos: windows | ||
format: zip | ||
changelog: | ||
sort: asc | ||
filters: | ||
exclude: | ||
- '^docs:' | ||
- '^test:' | ||
- "^docs:" | ||
- "^test:" | ||
- "^build:" | ||
- "Merge pull request" | ||
- "Merge branch" | ||
|
||
checksum: | ||
name_template: "checksums.txt" | ||
|
||
snapshot: | ||
name_template: "{{ .Tag }}-next" | ||
|
||
dockers: | ||
- goos: linux | ||
goarch: amd64 | ||
ids: | ||
- iap_auth | ||
dockerfile: Dockerfile | ||
image_templates: | ||
- "docker.io/gotocompany/{{.ProjectName}}:latest" | ||
- "docker.io/gotocompany/{{.ProjectName}}:{{ .Version }}" | ||
- "docker.io/gotocompany/{{.ProjectName}}:{{ .Tag }}-amd64" | ||
|
||
brews: | ||
- name: iap_auth | ||
homepage: "https://github.com/goto/iap_auth" | ||
description: "Accessing service behind IAP." | ||
repository: | ||
owner: goto | ||
name: homebrew-taps | ||
license: "Apache 2.0" | ||
folder: Formula | ||
dependencies: | ||
- name: git | ||
install: |- | ||
bin.install "iap_auth" | ||
commit_author: | ||
name: github-actions[bot] | ||
email: 41898282+github-actions[bot]@users.noreply.github.com |
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 |
---|---|---|
@@ -1,13 +1,39 @@ | ||
module github.com/gojekfarm/iap_auth | ||
module github.com/goto/iap_auth | ||
|
||
go 1.21.6 | ||
|
||
require ( | ||
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2 | ||
github.com/sirupsen/logrus v1.9.3 | ||
github.com/spf13/viper v1.18.2 | ||
github.com/stretchr/testify v1.8.4 | ||
golang.org/x/oauth2 v0.17.0 | ||
) | ||
|
||
require ( | ||
github.com/asaskevich/govalidator v0.0.0-20180720115003-f9ffefc3facf | ||
github.com/golang/lint v0.0.0-20181217174547-8f45f776aaf1 // indirect | ||
github.com/sirupsen/logrus v1.3.0 | ||
github.com/spf13/viper v1.3.1 | ||
github.com/stretchr/testify v1.2.2 | ||
golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1 // indirect | ||
golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e | ||
golang.org/x/oauth2 v0.0.0-20190130055435-99b60b757ec1 | ||
golang.org/x/tools v0.0.0-20190202235157-7414d4c1f71c // indirect | ||
cloud.google.com/go/compute v1.24.0 // indirect | ||
cloud.google.com/go/compute/metadata v0.2.3 // indirect | ||
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect | ||
github.com/fsnotify/fsnotify v1.7.0 // indirect | ||
github.com/golang/protobuf v1.5.3 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/magiconair/properties v1.8.7 // indirect | ||
github.com/mitchellh/mapstructure v1.5.0 // indirect | ||
github.com/pelletier/go-toml/v2 v2.1.1 // indirect | ||
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect | ||
github.com/sagikazarmark/locafero v0.4.0 // indirect | ||
github.com/sagikazarmark/slog-shim v0.1.0 // indirect | ||
github.com/sourcegraph/conc v0.3.0 // indirect | ||
github.com/spf13/afero v1.11.0 // indirect | ||
github.com/spf13/cast v1.6.0 // indirect | ||
github.com/spf13/pflag v1.0.5 // indirect | ||
github.com/subosito/gotenv v1.6.0 // indirect | ||
go.uber.org/multierr v1.11.0 // indirect | ||
golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 // indirect | ||
golang.org/x/sys v0.17.0 // indirect | ||
golang.org/x/text v0.14.0 // indirect | ||
google.golang.org/appengine v1.6.8 // indirect | ||
google.golang.org/protobuf v1.32.0 // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.