Skip to content

Conversation

@grod220
Copy link
Member

@grod220 grod220 commented Jun 25, 2025

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.

@grod220 grod220 force-pushed the crate-publishing branch 5 times, most recently from 3cb2666 to fc9456e Compare June 26, 2025 08:07
@grod220 grod220 marked this pull request as ready for review June 26, 2025 08:08
push:
branches: [ main ]
pull_request:
branches: [ main ]
Copy link
Member Author

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

@grod220 grod220 force-pushed the crate-publishing branch from 55bbe99 to aed7391 Compare June 26, 2025 08:13
@grod220 grod220 requested review from buffalojoec and joncinque June 26, 2025 08:39
@grod220 grod220 force-pushed the update-deps-june branch from f4053d2 to f1aeba6 Compare June 26, 2025 12:46
@grod220 grod220 force-pushed the crate-publishing branch from aed7391 to 73e7a49 Compare June 26, 2025 13:00
Base automatically changed from update-deps-june to main June 27, 2025 08:31
@grod220 grod220 force-pushed the crate-publishing branch from 73e7a49 to 5b05c1e Compare June 27, 2025 08:32
Copy link
Contributor

@joncinque joncinque left a 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

@grod220 grod220 force-pushed the crate-publishing branch from 5b05c1e to 615369e Compare July 7, 2025 15:05
@@ -0,0 +1,58 @@
# git-cliff configuration file
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@grod220
Copy link
Member Author

grod220 commented Jul 7, 2025

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.

@grod220 grod220 force-pushed the crate-publishing branch from d5aab6f to 7729463 Compare July 7, 2025 17:22
@grod220 grod220 requested a review from joncinque July 7, 2025 17:42
@grod220 grod220 force-pushed the crate-publishing branch from 7729463 to 77abf67 Compare July 8, 2025 06:48
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

uses: taiki-e/install-action@v2
with:
tool: cargo-semver-checks
cargo-semver-checks: true
Copy link
Contributor

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

Comment on lines +76 to +78
# only successfully runs if crate is library & is not first publish
- name: Check semver
if: ${{ inputs.package_path != 'clients/cli' && inputs.level != 'release' }}
Copy link
Contributor

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 😅

default: true

jobs:
main_check:
Copy link
Contributor

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

Suggested change
main_check:
main-check:

@grod220 grod220 force-pushed the crate-publishing branch from 77abf67 to 8f0f48f Compare July 10, 2025 06:27
@grod220 grod220 force-pushed the crate-publishing branch from 8f0f48f to 773859c Compare July 10, 2025 06:31
@grod220
Copy link
Member Author

grod220 commented Jul 10, 2025

@joncinque do you have force-merge permissions? I think github is confused now that Check semver Rust has been removed from the Main check.

@joncinque
Copy link
Contributor

I removed the check from the required list for merging, so this should be good to go now!

@grod220 grod220 merged commit 2a5a736 into main Jul 10, 2025
10 checks passed
@grod220 grod220 deleted the crate-publishing branch July 10, 2025 08:50
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