Skip to content

add publish job and dry-run to CI - #4

Merged
LastExceed merged 2 commits into
LastExceed:masterfrom
HEnquist:publish-dry-run
Aug 20, 2026
Merged

add publish job and dry-run to CI#4
LastExceed merged 2 commits into
LastExceed:masterfrom
HEnquist:publish-dry-run

Conversation

@HEnquist

Copy link
Copy Markdown
Contributor

Adds a cargo publish --dry-run --workspace job. Should have put this in the first CI PR,
I've found it very helpful.

  • --workspace verifies azo against the locally packaged azo-sys instead of the version
    on crates.io, so the two crates are checked as the coordinated release they actually are
  • catches packaging problems that clippy can't see, like a tarball that doesn't build standalone

I can also add a real publish job triggered when cutting a release, if you want that. I prefer
running publish from the repo, that way I know everything I publish is committed and pushed.

@LastExceed

LastExceed commented Aug 20, 2026

Copy link
Copy Markdown
Owner

I can also add a real publish job triggered when cutting a release

This sounds good, but what exactly do you mean by "cutting a release" ?

@HEnquist

Copy link
Copy Markdown
Contributor Author

Haha fair question!
My process is to get all the changes I want to include merged to main, including bumping the version numbers. The CI runs the publish dry-run, so I know cargo publish is likely to work. Then I create a release on github ("draft new release" button, should be here: https://github.com/LastExceed/azo/releases), and let GitHub autogenerate release notes. And then the new release triggers a publish job that runs cargo publish. That uses a crates.io key that I store in the repo secrets.

Example workflow:
https://github.com/HEnquist/audioadapter-rs/blob/master/.github/workflows/publish.yml

@LastExceed

Copy link
Copy Markdown
Owner

Oh this is a great idea, yes please do add that!

@HEnquist
HEnquist force-pushed the publish-dry-run branch 2 times, most recently from d12d981 to 6e04efa Compare August 20, 2026 17:29
@HEnquist

Copy link
Copy Markdown
Contributor Author

Added the publish workflow as a separate file, .github/workflows/publish.yml. It triggers
on tag pushes, which is what creating a GitHub release does.

Two things to set up before the first release:

  1. A token on crates.io, under Account Settings > API Tokens > New Token. The publish-new and
    publish-update scopes are enough, and you can restrict it to azo and azo-sys.
  2. That token in the repo, under Settings > Secrets and variables > Actions > New repository
    secret, named exactly CARGO_REGISTRY_TOKEN.

The trigger is tags: ['*'], so any tag publishes. If you'd rather only publish on version
tags, change it to 'v*', or 'v[0-9]+.[0-9]+.[0-9]+' to be strict about vX.Y.Z.

It runs cargo publish --workspace, which publishes azo-sys first and waits for it to land on
the index before azo. The job goes red if anything fails.

@HEnquist HEnquist changed the title add publish dry-run to CI add publish job and dry-run to CI Aug 20, 2026
@LastExceed

Copy link
Copy Markdown
Owner

...and just as I wanted to merge this, I encountered the very reason I need this: I have released v0.0.9 yesterday without pushing the commit from which I released, and have since merged your other PRs, which means master has diverged +.+

In order to preserve the release commit I had to rebase origin/master onto my local master and force-push it, can you rebase your PR onto that please?

Thanks for proactively making sure this won't happen again lol

@LastExceed

Copy link
Copy Markdown
Owner

Oh and please do limit the trigger to version tags as you described while you're at it

@HEnquist

Copy link
Copy Markdown
Contributor Author

Done and done :)

@LastExceed
LastExceed merged commit 27741fb into LastExceed:master Aug 20, 2026
2 checks passed
@LastExceed

Copy link
Copy Markdown
Owner

tyvm!

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.

2 participants