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()}`;