-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Private/Restricted Repos and Packages #8
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ you'll need to configured that workflow yourself. You can look to the | |
### Workflow | ||
|
||
* Check for the latest version number published to npm. | ||
* If you wish privately publish your package please ensure you have set `NPM_PRIVATE` to `true` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Go ahead and just add another section at the bottom for features and write up this feature along with an example. This is a great feature and I want to make sure people see the work you’ve done 😁 |
||
* Lookup all commits between the git commit that triggered the action and the latest publish. | ||
* If the package hasn't been published or the prior publish does not include a git hash, we'll | ||
only pull the commit data that triggered the action. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,8 +57,13 @@ const run = async () => { | |
console.log('current:', current, '/', 'version:', version) | ||
let newVersion = execSync(`npm version --git-tag-version=false ${version}`).toString() | ||
console.log('new version:', newVersion) | ||
exec(`npm publish --access=public`) | ||
exec(`git checkout package.json`) // cleanup | ||
|
||
let access = '' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can be more easily written as |
||
process.env.NPM_PRIVATE ? access = 'restricted' : 'public' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tt @ |
||
|
||
exec(`npm publish --access=${access}`) | ||
|
||
exec(`git checkout package.json`) | ||
exec(`git tag ${newVersion}`) | ||
exec(`git push merge-release --tags`) | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let’s leave this out so that we’re testing the default behavior in our own publishes.