openhab-vscode/.azure-pipelines/azure-pipelines.yml

42 lines
1.2 KiB
YAML

# CI and PR build script
#
# Basic information can be found here:
# https://code.visualstudio.com/api/working-with-extensions/continuous-integration
#
# The structure of this pipeline configuration is mainly inspired by microsofts code extension for azure pipelines.
# It can be found here:
# https://github.com/microsoft/azure-pipelines-vscode
#
#
trigger:
branches:
include: ['*']
tags:
include: ['*']
pr:
- master
- beta-version
pool:
vmImage: ubuntu-16.04
steps:
# tag CI-produced packages with a version number pointing to the commit which was built.
# for PRs, also include the PR #.
# Temporary remove ci naming for non pr builds
- bash: |
PACKAGE_VERSION=$(node -p "require('./package.json').version")
if [ -n "$SYSTEM_PULLREQUEST_PULLREQUESTNUMBER" ]; then
VERSION_STRING=${PACKAGE_VERSION}-pr-${SYSTEM_PULLREQUEST_PULLREQUESTNUMBER}-$(git rev-parse --short HEAD)
else
VERSION_STRING=${PACKAGE_VERSION}
fi
npm --no-git-tag-version version $VERSION_STRING
echo "##vso[build.updatebuildnumber]${VERSION_STRING}_${BUILD_BUILDID}"
echo "$PACKAGE_VERSION" > version.txt
displayName: Set version number of package and build
condition: eq(variables['Agent.OS'], 'Linux')
- template: basic-steps.yml