Skip to content

Commit

Permalink
Build process updates (#31)
Browse files Browse the repository at this point in the history
* Update build and enable pack in build.ps1

* newline
  • Loading branch information
TylerLeonhardt authored Jun 27, 2019
1 parent e491f8c commit ba70b90
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
24 changes: 22 additions & 2 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,25 @@ steps:
versionSpec: '10.x'
displayName: 'Install Node.js'

- pwsh: ./build.ps1
displayName: 'Build script'
- pwsh: ./build.ps1 -Pack -Test
displayName: 'Build script'

- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: '*.tgz'
targetFolder: $(Build.ArtifactStagingDirectory)/npm
displayName: 'Copy npm package'

- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
contents: 'package.json'
targetFolder: $(Build.ArtifactStagingDirectory)/npm
displayName: 'Copy package.json'

- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: '$(Build.ArtifactStagingDirectory)/npm'
artifactName: npm
displayName: 'Publish npm artifact'
19 changes: 19 additions & 0 deletions build.ps1
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
param(
# Determines if we run `npm pack`.
[Parameter()]
[switch]
$Pack,

# Determines if we run the tests.
[Parameter()]
[switch]
$Test,

# Runs the watch npm command instead.
[Parameter()]
[switch]
Expand All @@ -13,6 +23,15 @@ npm install

if ($Watch.IsPresent) {
npm run watch
return
} else {
npm run compile
}

if ($Test.IsPresent) {
# We would run the tests here.
}

if ($Pack.IsPresent) {
npm pack
}

0 comments on commit ba70b90

Please sign in to comment.