forked from openhab/openhab-vscode
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved pipeline config and added naming script. (openhab#166)
Signed-off-by: Jerome Luckenbach <[email protected]>
- Loading branch information
1 parent
4b2d225
commit ff143fd
Showing
4 changed files
with
97 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# 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: | ||
- master | ||
pr: | ||
- master | ||
|
||
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 #. | ||
- 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}-ci-$(git rev-parse --short HEAD) | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
# Basic steps template | ||
steps: | ||
- bash: | | ||
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 & | ||
echo ">>> Started xvfb" | ||
displayName: Start xvfb | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) | ||
|
||
- bash: | | ||
echo ">>> Compile vscode-test" | ||
yarn && yarn compile | ||
echo ">>> Compiled vscode-test" | ||
cd sample | ||
echo ">>> Run sample integration test" | ||
yarn && yarn compile && yarn test | ||
displayName: Run Tests | ||
env: | ||
DISPLAY: ':99.0' | ||
|
||
# Acquire the `vsce` tool and use it to package | ||
# Copy a file to prevent webpack from failing as a workaround. | ||
- script: | | ||
sudo npm install -g vsce | ||
sudo cp client/node_modules/copy-paste/platform/linux.js client/node_modules/copy-paste/platform/openbsd.js | ||
vsce package | ||
displayName: Create VSIX | ||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux')) | ||
|
||
- script: | | ||
npm run vscode:prepublish | ||
cat /home/vsts/.npm/_logs/*.log | ||
displayName: Echo npm error logs on failure | ||
condition: failed() | ||
|
||
# For releasable builds, we'll want the branch and the changelog | ||
# Expects that a 'version.txt' has been laid down by a previous step | ||
- bash: | | ||
echo $(Build.SourceBranch) | sed "s|refs/[^/]*/||" > branch.txt | ||
PACKAGE_VERSION=$(cat version.txt) | ||
VERSION_REGEX="## $(echo $PACKAGE_VERSION | sed 's/\./\\./g')" | ||
sed -n "/$VERSION_REGEX/,/## 1\..*/p" CHANGELOG.md | head -n -2 > minichangelog.txt | ||
displayName: Get branch and mini-changelog | ||
|
||
# Choose files to publish | ||
- task: CopyFiles@2 | ||
displayName: Stage VSIX for publishing | ||
inputs: | ||
contents: |- | ||
*.vsix | ||
version.txt | ||
branch.txt | ||
minichangelog.txt | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
|
||
# Publish files as an artifact | ||
- task: PublishPipelineArtifact@1 | ||
displayName: Publish VSIX | ||
inputs: | ||
artifact: openhab-vscode | ||
targetPath: $(Build.ArtifactStagingDirectory) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.