From c9f778da96e6924c168d463aff7276418a302c8e Mon Sep 17 00:00:00 2001 From: Steven Powell Date: Thu, 2 Mar 2023 11:20:31 -0800 Subject: [PATCH] CI: install gopogh via go install --- .github/workflows/functional_verified.yml | 9 ++++---- .github/workflows/master.yml | 18 +++++----------- .github/workflows/pr.yml | 21 ++++++------------- hack/jenkins/common.sh | 5 ++--- .../gopogh_version/update_gopogh_version.go | 8 +++---- 5 files changed, 21 insertions(+), 40 deletions(-) diff --git a/.github/workflows/functional_verified.yml b/.github/workflows/functional_verified.yml index b180f8e22a..e0c72fbbdb 100644 --- a/.github/workflows/functional_verified.yml +++ b/.github/workflows/functional_verified.yml @@ -63,6 +63,9 @@ jobs: GOPOGH_RESULT: "" SHELL: "/bin/bash" # To prevent https://github.com/kubernetes/minikube/issues/6643 steps: + - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 + with: + go-version: ${{env.GO_VERSION}} - name: Install tools shell: bash run: | @@ -95,8 +98,7 @@ jobs: - name: Install gopogh shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-arm64 - sudo install gopogh-linux-arm64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Docker Info shell: bash @@ -116,9 +118,6 @@ jobs: echo "--------------------------" hostname || true echo "--------------------------" - - uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 - with: - go-version: ${{env.GO_VERSION}} - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: diff --git a/.github/workflows/master.yml b/.github/workflows/master.yml index c1cc7d338d..03f6397d87 100644 --- a/.github/workflows/master.yml +++ b/.github/workflows/master.yml @@ -126,11 +126,9 @@ jobs: with: go-version: ${{env.GO_VERSION}} - name: Install gopogh - shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: @@ -228,8 +226,7 @@ jobs: - name: Install gopogh shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: @@ -331,8 +328,7 @@ jobs: - name: Install gopogh shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: @@ -415,11 +411,9 @@ jobs: with: go-version: ${{env.GO_VERSION}} - name: Install gopogh - shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-darwin-amd64 - sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Install docker shell: bash run: | @@ -533,11 +527,9 @@ jobs: curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-${CRICTL_VERSION}-linux-amd64.tar.gz sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin - name: Install gopogh - shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Set fs.protected_regular shell: bash run: | diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index a5eb1eced0..d47e8fad8b 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -126,8 +126,7 @@ jobs: - name: Install gopogh shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: @@ -226,8 +225,7 @@ jobs: - name: Install gopogh shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: @@ -342,11 +340,9 @@ jobs: with: go-version: ${{env.GO_VERSION}} - name: Install gopogh - shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9782bd6a9848b53b110e712e20e42d89988822b7 with: @@ -449,8 +445,7 @@ jobs: - name: Install gopogh shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Download Binaries uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a with: @@ -534,11 +529,9 @@ jobs: with: go-version: ${{env.GO_VERSION}} - name: Install gopogh - shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-darwin-amd64 - sudo install gopogh-darwin-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Install docker shell: bash run: | @@ -653,11 +646,9 @@ jobs: curl -L https://github.com/kubernetes-sigs/cri-tools/releases/download/$CRICTL_VERSION/crictl-${CRICTL_VERSION}-linux-amd64.tar.gz --output crictl-${CRICTL_VERSION}-linux-amd64.tar.gz sudo tar zxvf crictl-$CRICTL_VERSION-linux-amd64.tar.gz -C /usr/local/bin - name: Install gopogh - shell: bash run: | - curl -LO https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-linux-amd64 - sudo install gopogh-linux-amd64 /usr/local/bin/gopogh + go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 - name: Set fs.protected_regular shell: bash run: | diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index d69de48427..e39b751cb0 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -94,7 +94,7 @@ else ln -s /usr/local/bin/gtimeout /usr/local/bin/timeout || true fi -# installing golang so we could do go get for gopogh +# installing golang so we can go install gopogh ./installers/check_install_golang.sh "/usr/local" || true # install docker and kubectl if not present @@ -428,8 +428,7 @@ if ! type "jq" > /dev/null; then fi echo ">> Installing gopogh" -curl -LO "https://github.com/medyagh/gopogh/releases/download/v0.13.0/gopogh-${OS_ARCH}" -sudo install "gopogh-${OS_ARCH}" /usr/local/bin/gopogh +go install github.com/medyagh/gopogh/cmd/gopogh@v0.13.0 echo ">> Running gopogh" diff --git a/hack/update/gopogh_version/update_gopogh_version.go b/hack/update/gopogh_version/update_gopogh_version.go index 445fcfc1e4..32e56cc26c 100644 --- a/hack/update/gopogh_version/update_gopogh_version.go +++ b/hack/update/gopogh_version/update_gopogh_version.go @@ -34,17 +34,17 @@ var ( schema = map[string]update.Item{ ".github/workflows/master.yml": { Replace: map[string]string{ - `(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`, + `github.com/medyagh/gopogh/cmd/gopogh@.*`: `github.com/medyagh/gopogh/cmd/gopogh@{{.StableVersion}}`, }, }, ".github/workflows/pr.yml": { Replace: map[string]string{ - `(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`, + `github.com/medyagh/gopogh/cmd/gopogh@.*`: `github.com/medyagh/gopogh/cmd/gopogh@{{.StableVersion}}`, }, }, ".github/workflows/functional_verified.yml": { Replace: map[string]string{ - `(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`, + `github.com/medyagh/gopogh/cmd/gopogh@.*`: `github.com/medyagh/gopogh/cmd/gopogh@{{.StableVersion}}`, }, }, "hack/jenkins/common.ps1": { @@ -54,7 +54,7 @@ var ( }, "hack/jenkins/common.sh": { Replace: map[string]string{ - `(?U)https://github.com/medyagh/gopogh/releases/download/.*/gopogh`: `https://github.com/medyagh/gopogh/releases/download/{{.StableVersion}}/gopogh`, + `github.com/medyagh/gopogh/cmd/gopogh@.*`: `github.com/medyagh/gopogh/cmd/gopogh@{{.StableVersion}}`, }, }, }