Skip to content

Commit

Permalink
feat: upgrade to go 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
deimosfr committed Sep 27, 2022
1 parent 0629321 commit 9c2d068
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 157 deletions.
14 changes: 5 additions & 9 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,21 @@ jobs:
tests:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Fetch tags
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: 1.16.x
go-version: 1.19.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
Expand Down
23 changes: 8 additions & 15 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

name: goreleaser

on:
Expand All @@ -9,46 +8,40 @@ jobs:
release:
runs-on: ubuntu-latest
steps:
-
name: Checkout
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
-
name: Fetch tags
- name: Fetch tags
run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- name: Ensure tag match the current version
run: |
if [ "v$(grep '// ci-version-check' cmd/version.go | sed -r 's/.+return\s"(.+)".+/\1/')" != "$(git tag | sort --version-sort | tail -1)" ] ; then
echo "Tag version do not match application version"
exit 1
fi
-
name: Set up Go
- name: Set up Go
uses: actions/setup-go@main
with:
go-version: 1.16.x
go-version: 1.19.x
- name: golangci-lint
uses: golangci/golangci-lint-action@v2
with:
version: latest
-
name: Run GoReleaser
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v1
with:
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GORELEASER_GITHUB_TOKEN }}
-
name: Prepare AUR package
- name: Prepare AUR package
run: |
version=$(awk -F'"' '/ci-version-check/{print $2}' cmd/version.go)
md5version=$(curl -sL https://github.com/Qovery/helm-freeze/archive/v${version}.tar.gz --output - | md5sum | awk '{ print $1 }')
sed -i "s/pkgver=tbd/pkgver=$version/" PKGBUILD
echo "md5sums=('${md5version}')" >> PKGBUILD
-
name: Publish AUR package
- name: Publish AUR package
uses: KSXGitHub/[email protected]
with:
pkgname: helm-freeze
Expand All @@ -58,4 +51,4 @@ jobs:
ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }}
commit_message: Update AUR package
ssh_keyscan_types: rsa,dsa,ecdsa,ed25519
force_push: 'true'
force_push: "true"
4 changes: 2 additions & 2 deletions cfg/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"errors"
"fmt"
"gopkg.in/yaml.v2"
"io/ioutil"
"os"
)

func ValidateConfig(configFile string) (Config, error) {
Expand All @@ -14,7 +14,7 @@ func ValidateConfig(configFile string) (Config, error) {
allDestinationsName := make(map[string]bool)
allDestinationsPath := make(map[string]bool)

data, err := ioutil.ReadFile(configFile)
data, err := os.ReadFile(configFile)
if err != nil {
fmt.Printf("Error while reading config file %s: #%v ", configFile, err)
return Config{}, err
Expand Down
5 changes: 3 additions & 2 deletions cmd/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ package cmd

import (
"fmt"
"os"

"github.com/Qovery/helm-freeze/cfg"
"github.com/Qovery/helm-freeze/exec"
"github.com/spf13/cobra"
"os"
)

// syncCmd represents the sync command
Expand Down Expand Up @@ -58,5 +59,5 @@ func init() {
rootCmd.AddCommand(syncCmd)

syncCmd.Flags().StringP("config-file", "f", "./helm-freeze.yaml", "Configuration file")
syncCmd.Flags().StringSlice("only-charts", []string{}, "Sync only these charts")
syncCmd.Flags().StringSlice("only-charts", []string{}, "Sync only specified charts, comma separated")
}
3 changes: 2 additions & 1 deletion cmd/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

Expand All @@ -15,7 +16,7 @@ var versionCmd = &cobra.Command{
}

func GetCurrentVersion() string {
return "0.5.0" // ci-version-check
return "1.0.0" // ci-version-check
}

func init() {
Expand Down
29 changes: 25 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@
module github.com/Qovery/helm-freeze

go 1.15
go 1.19

require (
github.com/go-git/go-git/v5 v5.4.2
github.com/otiai10/copy v1.6.0
github.com/spf13/cobra v1.0.0
gopkg.in/yaml.v2 v2.3.0
github.com/otiai10/copy v1.7.0
github.com/spf13/cobra v1.5.0
gopkg.in/yaml.v2 v2.4.0
)

require (
github.com/Microsoft/go-winio v0.4.16 // indirect
github.com/ProtonMail/go-crypto v0.0.0-20210428141323-04723f9f07d7 // indirect
github.com/acomagu/bufpipe v1.0.3 // indirect
github.com/emirpasic/gods v1.12.0 // indirect
github.com/go-git/gcfg v1.5.0 // indirect
github.com/go-git/go-billy/v5 v5.3.1 // indirect
github.com/imdario/mergo v0.3.12 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 // indirect
github.com/kevinburke/ssh_config v0.0.0-20201106050909-4977a11b4351 // indirect
github.com/mitchellh/go-homedir v1.1.0 // indirect
github.com/sergi/go-diff v1.1.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/xanzy/ssh-agent v0.3.0 // indirect
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b // indirect
golang.org/x/net v0.0.0-20210326060303-6b1517762897 // indirect
golang.org/x/sys v0.0.0-20210502180810-71e4cd670f79 // indirect
gopkg.in/warnings.v0 v0.1.2 // indirect
)
Loading

0 comments on commit 9c2d068

Please sign in to comment.