Skip to content
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

Merged
merged 1 commit into from
Oct 8, 2022
Merged

Fix release workflows, again #1214

merged 1 commit into from
Oct 8, 2022

Conversation

0x2b3bfa0
Copy link
Member

  • Use fallback false value on test-deploy workflow
  • Replace softprops/action-gh-release with gh

* Use fallback false value on test-deploy workflow
* Replace `softprops/action-gh-release` with `gh`
@0x2b3bfa0 0x2b3bfa0 temporarily deployed to internal October 8, 2022 04:28 Inactive
@0x2b3bfa0 0x2b3bfa0 merged commit b1707f3 into master Oct 8, 2022
@0x2b3bfa0 0x2b3bfa0 deleted the fix-release branch October 8, 2022 04:28
Copy link
Contributor

@tasdomas tasdomas left a 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' }} || ${{
Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor

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 😄

Copy link
Member Author

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.

Copy link
Member Author

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 }}

Copy link
Member Author

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 😄

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants