From 6db3e90cdd39ec3b3bce448a1a689de4671f90bf Mon Sep 17 00:00:00 2001 From: Enrico Candino Date: Fri, 12 Jul 2024 16:46:25 +0200 Subject: [PATCH] [v2.9] Upload CLI assets to GCS (#379) * upload assets to gcs * fix upload path --- .github/workflows/release.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1c43704..8a1248ac 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -22,6 +22,7 @@ jobs: secrets: | secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials username | DOCKER_USERNAME ; secret/data/github/repo/${{ github.repository }}/dockerhub/rancher/credentials password | DOCKER_PASSWORD ; + secret/data/github/repo/${{ github.repository }}/google-auth/rancher/credentials token | GOOGLE_AUTH ; - name: Login to Docker Hub uses: docker/login-action@v3 @@ -29,6 +30,11 @@ jobs: username: ${{ env.DOCKER_USERNAME }} password: ${{ env.DOCKER_PASSWORD }} + - name: Authenticate to Google Cloud + uses: google-github-actions/auth@v2 + with: + credentials_json: "${{ env.GOOGLE_AUTH }}" + - name: Set up Go uses: actions/setup-go@v5 with: @@ -75,6 +81,17 @@ jobs: find . -maxdepth 1 -type f ! -name sha256sum.txt -printf '%P\0' | xargs -0 sha256sum > sha256sum.txt gh release upload $VERSION *.txt *.xz *.gz *.zip + - name: Upload Release assets to Google Cloud + uses: google-github-actions/upload-cloud-storage@v2 + with: + path: dist/artifacts/${{ env.VERSION }} + destination: releases.rancher.com/cli2/${{ env.VERSION }} + glob: '*.*' # copy only the files in the path folder + parent: false + process_gcloudignore: false + headers: |- + cache-control: public,max-age=3600 + - name: Docker Build uses: docker/build-push-action@v5 with: