Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Go version, dependencies, and GoReleaser #59

Merged
merged 1 commit into from
Mar 21, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 8 additions & 11 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,20 @@ jobs:
shellcheck -x tag.sh
build:
docker:
- image: golang:1.12-alpine
- image: cimg/go:1.14
steps:
- setup_remote_docker
- checkout
- run:
name: Install tools
command: |
apk add bash build-base ca-certificates curl docker git openssh
curl -SLO https://github.com/goreleaser/goreleaser/releases/download/v0.104.0/goreleaser_Linux_x86_64.tar.gz
mkdir -p /usr/local/goreleaser
tar -xzf goreleaser_Linux_x86_64.tar.gz -C /usr/local/goreleaser
ln -s /usr/local/goreleaser/goreleaser /usr/local/bin/goreleaser
rm -rf goreleaser_Linux_x86_64.tar.gz
- checkout
command: ./setup.sh
- run:
name: gofmt
name: lint
command: |
gofmt -w -s . && git diff --exit-code
go vet -v ./...
goimports -w -l .
go mod tidy
git diff --exit-code
- run:
name: Build
command: |
Expand Down
14 changes: 7 additions & 7 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ builds:
-X github.com/helm/chart-releaser/cr/cmd.Version={{ .Tag }}
-X github.com/helm/chart-releaser/cr/cmd.GitCommit={{ .Commit }}
-X github.com/helm/chart-releaser/cr/cmd.BuildDate={{ .Date }}
archive:
format_overrides:
- goos: windows
format: zip
files:
- LICENSE
- README.md
archives:
- format_overrides:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch

- goos: windows
format: zip
files:
- LICENSE
- README.md
checksum:
name_template: 'checksums.txt'
snapshot:
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ main() {
pushd "$SCRIPT_DIR" > /dev/null

go mod download
go test ./...
go test ./... -race
goreleaser "${goreleaser_args[@]}"

popd > /dev/null
Expand Down
32 changes: 20 additions & 12 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,21 +1,29 @@
module github.com/helm/chart-releaser

go 1.12
go 1.14

require (
github.com/Songmu/retry v0.0.1
github.com/google/go-github v17.0.0+incompatible
github.com/google/go-querystring v1.0.0 // indirect
github.com/Azure/go-autorest/autorest/azure/auth v0.4.2 // indirect
github.com/Azure/go-autorest/autorest/to v0.3.0 // indirect
github.com/Azure/go-autorest/autorest/validation v0.2.0 // indirect
github.com/Songmu/retry v0.1.0
github.com/google/go-github/v30 v30.0.0
github.com/goreleaser/goreleaser v0.129.0
github.com/mitchellh/go-homedir v1.1.0
github.com/pkg/errors v0.8.1
github.com/spf13/cobra v0.0.5
github.com/onsi/ginkgo v1.11.0 // indirect
github.com/onsi/gomega v1.8.1 // indirect
github.com/pkg/errors v0.9.1
github.com/spf13/cobra v0.0.6
github.com/spf13/jwalterweatherman v1.1.0 // indirect
github.com/spf13/pflag v1.0.5
github.com/spf13/viper v1.3.2
github.com/stretchr/testify v1.4.0
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
helm.sh/helm/v3 v3.0.3
github.com/spf13/viper v1.6.2
github.com/stretchr/testify v1.5.1
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d
golang.org/x/tools v0.0.0-20200204192400-7124308813f3
helm.sh/helm/v3 v3.1.2
)

// Transitive requirement from Helm.
replace github.com/docker/docker => github.com/docker/docker v0.7.3-0.20190327010347-be7ac8be2ae0
exclude (
github.com/Azure/go-autorest v0.9.0
github.com/Azure/go-autorest v12.0.0+incompatible
)
619 changes: 474 additions & 145 deletions go.sum

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/github/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import (
"github.com/Songmu/retry"
"github.com/pkg/errors"

"github.com/google/go-github/github"
"github.com/google/go-github/v30/github"
"golang.org/x/oauth2"
)

Expand Down
22 changes: 22 additions & 0 deletions pkg/tools/tools.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Copyright The Helm Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// +build tools

package tools

import (
_ "github.com/goreleaser/goreleaser"
_ "golang.org/x/tools/cmd/goimports"
)
18 changes: 18 additions & 0 deletions setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env bash

# Copyright The Helm Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

go install github.com/goreleaser/goreleaser
go install golang.org/x/tools/cmd/goimports