1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-02 20:38:47 -05:00

Remove travis and appveyor. Release with github actions (#3052)

Fixes #2979
This commit is contained in:
Ryan Dahl 2019-10-03 13:20:59 -04:00 committed by GitHub
parent aa34c1df6a
commit d9acc5b17e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 286 deletions

View file

@ -1,197 +0,0 @@
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
version: '{build}.{branch}'
skip_branch_with_pr: true
clone_folder: C:\deno
clone_depth: 1
environment:
RUSTC_WRAPPER: sccache
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
DENO_BUILD_MODE: release
DENO_BUILD_PATH: $(APPVEYOR_BUILD_FOLDER)\target\release
DENO_THIRD_PARTY_PATH: $(APPVEYOR_BUILD_FOLDER)\third_party
RELEASE_ARTIFACT: deno_win_x64.zip
RUST_VERSION: 1.38.0
RUST_DIR: $(USERPROFILE)\rust-$(RUST_VERSION)
CARGO_HOME: $(RUST_DIR)\cargo
RUSTUP_HOME: $(RUST_DIR)\rustup
RUST_BACKTRACE: full
SCCACHE_IDLE_TIMEOUT: 0
SCCACHE_BUCKET: deno-sccache
AWS_ACCESS_KEY_ID: AKIAIVRN52PLDBP55LBQ
AWS_SECRET_ACCESS_KEY:
secure: 8ybpi/y5qE2baChsCBhNHmykng3FitELAtTYOiqZd0mw38i88dzdAX8ETNtBogMV
# Appveyor uses 7zip to pack cache directories. We use these options:
# -t7z : Use '7z' format.
# -snl : Store symlinks; doesn't work, but it prevents following symlinks.
# -mtc : Use UTC timestamps. This is required for incremental builds.
# -mx=1 : Fast compression.
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -snl -mtc -mx=1
# Define some PowerShell helper functions which are used in the scripts below.
# They're defined in an environment variable to reduce noise in the build log.
PS_UTILS: |-
# `Exec` runs a regular executable. It looks at the process' exit code,
# rather than its stderr output, to tell if a command has failed.
function Exec([ScriptBlock] $Command, [switch] $NoNewLines) {
"$Command".TrimStart(" &") | Write-Host # Echo command.
& $Command 2>&1 | Write-Host -NoNewLine:$NoNewLines # Execute command.
if ($NoNewLines) { Write-Host } # Write newline.
if ($LastExitCode -ne 0) { throw "Failure. Exit code: $LastExitCode" }
}
# `Delete-Tree` is a simple wrapper around Remove-Item. It doesn't set
# an error status if one of the paths to be deleted doesn't exist.
function Delete-Tree([string[]] $Path) {
$Path | foreach {
"Deleting '$_'" | Write-Host -NoNewLine
if (Test-Path $_) {
Remove-Item $_ -Recurse -Force -ErrorAction Ignore
$(if ($?) { " - ok" } else { " - failed" }) | Write-Host
} else {
" - not found" | Write-Host
}
}
}
for:
# Do no save the build cache for feature branches. TODO: Once we have multiple
# permanent branches, use a build matrix so each branch has it's own cache.
- branches:
except:
- master
environment:
APPVEYOR_CACHE_SKIP_SAVE: true
cache:
- $(RUST_DIR)
- $(APPVEYOR_BUILD_FOLDER)\target\release\
- $(APPVEYOR_BUILD_FOLDER)\prebuilt\win\
init:
# Load utility functions
- ps: Invoke-Expression $env:PS_UTILS
# Upgrade git.
# TODO: remove when Appveyor upgrades to version 2.19.2.windows.1 or higher.
- ps: |-
$git_setup_uri = "https://github.com/git-for-windows/git/releases/" +
"download/v2.23.0.windows.1/Git-2.23.0-64-bit.exe"
Invoke-WebRequest -Uri $git_setup_uri -OutFile "$env:TEMP\git-setup.exe"
Start-Process -FilePath "$env:TEMP\git-setup.exe" `
-ArgumentList "/verysilent" `
-Wait
# Make git check out symlinks (not placeholder text files).
- git config --global core.symlinks true
install:
# Because prebuilt/ is cached, we need to manually reset changes that might
# happen to the sha1 files here.
- git checkout -- prebuilt
# Make sure the PATH includes the prebuilt files (downloaded during setup.py)
- set PATH=%PATH%;%CD%\prebuilt\win\
# Clone the third_party submodule.
- ps: |-
try {
Exec { & git submodule update --init --force --depth 1 --jobs 4 }
} catch {
# Git will fail if the `third_party` directory was restored from cache,
# but the `.git/modules` directory wasn't. Rebuild it from scratch.
Delete-Tree $env:DENO_THIRD_PARTY_PATH
Exec -NoNewLines { & git submodule update --init --force --depth 1 }
}
# Install a recent Node.js version.
- ps: Install-Product -Product node -Version 12 -Platform x64
# Make sure the right Python version is in PATH, and others are not.
- ps: |-
# Remove the wrong Python version(s) from PATH.
$p = $env:PATH -split ";" | where { -not (Test-Path "$_\python.exe") }
# Add python27-x64.
$p += "C:\Python27-x64"
$env:PATH = $p -join ";"
# Add Rust/Cargo to PATH.
- ps: $env:PATH += ";$env:CARGO_HOME\bin"
# Install Rust via rustup-init.
# * After install, the rustup directory is very big, with many files,
# slowing down cache save/restore a lot, so we remove unnecessary stuff.
# * TODO: Use `rustup component remove docs` instead, when this issue
# is resolved: https://github.com/rust-lang-nursery/rustup.rs/issues/998.
# * TODO: Ship Rust in the third_party repo. See issue #386.
- ps: |-
if (-not (Test-Path $env:CARGO_HOME)) {
Invoke-WebRequest -Uri "https://win.rustup.rs" `
-OutFile "$env:TEMP\rustup-init.exe"
Exec -NoNewLines {
& "$env:TEMP\rustup-init.exe" -y --default-toolchain $env:RUST_VERSION
}
Delete-Tree @(
"$env:RUSTUP_HOME\downloads",
"$env:RUSTUP_HOME\tmp",
"$env:RUSTUP_HOME\toolchains\stable-x86_64-pc-windows-msvc\share\doc"
)
}
Exec { rustup component add clippy }
Exec { rustup component add rustfmt }
# Log installed Node.js version + processor architecture.
- node -p "`Node ${process.version} ${process.arch}`"
# Log installed Python version + processor architecture.
- ps: |-
@("from sys import version",
"print 'Python', version") -join "`n" | & python -
# Log some more versions.
- rustc --version
- cargo --version
before_build:
# setup.py downloads sccache if necessary.
- python tools\setup.py
# Start sccache, then throw away the S3 access key.
- ps: |-
prebuilt\win\sccache --start-server
$env:AWS_SECRET_ACCESS_KEY = $null
build_script:
- cargo clippy --all-targets --release --locked -- -D clippy::all
- cargo build -vv --release --all-targets --locked
test_script:
- python tools\lint.py
- python tools\test_format.py
- cargo test -vv --release --all-targets --locked
after_test:
# Stop sccache and show stats.
- prebuilt\win\sccache --stop-server
# If this build is going to be deployed, build a zip file.
- ps: |-
if ($env:APPVEYOR_REPO_TAG -eq "true") {
Compress-Archive -CompressionLevel Optimal -Force `
-Path "$env:DENO_BUILD_PATH\deno.exe" `
-DestinationPath "$env:APPVEYOR_BUILD_FOLDER\$env:RELEASE_ARTIFACT"
}
artifacts:
path: $(RELEASE_ARTIFACT)
deploy:
provider: GitHub
auth_token:
secure: HQIIUEOtep3yRiBacZCtX8hVmgtdNvt6Hx7u9fP4Wj2ZYp+eBFP2OLf67RKVa5VZ
on:
APPVEYOR_REPO_NAME: denoland/deno
APPVEYOR_REPO_TAG: true

View file

@ -108,5 +108,29 @@ jobs:
cat /proc/cpuinfo cat /proc/cpuinfo
cat /proc/meminfo cat /proc/meminfo
- name: Pre-release (linux)
if: startsWith(matrix.os, 'ubuntu')
run: gzip -c target/release/deno > target/release/deno_linux_x64.gz
- name: Pre-release (mac)
if: startsWith(matrix.os, 'macOS')
run: gzip -c target/release/deno > target/release/deno_osx_x64.gz
- name: Pre-release (windows)
if: startsWith(matrix.os, 'windows')
run: PowerShell -Command "& {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/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
target/release/deno_win_x64.zip
target/release/deno_linux_x64.gz
target/release/deno_osx_x64.gz
draft: true
- name: Stop sccache - name: Stop sccache
run: sccache --stop-server run: sccache --stop-server

View file

@ -1,89 +0,0 @@
# Copyright 2018-2019 the Deno authors. All rights reserved. MIT license.
sudo: false
language: rust
rust:
- 1.38.0
git:
depth: 1
env:
global:
- RUSTC_WRAPPER=sccache
- RUST_BACKTRACE=full
- PATH=$TRAVIS_BUILD_DIR/third_party/llvm-build/Release+Asserts/bin:$PATH
- PYTHONPATH=third_party/python_packages
- SCCACHE_BUCKET=deno-sccache
- AWS_ACCESS_KEY_ID=AKIAIVRN52PLDBP55LBQ
# AWS_SECRET_ACCESS_KEY=...
- secure: "ugSLNiUOQs53Oyy78EQyr2bu+//uoskbuoucenUUHM5I11M15yq1XuBJ26fIK1Jatza9pOGJNI8+4dSMWZW1GMFqgOZTKXv4kZFqU915/L1gsfS2bljB8pD1Qoq68ieGCQ49vBSFOWP24gtWBfKVJqU3HGHJgA5Ia/ujW3e37jr20xGqaBEcTjgin2fjm7VTao+hOOAMf47YkZNTEuLEHVPbDZM2tCCSlUdLpdyPB6mzX7XVmRxO26mtaHEeecivtaS6xXJXmns7OkntOzwgJi46B5uMgZz42UZ9qy1fCq8yCOyADb/Hu2WaJm7MIehHVhdC/siRzUUSOJ4N9gOPaFFAy5D28sDEa/IvlVriOwXirmDdPSlkTpwZ1NiisZXdZMaK6CWroaCHv9hYrJ7wKcntLQjLnnnskcyqxIVC7uEdlKHyLTNziyxol6oU/2Ym1NDoYWPDzcIeCkCr+xBapLXTVcg60YvcL/h+6wy5rp1v2h9R5B8HCCvmyc2X/FyaAmi8P7DYYHQL8+g+B0nGmzrrSGJzsEL7vChyiKfeNG7nnJKrU1+V8/+bPGsuPOK1XDTx80Uq56EzjHUPXy59zqtYL7ZZAIL0BQPxgm43yUCJfYSIKiwB9Odu+vb2DLDk5CLi45OHh2K7yi9m/lxlXla945az5OYO2l7a5m7rWF8="
cache:
cargo: true
directories:
- prebuilt/mac
- prebuilt/linux64
- third_party/v8/build/linux/debian_sid_amd64-sysroot/
- third_party/v8/buildtools/mac/
- third_party/v8/buildtools/linux64/
- third_party/v8/third_party/llvm-build/
install:
# Because prebuilt/ is cached, we need to manually reset changes that might
# happen to the sha1 files here.
- git checkout -- prebuilt
- nvm install v12
- nvm use --delete-prefix v12
- node -v
- rustup component add rustfmt
- rustc --version
- cargo --version
- |-
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
export PATH="`pwd`/prebuilt/mac:$PATH"
else
export PATH="`pwd`/prebuilt/linux64:$PATH"
fi
before_script:
# Need to run setup.py in order to download clang-format binary, needed for
# test_format.py.
- ./tools/setup.py
# Start sccache, then throw away the S3 access key.
- sccache --start-server
- unset AWS_SECRET_ACCESS_KEY
- set -e
- ./tools/lint.py
- ./tools/test_format.py
# Default script for release builds.
script:
- cargo build -vv --release --locked --all-targets
- cargo test -vv --release --all-targets --locked
# For some reason it's faster to run clippy after build.
- rustup component add clippy
- cargo clippy --all-targets --release --locked -- -D clippy::all
jobs:
fast_finish: true
include:
- name: "release mac x86_64"
os: osx
osx_image: xcode11
after_success:
- &gzip_release
gzip -c target/release/deno > target/release/deno_${TRAVIS_OS_NAME}_x64.gz
deploy:
- &release_provider
provider: releases
api_key: &github-token
secure: RIwv515oDcPAlEvt7uG8FeSFi6Tz6ODJUOXcFj6FYUPszxJ7Cg1kBLKln+fNW5OeOc52VsaZb/vPZ85skyEM6zk2ijL9FcSnnfNEm548w77iH6G0sk09NgBTy6KRXES6NZHD9jN1YTWYkT2G1NQi7mLqxR8a8pnWTbeK5HhtSWGsZPtXqf5iQbvnWsmKA0/w+FIgKupU0xe/qsYjh0eMLYpZDUWoKO0VxBKJ/ix5Uz91aJTjMIcHHij+ALg4pk+FkDotdyx39XB9b25KDxGuaI7NxWjSPzDxs/ZBHP6QYDLO0ti93ftvLAxRoBKPFoZrXqAu3KG9anr9WvxE40DO9OdV0VX2ZUatMUQm3DpSheN8ml2sErFqjIInqlpkdOVDYORz7FikPxkb9DKt+iuyFfxPRa4YWJv2tg8+Hy/nRCQw69OoKqrSNJ8KJDB3OjYbRBtdHz79RLJhTsGZla6RiyXfM7crR7CbFjbwdbW3Pt60t24fhvXQ0SwR0QTgzS/ieYEQHq/9GtSQA/Tn4kdIkyN6BdOMrQd/aUtgKmNdqbSlfmWGNyNZIxHdB+3RrTNT1tagkRI4UHEUfEujpIdYKwLjv0Xmi/VtTM+zOSkzHsIWGPfHBmIGnXfAItUHqivQYJ15E+dzg3T1CEbBxkDQtvwien9Fa8/pBsMkyovl8ps=
file: "target/release/deno_${TRAVIS_OS_NAME}_x64.gz"
on:
tags: true
repo: denoland/deno
skip-cleanup: true
- name: "release linux x86_64"
os: linux
after_success:
- *gzip_release
deploy:
- *release_provider