Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
Add CD on a Linux agent. Fixes #33
Browse files Browse the repository at this point in the history
  • Loading branch information
branchseer committed Dec 4, 2019
1 parent 5ffaa5b commit aa8ffd2
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 2 deletions.
46 changes: 44 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ stages:

- stage: Release
dependsOn: BuildAndTest
condition: eq(variables['DESKGAP_AZ_RELEASE'], '1')
condition: contains(variables['Build.SourceVersionMessage'], '[ci release]')
jobs:
- job: Publish
pool:
Expand All @@ -216,4 +216,46 @@ stages:
artifact: npmTarball
- download: current
artifact: distZips
- bash: ls "$(Pipeline.Workspace)"

- bash: |
deskgapVersion=$(<$(Build.SourcesDirectory)/node/VERSION)
echo "##vso[task.setvariable variable=DESKGAP_VERSION]$deskgapVersion"
- task: GitHubRelease@0
inputs:
gitHubConnection: 'GitHub connection 1'
action: 'create'
repositoryName: '$(Build.Repository.Name)'
target: '$(Build.SourceVersion)'
tagSource: 'manual'
tag: 'v$(DESKGAP_VERSION)'
assets: |
$(Pipeline.Workspace)/distZips/*
$(Pipeline.Workspace)/npmTarball/*
isDraft: false
addChangeLog: false
releaseNotesSource: 'file'
releaseNotesFile: $(Build.SourcesDirectory)/node/VERSION/WHATS_NEW.md

- task: Bash@3
displayName: "Publish to Binary and npm"
inputs:
filePath: $(Build.SourcesDirectory)/node/scripts/publish-release.sh
env:
DESKGAP_DISTS_DIR: $(Pipeline.Workspace)/distZips
DESKGAP_NPM_TARBALL: $(Pipeline.Workspace)/npmTarball/npm.tgz
DESKGAP_NPM_TEST_VERSION_FILE: $(Build.SourcesDirectory)/node/VERSION

- bash: |
set -e
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
sleep 6
displayName: 'Start xvfb'
- task: Bash@3
displayName: "Final Test After Release"
inputs:
filePath: $(Build.SourcesDirectory)/node/scripts/test-npm.sh
env:
DISPLAY: ':99.0'
DESKGAP_NPM_TEST_INSTALL_WHAT: deskgap
DESKGAP_NPM_TEST_VERSION_FILE: $(Build.SourcesDirectory)/node/VERSION
13 changes: 13 additions & 0 deletions node/scripts/publish-release.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env bash
set -e
scriptDir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
deskgapVersion=$(<$scriptDir/../VERSION)

for zipFilePath in $DESKGAP_DISTS_DIR/*.zip
do
zipFilename=$(basename $zipFilePath)
echo Uploading $zipFilename
curl -T "$zipFilePath" -u$DESKGAP_BINTRAY_USER:$DESKGAP_BINTRAY_KEY https://api.bintray.com/content/patr0nus/DeskGap/releases/$deskgapVersion/$zipFilename
done
curl -X POST -u$DESKGAP_BINTRAY_USER:$DESKGAP_BINTRAY_KEY https://api.bintray.com/content/patr0nus/DeskGap/releases/$deskgapVersion/publish
npm publish $DESKGAP_NPM_TARBALL

0 comments on commit aa8ffd2

Please # to comment.