From 57c100b4055b8f558508cfc079519da2aabb3510 Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 31 Aug 2021 13:14:41 +0200 Subject: [PATCH 01/16] Improve CI and release workflow --- .github/workflows/main.yml | 163 ++++++++++++++++++++++++++++--------- 1 file changed, 126 insertions(+), 37 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7b0622fd0d716..47945ac18c0da 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,9 +1,16 @@ ---- name: CI -'on': - - push - - pull_request +on: + push: + tags: + - "*" + branches: + - "master*" + - "release*" + pull_request: + branches: + - "master*" + - "release*" env: GOPROXY: https://proxy.golang.org @@ -16,67 +23,149 @@ jobs: build-linux-amd64: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: Set up go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 + with: + go-version: "1.20.6" + + - name: Checkout full + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') with: path: ${{ env.GOPATH }}/src/k8s.io/kops + fetch-depth: 0 - - name: Set up go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 + - name: Checkout shallow + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') == false with: - go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' + path: ${{ env.GOPATH }}/src/k8s.io/kops - - name: make all examples test + - name: Make all examples test working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | make all examples test + - name: Upload Linux binary + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v2 + with: + name: kops-linux-amd64 + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/local/kops + if-no-files-found: error + retention-days: 1 + build-macos-amd64: runs-on: macos-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - with: - path: ${{ env.GOPATH }}/src/k8s.io/kops + - name: Set up go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 + with: + go-version: "1.20.6" + + - name: Checkout full + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + path: ${{ env.GOPATH }}/src/k8s.io/kops + fetch-depth: 0 + + - name: Checkout shallow + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') == false + with: + path: ${{ env.GOPATH }}/src/k8s.io/kops - - name: Set up go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 - with: - go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' + - name: Make kops examples test + working-directory: ${{ env.GOPATH }}/src/k8s.io/kops + run: | + make kops examples test - - name: make kops examples test - working-directory: ${{ env.GOPATH }}/src/k8s.io/kops - run: | - make kops examples test + - name: Upload macos binary + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v2 + with: + name: kops-darwin-amd64 + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/local/kops + if-no-files-found: error + retention-days: 1 build-windows-amd64: runs-on: windows-2019 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - with: - path: ${{ env.GOPATH }}/src/k8s.io/kops + - name: Set up go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 + with: + go-version: "1.20.6" - - name: Set up go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 - with: - go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' + - name: Checkout full + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') + with: + path: ${{ env.GOPATH }}/src/k8s.io/kops + fetch-depth: 0 + + - name: Checkout shallow + uses: actions/checkout@v2 + if: startsWith(github.ref, 'refs/tags/') == false + with: + path: ${{ env.GOPATH }}/src/k8s.io/kops - - name: make kops examples test - working-directory: ${{ env.GOPATH }}/src/k8s.io/kops - run: | - make kops examples test-windows + - name: Make kops examples test + working-directory: ${{ env.GOPATH }}/src/k8s.io/kops + run: | + make kops examples test-windows + + - name: Upload windows binary + if: startsWith(github.ref, 'refs/tags/') + uses: actions/upload-artifact@v2 + with: + name: kops-windows-amd64 + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/local/kops + if-no-files-found: error + retention-days: 1 verify: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 + - name: Set up go + uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 with: - path: ${{ env.GOPATH }}/src/k8s.io/kops + go-version: "1.20.6" - - name: Set up go - uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 + - name: Checkout repository + uses: actions/checkout@v2 with: - go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' + path: ${{ env.GOPATH }}/src/k8s.io/kops - - name: make quick-ci + - name: Make quick-ci working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | make quick-ci + + release: + runs-on: ubuntu-20.04 + if: startsWith(github.ref, 'refs/tags/') + needs: + - build-linux-amd64 + - build-macos-amd64 + - build-windows-amd64 + - verify + steps: + - name: Download all kops binary artifacts + uses: actions/download-artifact@v2 + + - name: Rename kops binary artifacts + run: | + mv kops-linux-amd64/kops kops-linux-amd64/kops-linux-amd64 + mv kops-darwin-amd64/kops kops-darwin-amd64/kops-darwin-amd64 + mv kops-windows-amd64/kops kops-windows-amd64/kops-windows-amd64 + + - name: Release + uses: softprops/action-gh-release@v1 + with: + fail_on_unmatched_files: true + files: | + kops-linux-amd64/kops-linux-amd64 + kops-darwin-amd64/kops-darwin-amd64 + kops-windows-amd64/kops-windows-amd64 From 5f24ad528e280460d1222a3395ccd73b1d87bd60 Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 31 Aug 2021 14:58:59 +0200 Subject: [PATCH 02/16] Remove 'bp' suffix from the release tag This modifies the kops versioning script so that we do not need to bother with a custom kops version. The version will still be that of the appropriate master/release branch, and the additional verion info about where it is built will be still in the git version part. --- tools/get_version.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/get_version.sh b/tools/get_version.sh index 1c709b0581878..5d48abc062529 100755 --- a/tools/get_version.sh +++ b/tools/get_version.sh @@ -36,6 +36,7 @@ if [[ -n "${CI}" ]]; then EXACT_TAG=$(git describe --tags --exact-match 2>/dev/null || true) if [[ -n "${EXACT_TAG}" ]]; then VERSION="${EXACT_TAG#v}" # Remove the v prefix from the git tag + VERSION="${VERSION//-bp*/}" # remove the bearingpoint version from the tag if [[ "${VERSION}" != "${KOPS_RELEASE_VERSION}" ]]; then echo "Build was tagged with ${VERSION}, but kops-version.go had version ${KOPS_RELEASE_VERSION}" exit 1 From cae3984fa7d33f45b50e763f4fd945f9cb5a05f5 Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 31 Aug 2021 14:14:56 +0200 Subject: [PATCH 03/16] Check PR with workflow --- .github/workflows/check-pr.yml | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 .github/workflows/check-pr.yml diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml new file mode 100644 index 0000000000000..14839f33e59bc --- /dev/null +++ b/.github/workflows/check-pr.yml @@ -0,0 +1,35 @@ +name: Check PR +on: + pull_request: + types: + - opened + - edited + - labeled + - unlabeled + - reopened + - synchronize + branches: + - 'master*' + - 'release*' + +jobs: + check-pr: + name: Check PR + runs-on: ubuntu-latest + steps: + - name: Check commit messages for WIP + uses: gsactions/commit-message-checker@v1 + with: + pattern: '^(?!WIP)' + flags: 'gmi' + error: Work in progress + checkAllCommitMessages: true + accessToken: ${{ secrets.GITHUB_TOKEN }} + + - name: Check PR labels + uses: jesusvasquez333/verify-pr-label-action@v1.4.0 + with: + valid-labels: 'merge' + invalid-labels: 'do-not-merge, wip, wait-before-merge' + disable-reviews: true + github-token: '${{ secrets.GITHUB_TOKEN }}' From 70315e8c9bde700ecea5802dc6c394e86f89c3b2 Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 31 Aug 2021 16:03:21 +0200 Subject: [PATCH 04/16] Enable auto merge via workflow --- .github/workflows/check-pr.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/check-pr.yml b/.github/workflows/check-pr.yml index 14839f33e59bc..df06cb037638d 100644 --- a/.github/workflows/check-pr.yml +++ b/.github/workflows/check-pr.yml @@ -33,3 +33,8 @@ jobs: invalid-labels: 'do-not-merge, wip, wait-before-merge' disable-reviews: true github-token: '${{ secrets.GITHUB_TOKEN }}' + + - name: Enable auto merge + uses: alexwilson/enable-github-automerge-action@main + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" From afc137d9804a95f5913c4bea8aced3a8c22fad44 Mon Sep 17 00:00:00 2001 From: ederst Date: Tue, 31 Aug 2021 16:35:42 +0200 Subject: [PATCH 05/16] Run CI only on actual code changes --- .github/workflows/main.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 47945ac18c0da..0a1d6f2725f0b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -20,7 +20,25 @@ permissions: contents: read jobs: + changes: + runs-on: ubuntu-latest + outputs: + src: ${{ steps.filter.outputs.src }} + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Detect changes + uses: dorny/paths-filter@v2 + id: filter + with: + filters: | + src: + - '!.github/**' + build-linux-amd64: + needs: changes + if: ${{ needs.changes.outputs.src == 'true' }} runs-on: ubuntu-20.04 steps: - name: Set up go @@ -56,6 +74,8 @@ jobs: retention-days: 1 build-macos-amd64: + needs: changes + if: ${{ needs.changes.outputs.src == 'true' }} runs-on: macos-latest steps: - name: Set up go @@ -91,6 +111,8 @@ jobs: retention-days: 1 build-windows-amd64: + needs: changes + if: ${{ needs.changes.outputs.src == 'true' }} runs-on: windows-2019 steps: - name: Set up go @@ -126,6 +148,8 @@ jobs: retention-days: 1 verify: + needs: changes + if: ${{ needs.changes.outputs.src == 'true' }} runs-on: ubuntu-20.04 steps: - name: Set up go From 311e58d3859bb936885f2a4786daec2fbb12334d Mon Sep 17 00:00:00 2001 From: ederst Date: Wed, 13 Oct 2021 17:21:07 +0200 Subject: [PATCH 06/16] Use git clone for full checkout --- .github/workflows/main.yml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 0a1d6f2725f0b..5eaef2a02ca18 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,11 +47,9 @@ jobs: go-version: "1.20.6" - name: Checkout full - uses: actions/checkout@v2 if: startsWith(github.ref, 'refs/tags/') - with: - path: ${{ env.GOPATH }}/src/k8s.io/kops - fetch-depth: 0 + run: | + git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops - name: Checkout shallow uses: actions/checkout@v2 @@ -84,11 +82,9 @@ jobs: go-version: "1.20.6" - name: Checkout full - uses: actions/checkout@v2 if: startsWith(github.ref, 'refs/tags/') - with: - path: ${{ env.GOPATH }}/src/k8s.io/kops - fetch-depth: 0 + run: | + git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops - name: Checkout shallow uses: actions/checkout@v2 @@ -121,11 +117,9 @@ jobs: go-version: "1.20.6" - name: Checkout full - uses: actions/checkout@v2 if: startsWith(github.ref, 'refs/tags/') - with: - path: ${{ env.GOPATH }}/src/k8s.io/kops - fetch-depth: 0 + run: | + git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops - name: Checkout shallow uses: actions/checkout@v2 From 8b7d9ce3b8dd1021a9580c15acc07a86de424922 Mon Sep 17 00:00:00 2001 From: ederst Date: Wed, 13 Oct 2021 17:29:31 +0200 Subject: [PATCH 07/16] Run builds when releasing --- .github/workflows/main.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 5eaef2a02ca18..24a608afcc6e2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -38,7 +38,7 @@ jobs: build-linux-amd64: needs: changes - if: ${{ needs.changes.outputs.src == 'true' }} + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-20.04 steps: - name: Set up go @@ -73,7 +73,7 @@ jobs: build-macos-amd64: needs: changes - if: ${{ needs.changes.outputs.src == 'true' }} + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: macos-latest steps: - name: Set up go @@ -108,7 +108,7 @@ jobs: build-windows-amd64: needs: changes - if: ${{ needs.changes.outputs.src == 'true' }} + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: windows-2019 steps: - name: Set up go @@ -143,7 +143,7 @@ jobs: verify: needs: changes - if: ${{ needs.changes.outputs.src == 'true' }} + if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-20.04 steps: - name: Set up go From 4c83b46193c4f2581fc0f0fa49acbb02e6b3af1e Mon Sep 17 00:00:00 2001 From: ederst Date: Wed, 13 Oct 2021 17:38:30 +0200 Subject: [PATCH 08/16] Remove windows build --- .github/workflows/main.yml | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24a608afcc6e2..81afdfff5a43c 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -106,41 +106,6 @@ jobs: if-no-files-found: error retention-days: 1 - build-windows-amd64: - needs: changes - if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} - runs-on: windows-2019 - steps: - - name: Set up go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 - with: - go-version: "1.20.6" - - - name: Checkout full - if: startsWith(github.ref, 'refs/tags/') - run: | - git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops - - - name: Checkout shallow - uses: actions/checkout@v2 - if: startsWith(github.ref, 'refs/tags/') == false - with: - path: ${{ env.GOPATH }}/src/k8s.io/kops - - - name: Make kops examples test - working-directory: ${{ env.GOPATH }}/src/k8s.io/kops - run: | - make kops examples test-windows - - - name: Upload windows binary - if: startsWith(github.ref, 'refs/tags/') - uses: actions/upload-artifact@v2 - with: - name: kops-windows-amd64 - path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/local/kops - if-no-files-found: error - retention-days: 1 - verify: needs: changes if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} @@ -167,7 +132,6 @@ jobs: needs: - build-linux-amd64 - build-macos-amd64 - - build-windows-amd64 - verify steps: - name: Download all kops binary artifacts @@ -177,7 +141,6 @@ jobs: run: | mv kops-linux-amd64/kops kops-linux-amd64/kops-linux-amd64 mv kops-darwin-amd64/kops kops-darwin-amd64/kops-darwin-amd64 - mv kops-windows-amd64/kops kops-windows-amd64/kops-windows-amd64 - name: Release uses: softprops/action-gh-release@v1 @@ -186,4 +149,3 @@ jobs: files: | kops-linux-amd64/kops-linux-amd64 kops-darwin-amd64/kops-darwin-amd64 - kops-windows-amd64/kops-windows-amd64 From 184a2492f2a06f00de0875ea431d283ed9375399 Mon Sep 17 00:00:00 2001 From: ederst Date: Thu, 14 Jul 2022 13:26:12 +0200 Subject: [PATCH 09/16] Fix path of kops binaries in CI --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 81afdfff5a43c..8f0e1823f99f0 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -67,7 +67,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: kops-linux-amd64 - path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/local/kops + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/linux/amd64/kops if-no-files-found: error retention-days: 1 @@ -102,7 +102,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: kops-darwin-amd64 - path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/local/kops + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/darwin/amd64/kops if-no-files-found: error retention-days: 1 From 0baa4430bc0be88cd61e61fd9a299ae90634b279 Mon Sep 17 00:00:00 2001 From: ederst Date: Thu, 14 Jul 2022 15:42:13 +0200 Subject: [PATCH 10/16] Fix permissions for release CI job --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 8f0e1823f99f0..4d5398448cd35 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -129,6 +129,8 @@ jobs: release: runs-on: ubuntu-20.04 if: startsWith(github.ref, 'refs/tags/') + permissions: + contents: write needs: - build-linux-amd64 - build-macos-amd64 From 5b2824223f4ea9f8c6587e91653a35059271c0d9 Mon Sep 17 00:00:00 2001 From: ederst Date: Fri, 10 Mar 2023 19:07:11 +0100 Subject: [PATCH 11/16] Upload all binaries when releasing --- .github/workflows/main.yml | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4d5398448cd35..6a73340183549 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -62,12 +62,12 @@ jobs: run: | make all examples test - - name: Upload Linux binary + - name: Upload Linux binaries if: startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v2 with: name: kops-linux-amd64 - path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/linux/amd64/kops + path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/linux/amd64/* if-no-files-found: error retention-days: 1 @@ -97,7 +97,7 @@ jobs: run: | make kops examples test - - name: Upload macos binary + - name: Upload kops MacOS binary if: startsWith(github.ref, 'refs/tags/') uses: actions/upload-artifact@v2 with: @@ -136,18 +136,24 @@ jobs: - build-macos-amd64 - verify steps: - - name: Download all kops binary artifacts + - name: Download all binary artifacts uses: actions/download-artifact@v2 - name: Rename kops binary artifacts run: | - mv kops-linux-amd64/kops kops-linux-amd64/kops-linux-amd64 mv kops-darwin-amd64/kops kops-darwin-amd64/kops-darwin-amd64 + mv kops-linux-amd64/kops kops-linux-amd64/kops-linux-amd64 + mv kops-linux-amd64/channels kops-linux-amd64/channels-linux-amd64 + mv kops-linux-amd64/protokube kops-linux-amd64/protokube-linux-amd64 + mv kops-linux-amd64/nodeup kops-linux-amd64/nodeup-linux-amd64 - name: Release uses: softprops/action-gh-release@v1 with: fail_on_unmatched_files: true files: | - kops-linux-amd64/kops-linux-amd64 kops-darwin-amd64/kops-darwin-amd64 + kops-linux-amd64/kops-linux-amd64 + kops-linux-amd64/channels-linux-amd64 + kops-linux-amd64/protokube-linux-amd64 + kops-linux-amd64/nodeup-linux-amd64 From d99898739726b3b5919cee3e2cd66860f7756a67 Mon Sep 17 00:00:00 2001 From: ederst Date: Fri, 27 Sep 2024 16:43:08 +0200 Subject: [PATCH 12/16] Update workflow actions --- .github/workflows/main.yml | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 6a73340183549..9978f9dd913aa 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -26,7 +26,7 @@ jobs: src: ${{ steps.filter.outputs.src }} steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: Detect changes uses: dorny/paths-filter@v2 @@ -41,21 +41,20 @@ jobs: if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-20.04 steps: - - name: Set up go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 - with: - go-version: "1.20.6" - - name: Checkout full if: startsWith(github.ref, 'refs/tags/') run: | git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops - name: Checkout shallow - uses: actions/checkout@v2 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 if: startsWith(github.ref, 'refs/tags/') == false with: path: ${{ env.GOPATH }}/src/k8s.io/kops + - name: Set up go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 + with: + go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' - name: Make all examples test working-directory: ${{ env.GOPATH }}/src/k8s.io/kops @@ -76,22 +75,22 @@ jobs: if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: macos-latest steps: - - name: Set up go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 - with: - go-version: "1.20.6" - - name: Checkout full if: startsWith(github.ref, 'refs/tags/') run: | git clone ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY} -b ${GITHUB_REF#refs/tags/} ${{ env.GOPATH }}/src/k8s.io/kops - name: Checkout shallow - uses: actions/checkout@v2 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 if: startsWith(github.ref, 'refs/tags/') == false with: path: ${{ env.GOPATH }}/src/k8s.io/kops + - name: Set up go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 + with: + go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' + - name: Make kops examples test working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | @@ -111,16 +110,16 @@ jobs: if: ${{ needs.changes.outputs.src == 'true' || startsWith(github.ref, 'refs/tags/') }} runs-on: ubuntu-20.04 steps: - - name: Set up go - uses: actions/setup-go@fac708d6674e30b6ba41289acaab6d4b75aa0753 - with: - go-version: "1.20.6" - - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 with: path: ${{ env.GOPATH }}/src/k8s.io/kops + - name: Set up go + uses: actions/setup-go@cdcb36043654635271a94b9a6d1392de5bb323a7 + with: + go-version-file: '${{ env.GOPATH }}/src/k8s.io/kops/go.mod' + - name: Make quick-ci working-directory: ${{ env.GOPATH }}/src/k8s.io/kops run: | From bd1f7fd588b8506cf20955f59601ee56e65d2e3a Mon Sep 17 00:00:00 2001 From: ederst Date: Fri, 27 Sep 2024 16:48:28 +0200 Subject: [PATCH 13/16] Update upload-artifact steps to v4 --- .github/workflows/main.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9978f9dd913aa..a32b04ad06082 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -63,7 +63,7 @@ jobs: - name: Upload Linux binaries if: startsWith(github.ref, 'refs/tags/') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: kops-linux-amd64 path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/linux/amd64/* @@ -98,7 +98,7 @@ jobs: - name: Upload kops MacOS binary if: startsWith(github.ref, 'refs/tags/') - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: kops-darwin-amd64 path: ${{ env.GOPATH }}/src/k8s.io/kops/.build/dist/darwin/amd64/kops From 3089b739a68051334423442abbe90de591590b0e Mon Sep 17 00:00:00 2001 From: ederst Date: Fri, 27 Sep 2024 16:51:30 +0200 Subject: [PATCH 14/16] Update paths-filter to v3 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index a32b04ad06082..2d1c24d43cf00 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -29,7 +29,7 @@ jobs: uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 - name: Detect changes - uses: dorny/paths-filter@v2 + uses: dorny/paths-filter@v3 id: filter with: filters: | From c6b7fe0990b1731596723490eb3b370dc53aa16c Mon Sep 17 00:00:00 2001 From: ederst Date: Fri, 27 Sep 2024 16:51:55 +0200 Subject: [PATCH 15/16] Update downoad-artifact to v4 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2d1c24d43cf00..50ef82d744d4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -136,7 +136,7 @@ jobs: - verify steps: - name: Download all binary artifacts - uses: actions/download-artifact@v2 + uses: actions/download-artifact@v4 - name: Rename kops binary artifacts run: | From 9cabbf935a86c1da2b63b7b52ce0e1f991fa66b6 Mon Sep 17 00:00:00 2001 From: ederst Date: Fri, 27 Sep 2024 16:52:18 +0200 Subject: [PATCH 16/16] Update action-gh-release to v2 --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 50ef82d744d4f..0013c6d58e2f8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -147,7 +147,7 @@ jobs: mv kops-linux-amd64/nodeup kops-linux-amd64/nodeup-linux-amd64 - name: Release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 with: fail_on_unmatched_files: true files: |