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

ci: add workflow for crate publishing #5005

Open
2 of 3 tasks
conorsch opened this issue Jan 24, 2025 · 4 comments · Fixed by #5105
Open
2 of 3 tasks

ci: add workflow for crate publishing #5005

conorsch opened this issue Jan 24, 2025 · 4 comments · Fixed by #5105
Labels
A-CI/CD Relates to continuous integration & deployment of Penumbra

Comments

@conorsch
Copy link
Contributor

conorsch commented Jan 24, 2025

Following up on the work to publish the workspace code to crates.io (#4978), we should add a CI workflow to automate that process. That work entails:

  • updating the crates auth to gh groups
  • generating a new CI token for use in CI
  • writing a workflow that runs on tags, and executes ./deployments/scripts/publish-crates

Once that's handled, the crate publishing will happen automatically as part of our existing release process.

@conorsch conorsch added the A-CI/CD Relates to continuous integration & deployment of Penumbra label Jan 24, 2025
@conorsch
Copy link
Contributor Author

Still not done; for v1.0.1 (#5021) I just published the crates manually using the script. They're live now: https://docs.rs/penumbra-sdk-app/1.0.1/penumbra_sdk_app/

@conorsch
Copy link
Contributor Author

As part of the v1.0.2 release (which should have been 1.1.0), I ran the publishing script manually, and it worked great, no problems. Fine to include in CI for next release, IMO.

For the crate ownership, I've started sending invites via API to adjust the setup, will comment when that's complete.

conorsch added a commit that referenced this issue Feb 25, 2025
Adds a simple workflow to handle publishing the workspace's crates to
crates.io. Will run whenever a new tag is pushed to the repo, and
publish the crates under that tag.

Closes #5005. Refs #5104, #4978.
@conorsch
Copy link
Contributor Author

Not quite: the job failed with error:

Run nix develop --command ./deployments/scripts/publish-crates
  nix develop --command ./deployments/scripts/publish-crates
  shell: /usr/bin/bash -e {0}
  env:
    CARGO_REGISTRY_TOKEN: ***
    NIX_PROFILES: /nix/var/nix/profiles/default /home/runner/.nix-profile
    NIX_USER_PROFILE_DIR: /nix/var/nix/profiles/per-user/runner
    NIX_SSL_CERT_FILE: /etc/ssl/certs/ca-certificates.crt
    NIX_USER_CONF_FILES: /tmp/tmp.dVshnKGBfb/flake-nixConfig.conf:/home/runner/.config/nix/nix.conf:
    CACHE_ON_FAILURE: false
    CARGO_INCREMENTAL: 0
Publishing crate versions '1.1.0' to crates.io...
error: cannot release from branch "HEAD", instead switch to "*, !HEAD"

which is due to the way github checks out gitrefs in CI contexts: we're not simply using the "main" branch in that context, even though that's where the tag was made.

@conorsch conorsch reopened this Feb 26, 2025
conorsch added a commit that referenced this issue Mar 5, 2025
Modifies the `cargo-release` config to permit releasing from the
`HEAD` checkout created by GHA in CI. By default, cargo-release
disallows `HEAD` via the `!HEAD` match, see docs at [0].

Refs #5005.

[0] https://github.com/crate-ci/cargo-release/blob/f7c2975325afc6d6fc1793544802a5578d9ef256/docs/reference.md
conorsch added a commit that referenced this issue Mar 5, 2025
## Describe your changes
Modifies the `cargo-release` config to permit releasing from the `HEAD`
checkout created by GHA in CI. By default, cargo-release disallows
`HEAD` via the `!HEAD` match, see docs at [0].

[0]
https://github.com/crate-ci/cargo-release/blob/f7c2975325afc6d6fc1793544802a5578d9ef256/docs/reference.md

## Issue ticket number and link

Refs #5005.

## Testing and review

I need this change to land on main in order for it to be active in the
release workflow. Shortly I'll publish 1.2.0 and observe behavior then.
As long as CI is green on this PR, we're good to merge, then I'll follow
up on next steps.

## Checklist before requesting a review

- [x] I have added guiding text to explain how a reviewer should test
these changes.

- [x] If this code contains consensus-breaking changes, I have added the
"consensus-breaking" label. Otherwise, I declare my belief that there
are not consensus-breaking changes, for the following reason:

  > CI/release logic only, no changes to app code
@conorsch
Copy link
Contributor Author

conorsch commented Mar 5, 2025

Sick, looks like the latest version completed successfully in CI: https://github.com/penumbra-zone/penumbra/actions/runs/13687172377

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CI/CD Relates to continuous integration & deployment of Penumbra
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant