From 18cf894dd093c464284a47cd109131c9304997c1 Mon Sep 17 00:00:00 2001 From: "REDMOND\\acoates" Date: Mon, 13 May 2019 15:36:32 -0700 Subject: [PATCH] Update publish step to allow publishing different npm tags --- .ado/publish.yml | 2 +- .ado/updateVersion.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.ado/publish.yml b/.ado/publish.yml index b6698aefbce..fdbb4661527 100644 --- a/.ado/publish.yml +++ b/.ado/publish.yml @@ -63,6 +63,6 @@ jobs: command: custom workingDir: vnext verbose: false - customCommand: 'publish --access public --tag vnext' + customCommand: publish --access public --tag $(npmTag) customEndpoint: 'React-Native-Windows NPM' publishEndpoint: 'React-Native-Windows NPM' diff --git a/.ado/updateVersion.js b/.ado/updateVersion.js index 41fc5c710c7..a533b487ff2 100644 --- a/.ado/updateVersion.js +++ b/.ado/updateVersion.js @@ -20,6 +20,9 @@ function exec(command) { function updateVersion() { const publishBranchName = process.env.BUILD_SOURCEBRANCH.match(/refs\/heads\/(.*)/)[1]; + + // Set env variable to allow npm publish task to publish to correct tag + console.log(`##vso[task.setvariable variable=npmTag]${publishBranchName === 'master' ? 'vnext' : publishBranchName}`); console.log(`Target branch to publish to: ${publishBranchName}`); const tempPublishBranch = `publish-temp-${Date.now()}`;