-
Notifications
You must be signed in to change notification settings - Fork 1
Add release workflow #19
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
Add release workflow #19
Conversation
Co-authored-by: Andrew Fleming <[email protected]> Signed-off-by: 0xisk <[email protected]>
.github/workflows/release.yml
Outdated
| - major | ||
|
|
||
| permissions: | ||
| contents: write # Required to push commits and 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.
would be better to move this to the jobs that need the permissions, perhaps not a high priority right now but it will bubble up again later as I will be trying to fix this across all of our repos.
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.
Good call. We're tracking this here #31
| cd packages/${{ steps.pkg.outputs.dir }} | ||
| yarn npm publish --access public | ||
| env: | ||
| NPM_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.
I hope we can switch this off and use Trusted Publishing with OIDC auth later. Yarn should support it (yarnpkg/berry#6898, yarnpkg/berry#6911)
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.
Just to be clear, You need to first publish the package and then enable OIDC for the subsequent versions.
|
|
||
| 1. Go to "Release Package" in Actions. | ||
| 2. Click on the "Run workflow" dropdown menu. | ||
| 3. Choose the package to release and the version bump type. |
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.
it looks like this will run on main?
| - Create a git tag. | ||
| - Publish the package to npm. | ||
|
|
||
| 6. Once published, go to "Releases" and create a GitHub release using the generated tag. No newline at end of file |
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.
we could automate this too, perhaps a future improvement?
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.
Tracking here #30
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.
Just FYI, If you guys haven't seen it, you can check how we are managing this using changesets here https://github.com/OpenZeppelin/relayer-plugin-channels/tree/main/.github/workflows. We pretty much standardized using changesets across all ts/js repos publishing to npm. Something to improve.
|
@andrew-fleming don't we need to change |
.github/workflows/release.yml
Outdated
| run: | | ||
| yarn config set npmAuthToken "$NPM_TOKEN" | ||
| cd packages/${{ steps.pkg.outputs.dir }} | ||
| yarn npm publish --access public |
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.
Is it possible to use the --provenance flag here?
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.
Done!
tirumerla
left a comment
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.
Added few comments
| - Create a git tag. | ||
| - Publish the package to npm. | ||
|
|
||
| 6. Once published, go to "Releases" and create a GitHub release using the generated tag. No newline at end of file |
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.
Just FYI, If you guys haven't seen it, you can check how we are managing this using changesets here https://github.com/OpenZeppelin/relayer-plugin-channels/tree/main/.github/workflows. We pretty much standardized using changesets across all ts/js repos publishing to npm. Something to improve.
| cd packages/${{ steps.pkg.outputs.dir }} | ||
| yarn npm publish --access public | ||
| env: | ||
| NPM_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.
Just to be clear, You need to first publish the package and then enable OIDC for the subsequent versions.
|
Closing since the changes here were merged with #43 |
Fixes #6
*Waiting on repo being OS to configure environment