From 3059558d41690bb0bc70abd65ac42577019a8072 Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Fri, 24 Jan 2020 14:24:27 -0500 Subject: [PATCH] fix cargo-publish-on-tag (#3781) Also rename the "test" CI worker to "test_release" --- .github/workflows/ci.yml | 30 +++++++++++++++++++----------- tools/cargo_publish.py | 28 ---------------------------- tools/upload_docs.py | 2 +- 3 files changed, 20 insertions(+), 40 deletions(-) delete mode 100755 tools/cargo_publish.py diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22b21fdccf..8ac875d4fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,7 +10,7 @@ jobs: strategy: matrix: os: [macOS-latest, windows-2019, ubuntu-16.04] - kind: ['test', 'test_debug', 'bench', 'lint'] + kind: ['test_release', 'test_debug', 'bench', 'lint'] exclude: - os: windows-2019 kind: 'bench' @@ -37,7 +37,7 @@ jobs: submodules: true - name: Create source tarballs (release, linux) - if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno' + if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno' run: | mkdir -p target/release tar --exclude=".git*" --exclude=target --exclude=deno_typescript/typescript/tests --exclude=third_party/cpplint --exclude=third_party/node_modules --exclude=third_party/python_packages --exclude=third_party/prebuilt -czvf target/release/deno_src.tar.gz -C .. deno @@ -124,11 +124,11 @@ jobs: run: cargo clippy --all-targets --release --locked -- -D clippy::all - name: Build - if: matrix.kind == 'test' || matrix.kind == 'bench' + if: matrix.kind == 'test_release' || matrix.kind == 'bench' run: cargo build --release --locked --all-targets - - name: Test - if: matrix.kind == 'test' + - name: Test release + if: matrix.kind == 'test_release' run: cargo test --release --locked --all-targets - name: Test debug @@ -162,20 +162,20 @@ jobs: cat /proc/meminfo - name: Pre-release (linux) - if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test' + if: startsWith(matrix.os, 'ubuntu') && matrix.kind == 'test_release' run: gzip -f -S _linux_x64.gz target/release/deno - name: Pre-release (mac) - if: startsWith(matrix.os, 'macOS') && matrix.kind == 'test' + if: startsWith(matrix.os, 'macOS') && matrix.kind == 'test_release' run: gzip -f -S _osx_x64.gz target/release/deno - name: Pre-release (windows) - if: startsWith(matrix.os, 'windows') && matrix.kind == 'test' + if: startsWith(matrix.os, 'windows') && matrix.kind == 'test_release' run: Compress-Archive -CompressionLevel Optimal -Force -Path target/release/deno.exe -DestinationPath target/release/deno_win_x64.zip - name: Release uses: softprops/action-gh-release@v1 - if: matrix.kind == 'test' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno' + if: matrix.kind == 'test_release' && startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: @@ -190,11 +190,19 @@ jobs: if: > startsWith(github.ref, 'refs/tags/') && github.repository == 'denoland/deno' && - matrix.kind == 'test' && + matrix.kind == 'test_release' && startsWith(matrix.os, 'ubuntu') env: CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }} - run: ./tools/cargo_publish.py + run: | + cd core + cargo publish + cd ../deno_typescript + sleep 30 + cargo publish + cd ../cli + sleep 30 + cargo publish - name: Stop sccache run: sccache --stop-server diff --git a/tools/cargo_publish.py b/tools/cargo_publish.py deleted file mode 100755 index b8fa1f0376..0000000000 --- a/tools/cargo_publish.py +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env python -import os -import sys -import argparse -from util import run, root_path - - -def main(): - parser = argparse.ArgumentParser() - parser.add_argument("--dry-run", action="store_true") - args = parser.parse_args() - - cargo_publish = ["cargo", "publish"] - if args.dry_run: - cargo_publish += ["--dry-run"] - - os.chdir(os.path.join(root_path, "core")) - run(cargo_publish) - - os.chdir(os.path.join(root_path, "deno_typescript")) - run(cargo_publish) - - os.chdir(os.path.join(root_path, "cli")) - run(cargo_publish) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/tools/upload_docs.py b/tools/upload_docs.py index b37ab4e965..70605dd4aa 100755 --- a/tools/upload_docs.py +++ b/tools/upload_docs.py @@ -9,5 +9,5 @@ run([sys.executable, "tools/docs.py"]) os.chdir("target") run([ "aws", "s3", "sync", "--include=typedoc", "--exclude=debug/*", - "--exclude=release/*", ".", "s3://deno.land/" + "--exclude=package/*", "--exclude=release/*", ".", "s3://deno.land/" ])