From a61bc8e019ce04669b7434bf966391824d158fe8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 5 Nov 2024 08:59:37 -0600 Subject: [PATCH 1/4] Add action to auto bump go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .github/workflows/golangci-lint.yml | 5 ++-- .github/workflows/release.yml | 5 ++-- .github/workflows/test-all.yml | 5 ++-- .github/workflows/test-windows.yml | 5 ++-- .github/workflows/trivy-scan.yml | 1 - .github/workflows/update-go.yml | 39 +++++++++++++++++++++++++++++ 6 files changed, 51 insertions(+), 9 deletions(-) create mode 100644 .github/workflows/update-go.yml diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 6a7f8bd6..a62ec5bf 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -12,10 +12,11 @@ jobs: name: lint runs-on: ubuntu-latest steps: - - name: Install Go + - name: Set Up Go uses: actions/setup-go@v5 with: - go-version: "1.22" + go-version-file: go.mod + check-latest: true - uses: actions/checkout@v4 with: fetch-depth: '0' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 18bfed61..158c120d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -18,10 +18,11 @@ jobs: with: fetch-depth: 0 - - name: Install Go + - name: Set Up Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: go.mod + check-latest: true - name: Set up Cosign uses: sigstore/cosign-installer@v3 diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 9ad241e4..000b5606 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -10,10 +10,11 @@ jobs: name: Test All runs-on: ubuntu-latest steps: - - name: Install Go + - name: Set Up Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: go.mod + check-latest: true - name: Check out code into the Go module directory uses: actions/checkout@v4 with: diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index 9be9fcc0..df5c9497 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -10,10 +10,11 @@ jobs: name: Test Windows runs-on: windows-latest steps: - - name: Install Go + - name: Set Up Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version-file: go.mod + check-latest: true - name: Check out code into the Go module directory uses: actions/checkout@v4 - name: Run Tests diff --git a/.github/workflows/trivy-scan.yml b/.github/workflows/trivy-scan.yml index ed69f9b4..3217e55e 100644 --- a/.github/workflows/trivy-scan.yml +++ b/.github/workflows/trivy-scan.yml @@ -11,7 +11,6 @@ jobs: with: repo: carvel-dev/ytt tool: ytt - 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 From 2edc8a6a4147008cf826ec47d25919848255c3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 5 Nov 2024 09:14:50 -0600 Subject: [PATCH 2/4] Fix order of the checkout to use the go.mod while setting up go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .github/workflows/golangci-lint.yml | 6 +++--- .github/workflows/test-all.yml | 10 +++++----- .github/workflows/test-windows.yml | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index a62ec5bf..0f4294ff 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -12,14 +12,14 @@ jobs: name: lint runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + fetch-depth: '0' - name: Set Up Go uses: actions/setup-go@v5 with: go-version-file: go.mod check-latest: true - - uses: actions/checkout@v4 - with: - fetch-depth: '0' - name: golangci-lint uses: golangci/golangci-lint-action@v6 with: diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 000b5606..397e6eb4 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -10,16 +10,16 @@ jobs: name: Test All runs-on: ubuntu-latest steps: - - name: Set Up Go - uses: actions/setup-go@v5 - with: - go-version-file: go.mod - check-latest: true - name: Check out code into the Go module directory uses: actions/checkout@v4 with: path: src/github.com/${{ github.repository }} fetch-depth: 0 + - name: Set Up Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + check-latest: true - name: Run Tests run: | set -e -x diff --git a/.github/workflows/test-windows.yml b/.github/workflows/test-windows.yml index df5c9497..1d066987 100644 --- a/.github/workflows/test-windows.yml +++ b/.github/workflows/test-windows.yml @@ -10,13 +10,13 @@ jobs: name: Test Windows runs-on: windows-latest steps: + - name: Check out code into the Go module directory + uses: actions/checkout@v4 - name: Set Up Go uses: actions/setup-go@v5 with: go-version-file: go.mod check-latest: true - - name: Check out code into the Go module directory - uses: actions/checkout@v4 - name: Run Tests shell: powershell run: | From a8f40f9e6c9a35bb0da46ad9e75bcdcb201d5a93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 5 Nov 2024 09:19:56 -0600 Subject: [PATCH 3/4] Bump version of go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 4fbd8f39..48be52ed 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module carvel.dev/ytt -go 1.22.5 +go 1.23.2 require ( github.com/BurntSushi/toml v1.2.1 From 3cfe5fb2d6f0c106e3b977bbc92517c0bad7f03d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pereira?= Date: Tue, 5 Nov 2024 09:27:34 -0600 Subject: [PATCH 4/4] Change location of the go.mod in test-all action MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: João Pereira --- .github/workflows/test-all.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-all.yml b/.github/workflows/test-all.yml index 397e6eb4..4a4c496f 100644 --- a/.github/workflows/test-all.yml +++ b/.github/workflows/test-all.yml @@ -18,7 +18,7 @@ jobs: - name: Set Up Go uses: actions/setup-go@v5 with: - go-version-file: go.mod + go-version-file: src/github.com/${{ github.repository }}/go.mod check-latest: true - name: Run Tests run: |