chore: Prepare nightly build pipeline (#1178)
This commit is contained in:
Родитель
138c64699d
Коммит
ee4c62f27e
|
@ -0,0 +1,107 @@
|
|||
# Gradle
|
||||
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
|
||||
# Add steps that analyze code, save build artifacts, deploy, and more:
|
||||
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
|
||||
|
||||
trigger: none
|
||||
pr: none
|
||||
|
||||
schedules:
|
||||
- cron: "0 0 * * *"
|
||||
displayName: Daily midnight build
|
||||
branches:
|
||||
include:
|
||||
- main
|
||||
|
||||
pool:
|
||||
vmImage: 'ubuntu-latest'
|
||||
|
||||
steps:
|
||||
- task: JavaToolInstaller@0
|
||||
displayName: Install Java 11
|
||||
inputs:
|
||||
versionSpec: '11'
|
||||
jdkArchitectureOption: 'x64'
|
||||
jdkSourceOption: 'PreInstalled'
|
||||
- task: NodeTool@0
|
||||
displayName: Install Node 14.15.4
|
||||
inputs:
|
||||
versionSpec: '14.15.4'
|
||||
- task: Gradle@2
|
||||
displayName: Build
|
||||
inputs:
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
tasks: 'build'
|
||||
- task: Gradle@2
|
||||
displayName: PrepareForRelease
|
||||
inputs:
|
||||
gradleWrapperFile: 'gradlew'
|
||||
gradleOptions: '-Xmx3072m'
|
||||
tasks: 'prepareForRelease'
|
||||
- bash: |
|
||||
cd $(Build.SourcesDirectory)/extension/lib
|
||||
chmod +x gradle-server
|
||||
displayName: Set permission
|
||||
- task: SFP.build-tasks.custom-build-task-1.EsrpCodeSigning@1
|
||||
displayName: 'ESRP CodeSigning'
|
||||
inputs:
|
||||
ConnectedServiceName: 'vscjavaci_codesign'
|
||||
FolderPath: extension/lib
|
||||
Pattern: 'gradle-server.jar'
|
||||
signConfigType: inlineSignParams
|
||||
inlineOperation: |
|
||||
[
|
||||
{
|
||||
"KeyCode" : "CP-447347-Java",
|
||||
"OperationCode" : "JavaSign",
|
||||
"Parameters" : {
|
||||
"SigAlg" : "SHA256withRSA",
|
||||
"Timestamp" : "-tsa http://sha256timestamp.ws.digicert.com/sha256/timestamp"
|
||||
},
|
||||
"ToolName" : "sign",
|
||||
"ToolVersion" : "1.0"
|
||||
},
|
||||
{
|
||||
"KeyCode" : "CP-447347-Java",
|
||||
"OperationCode" : "JavaVerify",
|
||||
"Parameters" : {},
|
||||
"ToolName" : "sign",
|
||||
"ToolVersion" : "1.0"
|
||||
}
|
||||
]
|
||||
- bash: |
|
||||
cd $(Build.SourcesDirectory)/extension
|
||||
npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
|
||||
displayName: Replace AI Key
|
||||
- bash: |
|
||||
node ./scripts/prepare-nightly-build.js
|
||||
mv ./package.insiders.json ./package.json
|
||||
displayName: Generate new package.json
|
||||
- task: ComponentGovernanceComponentDetection@0
|
||||
inputs:
|
||||
scanType: 'Register'
|
||||
verbosity: 'Verbose'
|
||||
alertWarningLevel: 'High'
|
||||
- task: notice@0
|
||||
displayName: 'NOTICE File Generator'
|
||||
inputs:
|
||||
outputformat: 'text'
|
||||
- task: DownloadPipelineArtifact@2
|
||||
displayName: Download NOTICE file
|
||||
inputs:
|
||||
artifact: 'NOTICE.txt'
|
||||
path: $(Build.SourcesDirectory)/extension
|
||||
- bash: |
|
||||
cd $(Build.SourcesDirectory)/extension
|
||||
npx vsce@latest package
|
||||
displayName: Package VSIX
|
||||
- task: CopyFiles@2
|
||||
displayName: Copy VSIX
|
||||
inputs:
|
||||
Contents: 'extension/*.vsix'
|
||||
TargetFolder: '$(Build.ArtifactStagingDirectory)'
|
||||
- task: PublishBuildArtifacts@1
|
||||
displayName: Publish VSIX
|
||||
inputs:
|
||||
ArtifactName: extension
|
|
@ -8,7 +8,7 @@ This VS Code extension provides a visual interface for your Gradle build. You ca
|
|||
|
||||
## Requirements
|
||||
|
||||
- [VS Code >= 1.60.0](https://code.visualstudio.com/download)
|
||||
- [VS Code >= 1.63.0](https://code.visualstudio.com/download)
|
||||
- [Java >= 8](https://adoptopenjdk.net/)
|
||||
|
||||
## Project Discovery
|
||||
|
|
|
@ -16,5 +16,5 @@ module.exports = {
|
|||
"no-case-declarations": "off",
|
||||
"no-async-promise-executor": "off",
|
||||
},
|
||||
ignorePatterns: "scripts/update-third-party-notice.js",
|
||||
ignorePatterns: "scripts/*.js",
|
||||
};
|
||||
|
|
|
@ -26,3 +26,5 @@ ARCHITECTURE.md
|
|||
# Ignore output of code sign
|
||||
lib/*.md
|
||||
scripts
|
||||
# for nightly build
|
||||
package.insiders.json
|
||||
|
|
|
@ -331,9 +331,9 @@
|
|||
"dev": true
|
||||
},
|
||||
"@types/vscode": {
|
||||
"version": "1.60.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.60.0.tgz",
|
||||
"integrity": "sha512-wZt3VTmzYrgZ0l/3QmEbCq4KAJ71K3/hmMQ/nfpv84oH8e81KKwPEoQ5v8dNCxfHFVJ1JabHKmCvqdYOoVm1Ow==",
|
||||
"version": "1.63.0",
|
||||
"resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.63.0.tgz",
|
||||
"integrity": "sha512-iePu1axOi5WSThV6l2TYcciBIpAlMarjBC8H0y8L8ocsZLxh7MttzwFU3pjoItF5fRVGxHS0Hsvje9jO3yJsfw==",
|
||||
"dev": true
|
||||
},
|
||||
"@typescript-eslint/eslint-plugin": {
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
},
|
||||
"license": "SEE LICENSE IN LICENSE.md",
|
||||
"engines": {
|
||||
"vscode": "^1.60.0",
|
||||
"vscode": "^1.63.0",
|
||||
"node": "^14.15.4",
|
||||
"npm": "^6.14.10"
|
||||
},
|
||||
|
@ -877,7 +877,7 @@
|
|||
"@types/mocha": "^9.1.0",
|
||||
"@types/node": "^14.14.31",
|
||||
"@types/sinon": "^10.0.11",
|
||||
"@types/vscode": "1.60.0",
|
||||
"@types/vscode": "1.63.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.11.0",
|
||||
"@typescript-eslint/parser": "^5.11.0",
|
||||
"@vscode/test-electron": "^2.1.2",
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
const fs = require("fs");
|
||||
|
||||
const json = JSON.parse(fs.readFileSync("./package.json").toString());
|
||||
const stableVersion = json.version.match(/(\d+)\.(\d+)\.(\d+)/);
|
||||
const major = stableVersion[1];
|
||||
const minor = stableVersion[2];
|
||||
|
||||
function prependZero(number) {
|
||||
if (number > 99) {
|
||||
throw "Unexpected value to prepend with zero";
|
||||
}
|
||||
return `${number < 10 ? "0" : ""}${number}`;
|
||||
}
|
||||
|
||||
const date = new Date();
|
||||
const month = date.getMonth() + 1;
|
||||
const day = date.getDate();
|
||||
const hours = date.getHours();
|
||||
patch = `${date.getFullYear()}${prependZero(month)}${prependZero(day)}${prependZero(hours)}`;
|
||||
|
||||
const insiderPackageJson = Object.assign(json, {
|
||||
version: `${major}.${minor}.${patch}`,
|
||||
});
|
||||
|
||||
fs.writeFileSync("./package.insiders.json", JSON.stringify(insiderPackageJson));
|
|
@ -1 +1 @@
|
|||
export const VSCODE_TEST_VERSIONS = ["1.60.0"];
|
||||
export const VSCODE_TEST_VERSIONS = ["1.63.0"];
|
||||
|
|
Загрузка…
Ссылка в новой задаче