From 01a84532194d74516a15032071e420adafbd8f5f Mon Sep 17 00:00:00 2001 From: Enrico Candino Date: Thu, 11 Jul 2024 15:06:39 +0200 Subject: [PATCH] upload assets to gcs (#378) --- .github/workflows/release.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c1c43704..40100346 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,14 @@ 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/$VERSION + destination: releases.rancher.com/cli2/$VERSION + headers: |- + cache-control: public,max-age=3600 + - name: Docker Build uses: docker/build-push-action@v5 with: