From 46850918e7e6215cc56e163ae4a42c49cd05b446 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 23 Nov 2020 18:06:47 +0100 Subject: [PATCH] build: upload canary releases to GCS (#8441) --- .github/workflows/ci.yml | 53 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 30a5d73559..4472df7da2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,6 +101,32 @@ jobs: Select-Object -Skip 1 | ForEach-Object { Move-Item "$_" "$_.disabled" } + - name: Setup gcloud (unix) + if: | + runner.os != 'Windows' && + matrix.kind == 'test_release' && + github.repository == 'denoland/deno' && + github.ref == 'refs/heads/master' + uses: google-github-actions/setup-gcloud@master + with: + project_id: denoland + service_account_key: ${{ secrets.GCP_SA_KEY }} + export_default_credentials: true + + - name: Setup gcloud (windows) + if: | + runner.os == 'Windows' && + matrix.kind == 'test_release' && + github.repository == 'denoland/deno' && + github.ref == 'refs/heads/master' + uses: google-github-actions/setup-gcloud@master + env: + CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe + with: + project_id: denoland + service_account_key: ${{ secrets.GCP_SA_KEY }} + export_default_credentials: true + - name: Log versions run: | node -v @@ -186,7 +212,32 @@ jobs: run: | Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip - - name: Release + - name: Upload canary (unix) + if: | + runner.os != 'Windows' && + matrix.kind == 'test_release' && + github.repository == 'denoland/deno' && + github.ref == 'refs/heads/master' + run: | + gsutil cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/ + echo $(git rev-parse HEAD) > canary-latest.txt + gsutil cp canary-latest.txt gs://dl.deno.land/canary-latest.txt + + - name: Upload canary (windows) + if: | + runner.os == 'Windows' && + matrix.kind == 'test_release' && + github.repository == 'denoland/deno' && + github.ref == 'refs/heads/master' + env: + CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe + shell: bash + run: | + gsutil cp ./target/release/*.zip gs://dl.deno.land/canary/$(git rev-parse HEAD)/ + echo $(git rev-parse HEAD) > canary-latest.txt + gsutil cp canary-latest.txt gs://dl.deno.land/canary-latest.txt + + - name: Release stable uses: softprops/action-gh-release@v1 if: | matrix.kind == 'test_release' &&