From a95241863f4fb5eccd5e2c8da5bca165f062a679 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 14 Oct 2024 10:28:48 +0200 Subject: [PATCH 1/6] upgrade go version to 1.22.x --- Dockerfile.goreleaser | 2 +- go.mod | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile.goreleaser b/Dockerfile.goreleaser index 68b6b8c..d9e155a 100644 --- a/Dockerfile.goreleaser +++ b/Dockerfile.goreleaser @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. -FROM golang:1.20.7-bullseye +FROM golang:1.22.8-bullseye COPY xk6bundler /usr/local/bin/ COPY docker-entrypoint.sh /usr/local/bin/ diff --git a/go.mod b/go.mod index 592d8df..3a5f115 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/szkiba/xk6bundler -go 1.18 +go 1.22 require ( github.com/go-task/slim-sprig v2.20.0+incompatible From f13d6c4b8096005f70135d647a78936cb404ceb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 14 Oct 2024 10:31:31 +0200 Subject: [PATCH 2/6] upgrded xk6 to v0.13.0 --- go.mod | 2 +- go.sum | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 3a5f115..538c427 100644 --- a/go.mod +++ b/go.mod @@ -6,7 +6,7 @@ require ( github.com/go-task/slim-sprig v2.20.0+incompatible github.com/jessevdk/go-flags v1.5.0 gitlab.com/golang-commonmark/markdown v0.0.0-20211110145824-bf3e522c626a - go.k6.io/xk6 v0.9.0 + go.k6.io/xk6 v0.13.0 gopkg.in/ini.v1 v1.67.0 ) diff --git a/go.sum b/go.sum index 2f4c492..9007900 100644 --- a/go.sum +++ b/go.sum @@ -41,8 +41,8 @@ gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f h1:Wku8eEde gitlab.com/golang-commonmark/puny v0.0.0-20191124015043-9f83538fa04f/go.mod h1:Tiuhl+njh/JIg0uS/sOJVYi0x2HEa5rc1OAaVsb5tAs= gitlab.com/opennota/wd v0.0.0-20180912061657-c5d65f63c638 h1:uPZaMiz6Sz0PZs3IZJWpU5qHKGNy///1pacZC9txiUI= gitlab.com/opennota/wd v0.0.0-20180912061657-c5d65f63c638/go.mod h1:EGRJaqe2eO9XGmFtQCvV3Lm9NLico3UhFwUpCG/+mVU= -go.k6.io/xk6 v0.9.0 h1:6ihaW4Qsi+Lh3FB6PWwg6Qq+Z6uf4wnkib90smsMTGs= -go.k6.io/xk6 v0.9.0/go.mod h1:4+BwjriwZ52roJ9RHHQhTBb9Q6ZctEUtsCO10H8rJIo= +go.k6.io/xk6 v0.13.0 h1:DY6xgBdf1BFwyDVPuFgJTYVaXc9KMuC9ioCKBi1HZVg= +go.k6.io/xk6 v0.13.0/go.mod h1:4+BwjriwZ52roJ9RHHQhTBb9Q6ZctEUtsCO10H8rJIo= golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A= golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= From 77875e53dd1b173aeb3eed08d344bb6c694437fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 14 Oct 2024 10:38:44 +0200 Subject: [PATCH 3/6] upgrade goreleaser to 2.0.1 --- .github/workflows/build.yml | 10 +++++----- .github/workflows/release.yml | 10 +++++----- .goreleaser.yml | 3 +++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5063f83..8897381 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,12 +35,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: ">=1.22.8" - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -53,9 +53,9 @@ jobs: run: go test ./... - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: - version: latest + version: "2.0.1" args: build --snapshot --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d42da9d..c5214f3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -33,12 +33,12 @@ jobs: runs-on: ubuntu-latest steps: - name: Set up Go - uses: actions/setup-go@v3 + uses: actions/setup-go@v5 with: - go-version: 1.18 + go-version: ">=1.22.8" - name: Check out code - uses: actions/checkout@v3 + uses: actions/checkout@v4 with: fetch-depth: 0 @@ -57,9 +57,9 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - name: Run GoReleaser - uses: goreleaser/goreleaser-action@v4 + uses: goreleaser/goreleaser-action@v6 with: - version: latest + version: "2.0.1" args: release --clean env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.goreleaser.yml b/.goreleaser.yml index 3c1dc51..5ca039a 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -20,6 +20,9 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. +project_name: xk6bundler +version: 2 + before: hooks: - go mod download From d13459021d5e5b8c5d6efd10091bb02e2d6f9ce4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 14 Oct 2024 10:47:28 +0200 Subject: [PATCH 4/6] ci: fix go version --- .github/workflows/build.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8897381..0802667 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -37,7 +37,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ">=1.22.8" + go-version: "~1.22.8" - name: Check out code uses: actions/checkout@v4 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c5214f3..152c73b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: - name: Set up Go uses: actions/setup-go@v5 with: - go-version: ">=1.22.8" + go-version: "~1.22.8" - name: Check out code uses: actions/checkout@v4 From b11852ba1cb3c72a0f96e0837e94b8fa8bef35aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 14 Oct 2024 10:57:19 +0200 Subject: [PATCH 5/6] fix linter issues --- .github/workflows/release.yml | 6 ++++-- .golangci.yml | 2 ++ cmd/xk6bundler/build.go | 3 +-- cmd/xk6bundler/options.go | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 152c73b..63466f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -43,9 +43,11 @@ jobs: fetch-depth: 0 - name: Lint Go Code - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.50.1 + version: v1.57.2 + args: --timeout=30m + install-mode: binary - name: Run Unit tests. run: go test ./... diff --git a/.golangci.yml b/.golangci.yml index 69fd717..210daac 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -47,6 +47,8 @@ linters: - ifshort - golint - deadcode + - depguard + - tagalign linters-settings: lll: diff --git a/cmd/xk6bundler/build.go b/cmd/xk6bundler/build.go index 03895d9..c9c7e17 100644 --- a/cmd/xk6bundler/build.go +++ b/cmd/xk6bundler/build.go @@ -29,7 +29,6 @@ import ( "context" _ "embed" "io" - "io/ioutil" "os" "path/filepath" "text/template" @@ -107,7 +106,7 @@ func createDockerfile(output string) error { const fileMode = 0o644 - return ioutil.WriteFile(name, []byte(str), fileMode) + return os.WriteFile(name, []byte(str), fileMode) } func createArchive(archive string, output string) error { diff --git a/cmd/xk6bundler/options.go b/cmd/xk6bundler/options.go index 3a3abce..ce5add3 100644 --- a/cmd/xk6bundler/options.go +++ b/cmd/xk6bundler/options.go @@ -242,6 +242,7 @@ func splitWith(arg string) (module, version, replace string, err error) { } else { version = parts[1] parts := strings.SplitN(version, replaceSplit, versionParts) + if len(parts) > 1 { version = parts[0] replace = parts[1] From 9c75deb9403a6e24228b9275b49c8451be2d1d29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20SZKIBA?= Date: Mon, 14 Oct 2024 10:58:59 +0200 Subject: [PATCH 6/6] upgrade linter --- .github/workflows/build.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0802667..27b3b65 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,9 +45,11 @@ jobs: fetch-depth: 0 - name: Lint Go Code - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@v6 with: - version: v1.50.1 + version: v1.57.2 + args: --timeout=30m + install-mode: binary - name: Run Unit tests. run: go test ./...