Upload binary artifacts from CI builds

This commit is contained in:
Max Brunsfeld 2019-01-15 19:18:33 -08:00
parent d23a03bdf1
commit ef735eb942
4 changed files with 55 additions and 4 deletions

View file

@ -10,6 +10,10 @@ install:
# Install dependencies
- git submodule update --init
platform:
- x64
- x86
test_script:
# Fetch and regenerate the fixture parsers
- script\fetch-fixtures.cmd
@ -23,6 +27,23 @@ test_script:
branches:
only:
- master
- /\d+\.\d+\.\d+.*/
before_deploy:
- move target\release\tree-sitter.exe tree-sitter.exe
- 7z a tree-sitter-windows-%PLATFORM%.zip tree-sitter.exe
- appveyor PushArtifact tree-sitter-windows-%PLATFORM%.zip
deploy:
description: ''
provider: GitHub
auth_token:
secure: VC9ntV5+inKoNteZyLQksKzWMKXF46P+Jx3JHKVSfF+o1rWtZn2iIHAVsQv5LaUi
artifact: /tree-sitter-windows-.*.zip/
draft: true
force_update: true
on:
APPVEYOR_REPO_TAG: true
cache:
- target

View file

@ -2,6 +2,10 @@ language: rust
rust:
- stable
os:
- linux
- osx
script:
# Fetch and regenerate the fixture parsers
- script/fetch-fixtures
@ -15,6 +19,23 @@ script:
branches:
only:
- master
- /\d+\.\d+\.\d+/
before_deploy:
- mv target/release/tree-sitter .
- tar czf tree-sitter-${TRAVIS_OS_NAME}-x64.tar.gz tree-sitter
deploy:
provider: releases
api_key:
secure: "cAd2mQP+Q55v3zedo5ZyOVc3hq3XKMW93lp5LuXV6CYKYbIhkyfym4qfs+C9GJQiIP27cnePYM7B3+OMIFwSPIgXHWWSsuloMtDgYSc/PAwb2dZnJqAyog3BohW/QiGTSnvbVlxPF6P9RMQU6+JP0HJzEJy6QBTa4Und/j0jm24="
file_glob: true
file: "tree-sitter-*.tar.gz"
draft: true
overwrite: true
skip_cleanup: true
on:
tags: true
cache:
cargo: true

View file

@ -4,6 +4,7 @@ use std::path::PathBuf;
use std::process::{Child, ChildStdin, Command, Stdio};
use tree_sitter::Parser;
#[cfg(unix)]
const HTML_HEADER: &[u8] = b"<!DOCTYPE html>\n<style>svg { width: 100%; }</style>\n\n";
#[cfg(windows)]
@ -13,7 +14,7 @@ pub(crate) struct LogSession();
pub(crate) struct LogSession(PathBuf, Option<Child>, Option<ChildStdin>);
#[cfg(windows)]
pub(crate) fn log_graphs(parser: &mut Parser, path: &str) -> std::io::Result<LogSession> {
pub(crate) fn log_graphs(_parser: &mut Parser, _path: &str) -> std::io::Result<LogSession> {
Ok(LogSession())
}

View file

@ -6,9 +6,17 @@ use std::path::{Path, PathBuf};
fn main() {
println!("cargo:rerun-if-env-changed=TREE_SITTER_STATIC_ANALYSIS");
if env::var("TREE_SITTER_STATIC_ANALYSIS").is_ok() {
let clang_path = which("clang").unwrap();
let clang_path = clang_path.to_str().unwrap();
env::set_var("CC", &format!("scan-build -analyze-headers --use-analyzer={} cc", clang_path));
if let (Some(clang_path), Some(scan_build_path)) = (which("clang"), which("scan-build")) {
let clang_path = clang_path.to_str().unwrap();
let scan_build_path = scan_build_path.to_str().unwrap();
env::set_var(
"CC",
&format!(
"{} -analyze-headers --use-analyzer={} cc",
scan_build_path, clang_path
),
);
}
}
let mut config = cc::Build::new();