mirror of
https://github.com/denoland/deno.git
synced 2025-01-03 04:48:52 -05:00
fix cargo-publish-on-tag (#3781)
Also rename the "test" CI worker to "test_release"
This commit is contained in:
parent
950537e8ef
commit
3059558d41
3 changed files with 20 additions and 40 deletions
30
.github/workflows/ci.yml
vendored
30
.github/workflows/ci.yml
vendored
|
@ -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
|
||||
|
|
|
@ -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())
|
|
@ -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/"
|
||||
])
|
||||
|
|
Loading…
Reference in a new issue