Skip to content

Commit

Permalink
Merge 816d69c into 232cdca
Browse files Browse the repository at this point in the history
  • Loading branch information
petong committed Apr 25, 2019
2 parents 232cdca + 816d69c commit e6a3ee0
Show file tree
Hide file tree
Showing 2 changed files with 82 additions and 0 deletions.
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
registry=https://registry.npmjs.com
81 changes: 81 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
variables:
NODE_JS_VERSION: 10.15

trigger:
branches:
include:
- master
- azure-*
tags:
include:
- v*


jobs:
- job: test
pool:
vmImage: 'Ubuntu-16.04'
steps:
- task: NodeTool@0
inputs:
versionSpec: $(NODE_JS_VERSION)

- script: |
whoami
sudo apt update
sudo apt install ubuntu-toolchain-r-test gcc-4.8 g++-4.8
displayName: 'install ubuntu packages'
- script: npm install
displayName: 'npm install'

- script: npm run lint
displayName: 'lint'

- script: |
istanbul cover --include-all-sources --root ./src ./node_modules/mocha/bin/_mocha test/unit/ --report lcovonly -- -R min && \
cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && \
rm -rf ./coverage
displayName: 'istanbul coverage'
- job: tag
displayName: build tag
dependsOn:
- test
steps:
- task: NodeTool@0
inputs:
versionSpec: $(NODE_JS_VERSION)
- bash: |
set -euo pipefail
current_tag=$(git describe --exact-match --tags)
if [[ -n $current_tag ]]; then
echo "${current_tag}"
LATEST_VERSION_REGEX="^[vV]?(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)$"
DEV_VERSION_REGEX="^[vV]?(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)\\.(0|[1-9][0-9]*)(\\-[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?(\\+[0-9A-Za-z-]+(\\.[0-9A-Za-z-]+)*)?$"
if [[ $current_tag =~ $LATEST_VERSION_REGEX ]]; then
echo "##vso[task.setvariable variable=npm_tag]latest"
elif [[ $current_tag =~ $DEV_VERSION_REGEX ]]; then
echo "##vso[task.setvariable variable=npm_tag]dev"
else
# we should never get here
echo "tag ${current_tag} doesn't match semver"
echo "##vso[task.setvariable variable=npm_tag]random"
fi
fi
displayName: set npm tag
- task: Npm@1
inputs:
command: 'custom' # Options: install, publish, custom
verbose: true
customCommand: publish --tag $(npm_tag)
customRegistry: 'useNpmrc'
customEndpoint: npmjs-augur-integration
condition: |
and
(
succeeded(),
startsWith(variables['build.sourceBranch'], 'refs/tags/v')
)

0 comments on commit e6a3ee0

Please sign in to comment.