Skip to content

Commit

Permalink
Update publish step to allow publishing different npm tags
Browse files Browse the repository at this point in the history
  • Loading branch information
acoates-ms committed May 13, 2019
1 parent 0692bea commit 18cf894
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .ado/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
3 changes: 3 additions & 0 deletions .ado/updateVersion.js
Original file line number Diff line number Diff line change
Expand Up @@ -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()}`;
Expand Down

0 comments on commit 18cf894

Please sign in to comment.