* Set up CI with Azure Pipelines

[skip ci]

* Updated the Azure pipelines file.

* updated file

* updated file

* Updated file

* Updated file

* updated gh release

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* updated azure pipelines file

* updated azurepipelines file

* updated file

* updated azure pipelines.

* updated file

* updated file

* updated yml file

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* updated

* Update azure-pipelines.yml for Azure Pipelines

* updated

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* Update azure-pipelines.yml for Azure Pipelines

* updated file

* updated

* updated file

* updated file

* updated

* updated file

* updated

* update

* update

* updated

* updated

* updated

* updated file
This commit is contained in:
Vikas 2022-01-06 09:43:31 -08:00 коммит произвёл GitHub
Родитель 36c94bab40
Коммит ebb277d749
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
4 изменённых файлов: 106 добавлений и 92 удалений

89
.github/workflows/vscode.yml поставляемый
Просмотреть файл

@ -1,89 +0,0 @@
name: CI
on:
push:
branches:
- master
tags:
- v*.*.*
pull_request:
branches:
- master
jobs:
vscode_azure_iot_edge_Stage_Linux:
name: Linux
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install NodeJs
uses: actions/setup-node@v1
with:
node-version: 17.x
- name: Check if release required
id: check-tag
run: |
echo ::set-output name=ISPRODTAG::v?[0-9]+\.[0-9]+\.[0-9]+$
if [[ ${{ github.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo ::set-output name=GITRELEASE_FLAG::true
echo ::set-output name=SOURCE_TAG::${GITHUB_REF#refs/tags}
elif [[ ${{ github.ref }} =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+-rc[0-9] ]]; then
echo ::set-output name=GITRELEASE_FLAG_RC::true
fi
- name: npm install
run: |
npm install
- name: install -g vsce
run: |
npm install -g vsce
- name: npm Package
run: |
npm run tslint
npm run compile
node scripts/genAiKey.js
echo "y" | vsce package
env:
GITHUB_TAG: ${{ steps.check-tag.outputs.SOURCE_TAG }}
ISPRODTAG: ${{ steps.check-tag.outputs.ISPRODTAG }}
PROD_AIKEY: ${{ secrets.PROD_AIKEY }}
- name: npm test
run: xvfb-run --auto-servernum --server-args="-screen 0, 1024x768x24" npm test --silent
- name: docker test
run: docker run -t --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --white-list "gitter.im/Microsoft/vscode-azure-iot-edge" --allow-dupe --allow-redirect --skip-save-results `ls *.md`
- name: GitHub Release
if: |
((success() && (steps.check-tag.outputs.GITRELEASE_FLAG == 'true')) ||
(success() && (steps.check-tag.outputs.GITRELEASE_FLAG_RC == 'true')))
uses: softprops/action-gh-release@v1
with:
files: ./**/*.vsix
- name: Publish to Marketplace
if: |
(success() && (steps.check-tag.outputs.GITRELEASE_FLAG == 'true'))
run: 'vsce publish -p ${{ secrets.VSCE_TOKEN }} --packagePath *.vsix'
vscode_azure_iot_edge_Stage_MacOS:
name: Mac-OS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Install NodeJs
uses: actions/setup-node@v1
with:
node-version: 17.x
- name: npm install
run: |
npm install
sudo npm install -g vsce
- name: npm Package
run: |
npm run tslint
npm run compile
node scripts/genAiKey.js
echo "y" | vsce package
- name: npm test
run: npm test --silent

Просмотреть файл

@ -1,15 +1,16 @@
const fs = require("fs");
if (process.env.GITHUB_TAG) {
const ISPROD = new RegExp(process.env.ISPRODTAG).test(process.env.GITHUB_TAG || "");
if (process.env.BUILD_SOURCEBRANCH) {
const ISPROD = new RegExp(process.env.ISPRODTAG).test(process.env.BUILD_SOURCEBRANCH || "");
const packageJson = JSON.parse(fs.readFileSync("package.json"));
if (ISPROD) {
packageJson.aiKey = process.env["PROD_AIKEY"];
console.log("Updated Prod AiKey");
} else {
packageJson.aiKey = process.env["INT_AIKEY"] || packageJson.aiKey;
console.log("Updated INT AiKey");
}
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
console.log("Updated AiKey");
} else {
console.log("Skipping genAiKey");
}

Просмотреть файл

@ -0,0 +1,82 @@
trigger:
branches:
include:
- refs/tags/v*
stages:
- stage: vscode_azure_iot_edge
displayName: vscode azure iot edge
jobs:
- job: Linux
pool:
vmImage: ubuntu-latest
steps:
- template: vsix-package.yml
- script: |
xvfb-run --auto-servernum --server-args="-screen 0, 1024x768x24" npm test --silent
displayName: 'npm test'
- script: |
docker run -t --rm -v $PWD:/mnt:ro dkhamsing/awesome_bot --white-list "gitter.im/Microsoft/vscode-azure-iot-edge" --allow-dupe --allow-redirect --skip-save-results `ls *.md`
displayName: 'docker test'
- task: CopyFiles@2
inputs:
SourceFolder: '$(Build.SourcesDirectory)'
Contents: '*.vsix'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)'
ArtifactName: 'drop'
publishLocation: 'Container'
- task: Bash@3
inputs:
targetType: 'inline'
script: |
echo "##vso[task.setvariable variable=ISPRODTAG;]v?[0-9]+\.[0-9]+\.[0-9]+$"
if [[ $(Build.SourceBranch) =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
echo "##vso[task.setvariable variable=GITRELEASE_FLAG;]true"
elif [[ $(Build.SourceBranch) =~ ^refs/tags/v?[0-9]+\.[0-9]+\.[0-9]+-rc[0-9] ]]; then
echo "##vso[task.setvariable variable=GITRELEASE_FLAG_RC;]true"
fi
- task: Bash@3
inputs:
targetType: 'inline'
script: |
echo "Set release flag: $GITRELEASE_FLAG"
echo "Set pre-release flag: $GITRELEASE_FLAG_RC"
- task: GitHubRelease@1
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'))
inputs:
gitHubConnection: 'vikas0212git'
repositoryName: '$(Build.Repository.Name)'
action: 'create'
target: '$(Build.SourceVersion)'
tagSource: 'userSpecifiedTag'
tag: '$(Build.SourceBranch)'
releaseNotesSource: 'inline'
assets: '$(Build.SourcesDirectory)/*.vsix'
isPreRelease: false
addChangeLog: false
- task: Bash@3
condition: and(succeeded(), startsWith(variables['Build.SourceBranch'], 'refs/tags/'), eq(variables['GITRELEASE_FLAG'], 'true'))
displayName: 'Publish to Marketplace'
inputs:
targetType: 'inline'
script: 'vsce publish -p $(VSCE_TOKEN) --packagePath *.vsix'
workingDirectory: '$(Build.ArtifactStagingDirectory)'
- job: MacOS
dependsOn: []
pool:
vmImage: macOS-latest
steps:
- template: vsix-package.yml
- script: |
npm test --silent
displayName: 'npm test'

20
vsts_ci/vsix-package.yml Normal file
Просмотреть файл

@ -0,0 +1,20 @@
steps:
- task: NodeTool@0
displayName: Install NodeJs
inputs:
versionSpec: '16.x'
checkLatest: true
- script: |
npm install
sudo npm install -g vsce
displayName: 'npm install'
- script: |
export PROD_AIKEY=$(PROD_AIKEY)
export ISPRODTAG=v?[0-9]+\.[0-9]+\.[0-9]+$
npm run tslint
npm run compile
node scripts/genAiKey.js
echo "y" | vsce package
displayName: 'npm Package'