refine cd.yml, remove azure-pipelines.yml, merge pr_validation.yml to ci.yml
This commit is contained in:
Родитель
6f8f758c63
Коммит
e89293648e
|
@ -1,51 +0,0 @@
|
|||
trigger:
|
||||
- master
|
||||
- develop
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
linux:
|
||||
imageName: "ubuntu-16.04"
|
||||
mac:
|
||||
imageName: "macos-10.14"
|
||||
windows:
|
||||
imageName: "vs2017-win2016"
|
||||
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
||||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: "12.13.0"
|
||||
displayName: "Install Node.js"
|
||||
|
||||
- task: Npm@1
|
||||
inputs:
|
||||
verbose: false
|
||||
displayName: "Install dependencies"
|
||||
|
||||
- bash: |
|
||||
/usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
|
||||
displayName: Start xvfb
|
||||
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
|
||||
|
||||
- script: |
|
||||
npm run tslint
|
||||
displayName: Run TSLint Checks
|
||||
|
||||
- script: |
|
||||
npm run compile
|
||||
displayName: Compile Sources
|
||||
|
||||
- script: |
|
||||
node scripts/genAiKey.js
|
||||
npm install -g vsce
|
||||
vsce package
|
||||
displayName: Build VSIX Package
|
||||
|
||||
- script: |
|
||||
npm run test --silent
|
||||
displayName: Run Tests
|
||||
env:
|
||||
DISPLAY: ":99.0"
|
|
@ -27,17 +27,7 @@ steps:
|
|||
- template: common/check_steps.yml
|
||||
- template: common/test_steps.yml
|
||||
|
||||
# setting flag variables is_r, is_rc
|
||||
- bash: |
|
||||
rc_tag_regex=^refs\/tags\/v?[0-9]+\.[0-9]+\.[0-9]+-[Rr][Cc]
|
||||
r_tag_regex=^refs\/tags\/v?[0-9]+\.[0-9]+\.[0-9]+$
|
||||
|
||||
[[ $BUILD_SOURCEBRANCH =~ $rc_tag_regex ]] && is_rc=true
|
||||
[[ $BUILD_SOURCEBRANCH =~ $r_tag_regex ]] && is_r=true
|
||||
|
||||
echo "##vso[task.setvariable variable=is_rc]$is_rc"
|
||||
echo "##vso[task.setvariable variable=is_r]$is_r"
|
||||
displayName: Setting flag variable is_rc is_r
|
||||
- template: common/flagrc_steps.yml
|
||||
|
||||
# try to remove trailing rc for package.json
|
||||
- script: |
|
||||
|
@ -56,23 +46,13 @@ steps:
|
|||
displayName: Modify package.json for release candidates
|
||||
condition: and(succeeded(), eq(variables['is_r'], 'true'))
|
||||
|
||||
# generate vsix file
|
||||
- template: common/genvsix_steps.yml
|
||||
|
||||
# release to github
|
||||
# 1. copy vsix file to staging dir
|
||||
# 2. do GitHubRelease
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
SourceFolder: '$(System.DefaultWorkingDirectory)'
|
||||
Contents: |
|
||||
**/*.vsix
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
||||
- template: common/copyvsix_steps.yml
|
||||
|
||||
- task: GitHubRelease@0
|
||||
displayName: Deploy Releases or Release Candidates to GitHub Release
|
||||
inputs:
|
||||
gitHubConnection: 'github_release_pat_for_pnp_authoring'
|
||||
gitHubConnection: '[GitHub Connection Placeholder]'
|
||||
repositoryName: '$(Build.Repository.Name)'
|
||||
action: 'create'
|
||||
target: '$(Build.SourceVersion)'
|
||||
|
|
|
@ -2,7 +2,9 @@ trigger:
|
|||
- master
|
||||
- develop
|
||||
|
||||
pr: none
|
||||
pr:
|
||||
- master
|
||||
- develop
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
|
@ -22,4 +24,3 @@ steps:
|
|||
- template: common/compile_steps.yml
|
||||
- template: common/check_steps.yml
|
||||
- template: common/test_steps.yml
|
||||
- template: common/genvsix_steps.yml
|
||||
|
|
|
@ -0,0 +1,7 @@
|
|||
steps:
|
||||
- task: CopyFiles@2
|
||||
inputs:
|
||||
SourceFolder: '$(System.DefaultWorkingDirectory)'
|
||||
Contents: |
|
||||
**/*.vsix
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
|
@ -0,0 +1,12 @@
|
|||
steps:
|
||||
# setting flag variables is_r, is_rc
|
||||
- bash: |
|
||||
rc_tag_regex=^refs\/tags\/v?[0-9]+\.[0-9]+\.[0-9]+-[Rr][Cc]
|
||||
r_tag_regex=^refs\/tags\/v?[0-9]+\.[0-9]+\.[0-9]+$
|
||||
|
||||
[[ $BUILD_SOURCEBRANCH =~ $rc_tag_regex ]] && is_rc=true
|
||||
[[ $BUILD_SOURCEBRANCH =~ $r_tag_regex ]] && is_r=true
|
||||
|
||||
echo "##vso[task.setvariable variable=is_rc]$is_rc"
|
||||
echo "##vso[task.setvariable variable=is_r]$is_r"
|
||||
displayName: Setting flag variable is_rc is_r
|
|
@ -1,6 +1,6 @@
|
|||
schedules:
|
||||
- cron: '30 7 * * *'
|
||||
displayName: Nightly build on 14:30 AM (GMT+8)
|
||||
- cron: '0 20 * * *'
|
||||
displayName: Nightly build on 4:00 AM (GMT+8)
|
||||
branches:
|
||||
include:
|
||||
- develop
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
pr:
|
||||
- master
|
||||
- develop
|
||||
|
||||
trigger: none
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
linux:
|
||||
imageName: 'ubuntu-16.04'
|
||||
mac:
|
||||
imageName: 'macos-10.14'
|
||||
windows:
|
||||
imageName: 'vs2017-win2016'
|
||||
|
||||
pool:
|
||||
vmImage: $(imageName)
|
||||
|
||||
steps:
|
||||
|
||||
- template: common/setup_steps.yml
|
||||
- template: common/compile_steps.yml
|
||||
- template: common/check_steps.yml
|
||||
- template: common/test_steps.yml
|
||||
- template: common/genvsix_steps.yml
|
|
@ -0,0 +1,18 @@
|
|||
const fs = require("fs");
|
||||
|
||||
console.log(process.argv);
|
||||
|
||||
const cnt = process.argv.length;
|
||||
|
||||
if (cnt % 2 === 1) {
|
||||
console.log("Format error, expect even argv length!");
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync("package.json"));
|
||||
|
||||
for (var i = 3; i < cnt; i += 2) {
|
||||
packageJson[process.argv[i - 1]] = process.argv[i];
|
||||
}
|
||||
|
||||
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
|
|
@ -0,0 +1,14 @@
|
|||
const fs = require("fs");
|
||||
|
||||
|
||||
const packageJson = JSON.parse(fs.readFileSync("package.json"));
|
||||
const indexOfDash = packageJson.version.indexOf('-');
|
||||
|
||||
if (indexOfDash === -1) {
|
||||
// dash was not found.
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
packageJson.version = packageJson.version.substring(0, indexOfDash);
|
||||
|
||||
fs.writeFileSync("package.json", JSON.stringify(packageJson, null, 2) + "\n");
|
Загрузка…
Ссылка в новой задаче