if: (branch = master || branch =~ /^v\d+\.\d+\.x$/)
language: rust
rust:
- stable
os:
- linux
- osx
addons:
apt:
packages:
- llvm-dev
- libclang-dev
- clang
homebrew:
packages:
- llvm
before_install:
- rustup component add rustfmt
script:
- cargo build -v
- find target/debug/build -path "*/libuv-sys-*/output" -exec cat '{}' \;
- cargo test
jobs:
include:
- os: windows
rust: stable-x86_64-pc-windows-msvc
- stage: "prepare new libuv version"
if: branch = master && env(LIBUV_TAG_URL) =~ /^https:\/\/github.com\/libuv\/libuv\/releases\/tag\/v\d+\.\d+\.\d+/
os: linux
dist: bionic
language: bash
addons:
apt:
packages:
- jo
before_install: echo "Preparing a build for a new version of libuv..."
script: bash scripts/prepare.sh
- stage: publish
if: type = push && fork = false && branch =~ /^v\d+\.\d+\.x$/ && env(LIBUV_TAG_URL) IS blank
os: linux
rust: stable
addons:
apt:
packages:
before_install: echo "Preparing to publish release..."
script:
- git config --local user.name $GIT_USER_NAME
- git config --local user.email $GIT_USER_EMAIL
- git remote set-url origin https://${GITHUB_TOKEN}@github.com/bmatcuk/libuv-sys.git
- export TRAVIS_TAG=$(grep '^version =' Cargo.toml | awk -F'"' '{print "v" $2}')
- export PREV_TAG=$({ echo $TRAVIS_TAG; git tag; } | sort -V | grep -B1 $TRAVIS_TAG | head -n 1)
- export LIBUV_VERSION=$({ cd libuv; git describe --tags; })
- export LIBUV_TAG="libuv-${LIBUV_VERSION}"
- '{ echo -e "Corresponds to libuv ${LIBUV_VERSION}.\n\n## Changelog\n\n"; git log --pretty=format:"%h %s" "${PREV_TAG}.." 2>/dev/null; } > RELEASELOG.md || true'
- git tag $LIBUV_TAG || true
- git tag -a $TRAVIS_TAG -m "Corresponds to libuv ${LIBUV_VERSION}"
- git push --tags
deploy:
- provider: releases
file: README.md
release_notes_file: RELEASELOG.md
edge: true
on:
all_branches: true
- provider: cargo
edge: true
cleanup: true
on:
all_branches: true
stages:
- "prepare new libuv version"
- name: test
if: env(LIBUV_TAG_URL) IS blank
- publish