Skip to content

Commit

Permalink
Build script
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Dec 31, 2022
1 parent 9211018 commit f3cd813
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 39 deletions.
45 changes: 19 additions & 26 deletions build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ variables:
value: 'x86'
- name: buildConfiguration
value: 'Release'
- name: isMain
value: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]

steps:
- checkout: self
Expand All @@ -38,32 +40,6 @@ steps:
inputs:
versionSpec: '18.x'

- script: |
npm --no-git-tag-version version $(GitVersion.SemVer)
npm i -g vsce
yarn install
gulp build
displayName: Build ADS extension
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

- task: CmdLine@2
displayName: Update version of ADS extension
inputs:
script: npm --no-git-tag-version version $(GitVersion.SemVer)
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

- task: CmdLine@2
displayName: yarn install
inputs:
script: yarn install
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

- task: CmdLine@2
displayName: gulp build
inputs:
script: gulp build
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

- task: NuGetCommand@2
displayName: NuGet Restore
inputs:
Expand Down Expand Up @@ -144,8 +120,25 @@ steps:
artifact: 'SSMSVersion'
publishLocation: 'pipeline'

- script: |
call npm --no-git-tag-version version $(GitVersion.SemVer)
call npm i -g vsce
call yarn install
call gulp build
call gulp package:offline
displayName: Build ADS extension
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

- task: PublishPipelineArtifact@1
displayName: Publish ADS Extension installer to pipeline
inputs:
targetPath: 'AzureDataStudioExtension\azuredatastudio-sql4cds-$(GitVersion.SemVer).vsix'
artifact: 'ADSInstaller'
publishLocation: 'pipeline'

- task: GitTag@5
displayName: Label Source
condition: and(succeeded(), eq(variables.isMain, 'true'))
inputs:
workingdir: '$(Build.SourcesDirectory)'
tag: 'v$(GitVersion.NuGetVersion)'
Expand Down
26 changes: 13 additions & 13 deletions pr-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,6 @@ steps:
filePath: 'MarkMpn.Sql4Cds.SSMS\update-version.ps1'
arguments: '$(GitVersion.AssemblySemVer)'
pwsh: true

- task: NodeTool@0
displayName: Install Node.js
inputs:
versionSpec: '18.x'

- script: |
call npm --no-git-tag-version version $(GitVersion.SemVer)
call npm i -g vsce
call yarn install
call gulp build
displayName: Build ADS extension
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

- task: NuGetCommand@2
displayName: NuGet Restore
Expand Down Expand Up @@ -72,3 +59,16 @@ steps:
testAssemblyVer2: |
**/MarkMpn.*.Tests.dll
!**\obj\**
- task: NodeTool@0
displayName: Install Node.js
inputs:
versionSpec: '18.x'

- script: |
call npm --no-git-tag-version version $(GitVersion.SemVer)
call npm i -g vsce
call yarn install
call gulp build
displayName: Build ADS extension
workingDirectory: '$(Build.SourcesDirectory)\AzureDataStudioExtension'

0 comments on commit f3cd813

Please sign in to comment.