Publish verification in PR job (#474)

* Fixing OS specific failure in publish task

* Adding publish verfification into the PR job

* Adding some comments.

* Removing the diagnostic logs
This commit is contained in:
Anandraj 2020-06-30 09:56:54 -07:00 коммит произвёл GitHub
Родитель 3ee8ed280d
Коммит 0b3c3a806f
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 28 добавлений и 4 удалений

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

@ -82,6 +82,17 @@ jobs:
inputs:
script: NDK=ndk`cat ${ANDROID_SDK_ROOT}/ndk-bundle/source.properties 2>&1 | grep Pkg.Revision | awk '{ print $3}' | awk -F. '{ print $1 }'`; mono $(System.DefaultWorkingDirectory)/nuget-bin/nuget.exe pack $(System.DefaultWorkingDirectory)/ReactAndroid/ReactAndroid.nuspec -OutputDirectory $(System.DefaultWorkingDirectory) -Properties buildNumber=$(buildNumber)-$NDK;commitId=$(Build.SourceVersion)
- task: CmdLine@2
displayName: 'Npm pack'
inputs:
script: node .ado/npmOfficePack.js --fake
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)
- task: CmdLine@2
displayName: gradlew clean
inputs:

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

@ -19,7 +19,7 @@ function exec(command) {
}
}
function doPublish() {
function doPublish(fakeMode) {
console.log(`Target branch to publish to: ${publishBranchName}`);
const {releaseVersion, branchVersionSuffix} = gatherVersionInfo()
@ -27,7 +27,7 @@ function doPublish() {
const onlyTagSource = !!branchVersionSuffix;
if (!onlyTagSource) {
// -------- Generating Android Artifacts with JavaDoc
exec(path.join(process.env.BUILD_STAGINGDIRECTORY,"gradlew") + " installArchives");
exec(path.join(process.env.BUILD_SOURCESDIRECTORY, "gradlew") + " installArchives");
// undo uncommenting javadoc setting
exec("git checkout ReactAndroid/gradle.properties");
@ -40,7 +40,19 @@ function doPublish() {
const npmTarPath = path.resolve(__dirname, '..', npmTarFileName);
const finalTarPath = path.join(process.env.BUILD_STAGINGDIRECTORY, 'final', npmTarFileName);
console.log(`Copying tar file ${npmTarPath} to: ${finalTarPath}`)
fs.copyFileSync(npmTarPath, finalTarPath);
if(fakeMode) {
if (!fs.existsSync(npmTarPath))
throw "The final artefact to be published is missing.";
} else {
fs.copyFileSync(npmTarPath, finalTarPath);
}
}
doPublish();
var args = process.argv.slice(2);
let fakeMode = false;
if (args.length > 0 && args[0] === '--fake')
fakeMode = true;
doPublish(fakeMode);

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

@ -170,6 +170,7 @@ jobs:
script: node .ado/npmOfficePack.js
env:
BUILD_STAGINGDIRECTORY: $(Build.StagingDirectory)
BUILD_SOURCESDIRECTORY: $(Build.SourcesDirectory)
BUILD_SOURCEBRANCH: $(Build.SourceBranch)
SYSTEM_ACCESSTOKEN: $(System.AccessToken)
githubApiToken: $(githubApiToken)