Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Pipelines configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmarti committed Apr 10, 2019
1 parent bab4309 commit 2945a49
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
trigger:
branches:
include: ['*']
tags:
include: ['*']

steps:
- task: NodeTool@0
inputs:
versionSpec: "10.15.1"

- script: |
set -e
NAME=$(node -p "require('./package.json').name")
VERSION=$(node -p "require('./package.json').version")
TMP_NAME="$NAME-$VERSION.tgz"
if [[ "$BUILD_SOURCEBRANCH" != refs/tags/* ]]; then
VERSION="$VERSION-${BUILD_SOURCEVERSION:0:8}"
fi
TGZ_NAME="$NAME-$VERSION.tgz"
TGZ_PATH="$SYSTEM_ARTIFACTSDIRECTORY/$TGZ_NAME"
npm pack
mv "$TMP_NAME" "$TGZ_PATH"
echo "##vso[task.setvariable variable=TgzName]$TGZ_NAME"
echo "##vso[task.setvariable variable=TgzPath]$TGZ_PATH"
displayName: Build

- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact'
inputs:
artifactName: $(TgzName)
targetPath: $(TgzPath)

- task: GitHubRelease@0
displayName: 'Create GitHub Release'
inputs:
gitHubConnection: 'GitHub Connection'
repositoryName: $(Build.Repository.Name)
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))

0 comments on commit 2945a49

Please sign in to comment.