-
Notifications
You must be signed in to change notification settings - Fork 8
Add github workflow for publishing crates #152
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
Conversation
3cb2666 to
fc9456e
Compare
| push: | ||
| branches: [ main ] | ||
| pull_request: | ||
| branches: [ main ] |
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's helpful if these checks can run for PRs against any branches
55bbe99 to
aed7391
Compare
f4053d2 to
f1aeba6
Compare
aed7391 to
73e7a49
Compare
73e7a49 to
5b05c1e
Compare
joncinque
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.
In every other repo, the publish is run through a manual GitHub Action, rather than an automation based on code changes.
We also do work to make sure that semver is preserved, create a changelog based on commits, create a separate commit with the version bump, tag the release, and create a GitHub release.
We can keep things simple for now if you need to get a release out, but I'd prefer to keep things a bit more buttoned up around new crate releases.
See https://github.com/solana-program/token-2022/blob/main/.github/workflows/publish-rust.yml for an example workflow and an example release https://github.com/solana-program/token-2022/releases/tag/rust-legacy%40v0.16.1
| @@ -0,0 +1,58 @@ | |||
| # git-cliff configuration 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.
|
Helpful example, thanks! It's quite difficult to test if this actually works. Going to fork, try different credentials, and see if things are all set. |
joncinque
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.
Looks great!
.github/workflows/main.yml
Outdated
| uses: taiki-e/install-action@v2 | ||
| with: | ||
| tool: cargo-semver-checks | ||
| cargo-semver-checks: true |
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.
Doesn't need to be done in this PR, but since the semver job is run on publish, we can probably remove the job here. It tends to create a lot of false negatives
| # only successfully runs if crate is library & is not first publish | ||
| - name: Check semver | ||
| if: ${{ inputs.package_path != 'clients/cli' && inputs.level != 'release' }} |
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.
Oh that's clever! I never realized what "release" was for 😅
.github/workflows/rust-publish.yml
Outdated
| default: true | ||
|
|
||
| jobs: | ||
| main_check: |
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.
nit: up to you but there's more kebab-case here than snake-case
| main_check: | |
| main-check: |
77abf67 to
8f0f48f
Compare
8f0f48f to
773859c
Compare
|
@joncinque do you have force-merge permissions? I think github is confused now that |
|
I removed the check from the required list for merging, so this should be good to go now! |
Sets up a new workflow for publishing two rust crates:
spl-token-wrap-cli&spl-token-wrap. Copies the precedent set in token-2022 repo.