From 87d7597b9b0998e5ac053931294eb35fcd834180 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Mon, 17 Jun 2024 15:08:37 -0500 Subject: [PATCH] Automatic bump of go version in the go.mod file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Updated all the locations that reference the go version and start using the version provided in the go.mod file Signed-off-by: João Pereira --- .../workflows/gh-test-external-registry.yml | 8 ++-- .github/workflows/gh-test.yml | 16 ++++---- .github/workflows/golangci-lint.yml | 8 ++-- .github/workflows/release.yml | 4 +- .github/workflows/trivy-scan.yml | 1 - .github/workflows/update-go.yml | 39 +++++++++++++++++++ go.mod | 2 +- 7 files changed, 58 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/update-go.yml diff --git a/.github/workflows/gh-test-external-registry.yml b/.github/workflows/gh-test-external-registry.yml index 007922af..592b3671 100644 --- a/.github/workflows/gh-test-external-registry.yml +++ b/.github/workflows/gh-test-external-registry.yml @@ -23,16 +23,16 @@ jobs: runs-on: ubuntu-latest environment: GCR e2e steps: - - name: Set up Go 1.x - uses: actions/setup-go@v5 - with: - go-version: '1.22' - name: Check out code into the Go module directory uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} path: src/github.com/${{ github.repository }} persist-credentials: false + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.mod - name: Run Tests env: IMGPKG_E2E_IMAGE: "gcr.io/cf-k8s-lifecycle-tooling-klt/github-action-test-relocation" diff --git a/.github/workflows/gh-test.yml b/.github/workflows/gh-test.yml index b1392111..12921ee9 100644 --- a/.github/workflows/gh-test.yml +++ b/.github/workflows/gh-test.yml @@ -11,14 +11,14 @@ jobs: name: Test GH - Linux runs-on: ubuntu-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v5 - with: - go-version: '1.22' - name: Check out code into the Go module directory uses: actions/checkout@v4 with: path: src/github.com/${{ github.repository }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.mod - name: Run Tests run: | set -e -x @@ -34,14 +34,14 @@ jobs: name: Test GH - Windows runs-on: windows-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v5 - with: - go-version: '1.22' - name: Check out code into the Go module directory uses: actions/checkout@v4 with: path: src/github.com/${{ github.repository }} + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.mod - name: Install dependencies run: | bash -c ' diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 798b44d1..85172364 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -12,13 +12,13 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - name: Set up Go 1.x - uses: actions/setup-go@v5 - with: - go-version: '1.22' - uses: actions/checkout@v4 with: fetch-depth: '0' + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version-file: go.mod - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 05c53e51..90d77ed4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -16,10 +16,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Set up Go + - name: Set up Go 1.x uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: go.mod - name: Set up Cosign uses: sigstore/cosign-installer@v3 - name: Retrieve version diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index d7e6d473..d40bc4bb 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -11,7 +11,6 @@ jobs: with: repo: carvel-dev/imgpkg tool: imgpkg - goVersion: '1.22' secrets: githubToken: ${{ secrets.GITHUB_TOKEN }} slackWebhookURL: ${{ secrets.SLACK_WEBHOOK_URL }} diff --git a/.github/workflows/update-go.yml b/.github/workflows/update-go.yml new file mode 100644 index 00000000..88501983 --- /dev/null +++ b/.github/workflows/update-go.yml @@ -0,0 +1,39 @@ +name: go-updater + +on: + schedule: + - cron: '0 12 * * *' + workflow_dispatch: + +jobs: + update-go: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Go 1.x + uses: actions/setup-go@v5 + with: + go-version: 'stable' + check-latest: true + - name: Update Go + run: go get go + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.CARVEL_BOT_ACCESS_TOKEN }} + committer: Carvel Bot + author: Carvel Bot + commit-message: | + Bump go + + Signed-off-by: Carvel Bot + title: Bump go + delete-branch: true + body: | + Auto-generated by https://github.com/${{github.repository}}/actions/runs/${{github.run_id}} + Signed-off-by: Carvel Bot + base: develop + branch: bump-go diff --git a/go.mod b/go.mod index 4ff4d666..a6865b44 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module carvel.dev/imgpkg -go 1.22.3 +go 1.22.4 require ( github.com/awslabs/amazon-ecr-credential-helper/ecr-login v0.0.0-20220517224237-e6f29200ae04