From b358426eeae1118e73a5420fbe1b3becdb5371a1 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Thu, 14 Jan 2021 17:08:30 +0100 Subject: [PATCH] build: upload release zips to dl.deno.land (#9090) --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c50d2e71d..cb3a9e440f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -112,7 +112,9 @@ jobs: runner.os != 'Windows' && matrix.kind == 'test_release' && github.repository == 'denoland/deno' && - github.ref == 'refs/heads/master' + (github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/tags/') && + !startsWith(github.ref, 'refs/tags/std/')) uses: google-github-actions/setup-gcloud@master with: project_id: denoland @@ -124,7 +126,9 @@ jobs: runner.os == 'Windows' && matrix.kind == 'test_release' && github.repository == 'denoland/deno' && - github.ref == 'refs/heads/master' + (github.ref == 'refs/heads/master' || + startsWith(github.ref, 'refs/tags/') && + !startsWith(github.ref, 'refs/tags/std/')) uses: google-github-actions/setup-gcloud@master env: CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe @@ -195,7 +199,7 @@ jobs: Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno-x86_64-pc-windows-msvc.zip Compress-Archive -CompressionLevel Optimal -Force -Path target/release/denort.exe -DestinationPath target/release/denort-x86_64-pc-windows-msvc.zip - - name: Upload canary (unix) + - name: Upload canary to dl.deno.land (unix) if: | runner.os != 'Windows' && matrix.kind == 'test_release' && @@ -206,7 +210,7 @@ jobs: echo $(git rev-parse HEAD) > canary-latest.txt gsutil cp canary-latest.txt gs://dl.deno.land/canary-latest.txt - - name: Upload canary (windows) + - name: Upload canary to dl.deno.land (windows) if: | runner.os == 'Windows' && matrix.kind == 'test_release' && @@ -257,7 +261,34 @@ jobs: cat /proc/cpuinfo cat /proc/meminfo - - name: Release stable + - name: Upload release to dl.deno.land (unix) + if: | + runner.os != 'Windows' && + matrix.kind == 'test_release' && + github.repository == 'denoland/deno' && + startsWith(github.ref, 'refs/tags/') && + !startsWith(github.ref, 'refs/tags/std/') + run: | + gsutil cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/ + echo ${GITHUB_REF#refs/*/} > release-latest.txt + gsutil cp release-latest.txt gs://dl.deno.land/release-latest.txt + + - name: Upload release to dl.deno.land (windows) + if: | + runner.os == 'Windows' && + matrix.kind == 'test_release' && + github.repository == 'denoland/deno' && + startsWith(github.ref, 'refs/tags/') && + !startsWith(github.ref, 'refs/tags/std/') + env: + CLOUDSDK_PYTHON: ${{env.pythonLocation}}\python.exe + shell: bash + run: | + gsutil cp ./target/release/*.zip gs://dl.deno.land/release/${GITHUB_REF#refs/*/}/ + echo ${GITHUB_REF#refs/*/} > release-latest.txt + gsutil cp release-latest.txt gs://dl.deno.land/release-latest.txt + + - name: Upload release to GitHub uses: softprops/action-gh-release@v1 if: | matrix.kind == 'test_release' &&