Skip to content

Commit

Permalink
build: add pipelines (#374)
Browse files Browse the repository at this point in the history
* build: add pipelines

* build: update CI pipeline

* build: use windows runner
  • Loading branch information
blackchoey authored Jan 9, 2025
1 parent fdbcbd5 commit 0180e2a
Show file tree
Hide file tree
Showing 8 changed files with 160 additions and 6 deletions.
42 changes: 42 additions & 0 deletions .azure-pipelines/1esmain.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Trigger the build whenever `main` or `rel/*` is updated
trigger:
- main
- rel/*

# Disable PR trigger
pr: none

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

# `resources` specifies the location of templates to pick up, use it to get AzExt templates
resources:
repositories:
- repository: azExtTemplates
type: github
name: microsoft/vscode-azuretools
ref: main
endpoint: GitHub-AzureTools # The service connection to use when accessing this repository

parameters:
- name: enableLongRunningTests
displayName: Enable Long Running Tests
type: boolean
default: true

variables:
# Required by MicroBuild template
- name: TeamName
value: "Azure Tools for VS Code"

# Use those templates
extends:
template: azure-pipelines/1esmain.yml@azExtTemplates
parameters:
useAzureFederatedCredentials: ${{ parameters.enableLongRunningTests }}
29 changes: 29 additions & 0 deletions .azure-pipelines/SignExtension.signproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="Current" Sdk="Microsoft.Build.NoTargets/3.7.56">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<!-- FilesToSign needs to be inside $(OutDir) hence we copy it into
$(OutDir) before (from CWD) and move it back outside after the signing -->
<FilesToSign Include="$(OutDir)\extension.signature.p7s">
<!-- Add the certificate friendly name below -->
<Authenticode>VSCodePublisher</Authenticode>
</FilesToSign>
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.VisualStudioEng.MicroBuild.Core" Version="1.0.0">
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>

<Target Name="CopySignatureFile" BeforeTargets="SignFiles">
<Copy SourceFiles="$(ProjectDir)\..\extension.manifest" DestinationFiles="$(OutDir)\extension.signature.p7s" />
</Target>

<Target Name="CopyBackSignatureFile" AfterTargets="SignFiles">
<Copy SourceFiles="$(OutDir)\extension.signature.p7s" DestinationFiles="$(ProjectDir)\..\extension.signature.p7s" />
</Target>
</Project>
4 changes: 0 additions & 4 deletions .azure-pipelines/compliance/CredScanSuppressions.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
{
"folder": "node_modules\\",
"_justification": "No need to scan external node modules."
},
{
"folder": "resources\\backupTemplates\\",
"_justification": "No need to scan backup templates."
}
]
}
18 changes: 18 additions & 0 deletions .azure-pipelines/compliance/tsaoptions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"tsaVersion": "TsaV2",
"codeBase": "NewOrUpdate",
"codeBaseName": "vscode-apimanagement",
"tsaStamp": "DevDiv",
"notificationAliases": [
"[email protected]"
],
"codebaseAdmins": [
"fareast\\chyuan",
"fareast\\shenwe"
],
"instanceUrl": "https://devdiv.visualstudio.com",
"projectName": "DevDiv",
"areaPath": "DevDiv\\API Catalog Tooling",
"iterationPath": "DevDiv",
"allTools": true
}
36 changes: 36 additions & 0 deletions .azure-pipelines/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
trigger: none

parameters:
- name: publishVersion
displayName: Version to publish
type: string
- name: dryRun
displayName: Dry run
type: boolean
default: false

resources:
pipelines:
- pipeline: build
source: \API Catalog Tooling\VSCode\Extensions\vscode-apimanagement # CUSTOMIZE - location of the pipeline that produces the artifacts
repositories:
- repository: azExtTemplates
type: github
name: microsoft/vscode-azuretools
ref: main
endpoint: GitHub-AzureTools

variables:
# Required by MicroBuild template
- name: TeamName
value: "API Catalog Tooling" # CUSTOMIZE

# Use those templates
extends:
template: azure-pipelines/release-extension.yml@azExtTemplates
parameters:
pipelineID: $(resources.pipeline.build.pipelineID)
runID: $(resources.pipeline.build.runID)
publishVersion: ${{ parameters.publishVersion }}
dryRun: ${{ parameters.dryRun }}
environmentName: VscodeApimExtDeploy # CUSTOMIZE
33 changes: 33 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:
runs-on: windows-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '18'

- name: Install dependencies
run: npm install

- name: Build
run: npm run build

# Disable lint check temporary before we fix all the lint issues
# - name: Lint
# run: npm run lint

- name: Run tests
run: npm run test
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
18
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -805,12 +805,11 @@
},
"scripts": {
"vscode:prepublish": "npm run webpack-prod",
"build": "tsc -p ./",
"build": "tsc -p ./ && gulp webpack-prod",
"compile": "tsc -watch -p ./",
"package": "vsce package",
"lint": "tslint --project tsconfig.json -e src/*.d.ts -t verbose",
"lint-fix": "tslint --project tsconfig.json -t verbose --fix",
"pretest": "npm run build && npm run webpack",
"test": "vscode-test",
"watch": "tsc -watch -p ./",
"all": "npm i && npm run lint && npm test",
Expand Down

0 comments on commit 0180e2a

Please sign in to comment.