Skip to content

Commit

Permalink
Make it a OneBranch build (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
bwateratmsft authored Jan 31, 2024
1 parent 78d9074 commit 967ce93
Show file tree
Hide file tree
Showing 3 changed files with 89 additions and 54 deletions.
54 changes: 0 additions & 54 deletions .azure-pipelines/1esmain.yml

This file was deleted.

35 changes: 35 additions & 0 deletions .azure-pipelines/OneBranch.Official.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Trigger the build whenever `main` or `rel/*` is updated
trigger:
- main
- rel/*

pr: none # Disable PR trigger

# Scheduled nightly build
schedules:
- cron: "0 0 * * *"
displayName: Nightly scheduled build
always: false # Don't rebuild if there haven't been changes
branches:
include:
- main

# Grab the base templates from https://github.com/microsoft/vscode-azuretools/tree/main/azure-pipelines and OneBranch
resources:
repositories:
- repository: templates
type: github
name: microsoft/vscode-azuretools
ref: main
endpoint: GitHub
- repository: templates
type: git
name: OneBranch.Pipelines/GovernedTemplates
ref: refs/heads/main

# Use those templates
extends:
template: v2/OneBranch.Official.CrossPlat.yml@templates
parameters:
stages:
- template: common-build.yml
54 changes: 54 additions & 0 deletions .azure-pipelines/common-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
stages:
- stage: build
jobs:
- job: main
pool:
type: windows
name: OneBranchPipelines
steps:
- task: NodeTool@0
displayName: Using Node.js
inputs:
versionSource: fromFile
versionFilePath: .nvmrc

- task: Npm@1
displayName: Install Dependencies
inputs:
command: custom
customCommand: ci --no-optional

- bash: |
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
echo ">>> Started xvfb"
displayName: Start X Virtual Frame Buffer
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
- task: Npm@1
displayName: "Build"
inputs:
command: custom
customCommand: run build

- task: Npm@1
displayName: "Package"
inputs:
command: custom
customCommand: run package

- task: CopyFiles@2
displayName: "Copy packages and vsix to staging directory"
inputs:
Contents: |
**/*.vsix
**/*.tar.gz
**/*.tgz
TargetFolder: "$(build.artifactstagingdirectory)/build"
condition: and(eq(variables['Agent.OS'], 'Linux'), ne(variables['System.PullRequest.IsFork'], 'True'))

- task: PublishBuildArtifacts@1
displayName: "Publish artifacts: packages and vsix"
inputs:
PathtoPublish: "$(build.artifactstagingdirectory)/build"
ArtifactName: $(artifact_name)
condition: and(eq(variables['Agent.OS'], 'Linux'), ne(variables['System.PullRequest.IsFork'], 'True'))

0 comments on commit 967ce93

Please sign in to comment.