steps:
  - script: npx gulp release --nightly --no-yarn --no-prepublish
    displayName: "gulp release"
  - task: CopyFiles@2
    displayName: "Copy Files to: $(Build.ArtifactStagingDirectory)"
    inputs:
      Contents: |
        $(System.DefaultWorkingDirectory)/*.vsix
      TargetFolder: "$(System.DefaultWorkingDirectory)/test/smoke/resources/extension"
  - script: npm run prepare-smoke-tests
    displayName: "Prepare smoke tests"
    env:
      NODE_OPTIONS: "--openssl-legacy-provider"
  - script: npm run prepare-smoke-tests-project
    displayName: "Prepare smoke tests sample project"
  - script: npm run smoke-tests --verbose
    continueOnError: true
    displayName: "Run smoke tests"
    env:
      DISPLAY: ":99.0"
  - task: PublishBuildArtifacts@1
    displayName: "Publish screenshots"
    inputs:
      PathtoPublish: "$(System.DefaultWorkingDirectory)/test/smoke/screenshots"
      ArtifactName: 'smoke-test-screenshots'
      publishLocation: 'Container'
