diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index abbf3ee746..3726ced30e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -69,7 +69,9 @@ jobs: - name: Publish Artifacts run: | - gh release upload ${{ github.ref_name }} dist/artifacts/* + dapper -f Dockerfile --target dapper make publish-binary + env: + GH_TOKEN: ${{ github.token }} release-arm64: runs-on: runs-on,runner=8cpu-linux-arm64,run-id=${{ github.run_id }},image=ubuntu22-full-arm64,hdd=256 steps: @@ -118,7 +120,9 @@ jobs: - name: Publish Artifacts run: | - gh release upload ${{ github.ref_name }} dist/artifacts/* + dapper -f Dockerfile --target dapper make publish-binary + env: + GH_TOKEN: ${{ github.token }} dispatch: needs: [release-amd64, release-arm64] runs-on: runs-on,runner=8cpu-linux-x64,run-id=${{ github.run_id }},image=ubuntu22-full-x64,hdd=64 @@ -135,7 +139,7 @@ jobs: uses: rancher-eio/read-vault-secrets@main with: secrets: | - secret/data/github/repo/${{ github.repository }}/pat_username/credentials token | PAT_USERNAME ; + secret/data/github/repo/${{ github.repository }}/pat-username/credentials token | PAT_USERNAME ; - name: Dispatch run: | diff --git a/Dockerfile b/Dockerfile index d32f80538c..21ea6feb7c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,7 +30,7 @@ RUN zypper install -y systemd-rpm-macros # Dapper/Drone/CI environment FROM build AS dapper -ENV DAPPER_ENV GODEBUG GOCOVER REPO TAG GITHUB_ACTION_TAG PAT_USERNAME PAT_TOKEN KUBERNETES_VERSION DOCKER_BUILDKIT DRONE_BUILD_EVENT IMAGE_NAME AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID ENABLE_REGISTRY DOCKER_USERNAME DOCKER_PASSWORD +ENV DAPPER_ENV GODEBUG GOCOVER REPO TAG GITHUB_ACTION_TAG PAT_USERNAME PAT_TOKEN KUBERNETES_VERSION DOCKER_BUILDKIT DRONE_BUILD_EVENT IMAGE_NAME AWS_SECRET_ACCESS_KEY AWS_ACCESS_KEY_ID ENABLE_REGISTRY DOCKER_USERNAME DOCKER_PASSWORD GH_TOKEN ARG DAPPER_HOST_ARCH ENV ARCH $DAPPER_HOST_ARCH ENV DAPPER_OUTPUT ./dist ./bin ./build @@ -42,6 +42,10 @@ RUN if [ "${ARCH}" = "amd64" ] || [ "${ARCH}" = "arm64" ]; then \ curl -sL "https://github.com/vmware-tanzu/sonobuoy/releases/download/v${VERSION}/sonobuoy_${VERSION}_${OS}_${ARCH}.tar.gz" | \ tar -xzf - -C /usr/local/bin; \ fi + +RUN curl -sL "https://github.com/cli/cli/releases/download/v2.53.0/gh_2.53.0_linux_${ARCH}.tar.gz" | \ + tar --strip-components=2 -xzvf - -C /usr/local/bin gh_2.53.0_linux_${ARCH}/bin/gh; + RUN curl -sL https://dl.k8s.io/release/$( \ curl -sL https://dl.k8s.io/release/stable.txt \ )/bin/linux/${ARCH}/kubectl -o /usr/local/bin/kubectl && \ diff --git a/Makefile b/Makefile index 699d52cd24..7d38f74f1e 100644 --- a/Makefile +++ b/Makefile @@ -112,6 +112,10 @@ dev-peer-enter: ## Enter the peer shell on another termi publish-manifest-kubernetes: build-image-kubernetes ## Create and push the kubernetes manifest ./scripts/publish-manifest-kubernetes +.PHONY: publish-binary +publish-binary: ## Upload binaries + ./scripts/publish-binary + .PHONY: dispatch dispatch: ## Send dispatch event to rke2-upgrade repo ./scripts/dispatch diff --git a/scripts/publish-binary b/scripts/publish-binary new file mode 100755 index 0000000000..9d2d7fcac0 --- /dev/null +++ b/scripts/publish-binary @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +set -ex + +cd $(dirname $0)/.. + +source ./scripts/version.sh + +mkdir -p dist/artifacts + +gh release upload ${VERSION} dist/artifacts/*