-
Notifications
You must be signed in to change notification settings - Fork 343
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
Fix release workflows, again #1214
Conversation
* Use fallback false value on test-deploy workflow * Replace `softprops/action-gh-release` with `gh`
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.
A few questions
@@ -102,47 +102,29 @@ jobs: | |||
registry-url: https://registry.npmjs.org | |||
- run: npm install | |||
- run: | |||
npm ${{ inputs.release && 'publish' || 'publish --dry-run' }} | |||
npm ${{ inputs.release && 'publish' || 'publish --dry-run' }} || ${{ |
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.
why not just use conditional workflow steps?
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.
Agreed, it would be much clearer for any post analysis.
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.
But we'd need to use up some of our newline quota 😄
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.
Note that the extra || ${{ inputs.release && 'true' || 'false' }}
was immediately reverted with #1215; I added it to make the (non-dry) publish process idempotent, because trying to publish an existing version would fail.
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.
Ternary operator
- run: npm ${{ inputs.release && 'publish' || 'publish --dry-run' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Conditional steps
- if: inputs.release == true
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- if: inputs.release != true
run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
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.
Happy to deplete our newline quota if you feel it's necessary 😄
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.
WTB this as a future required change for the next person to edit said lines.
softprops/action-gh-release
withgh