Skip to content

ci: create release workflow that uses cargo release #110

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

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

galargh
Copy link
Contributor

@galargh galargh commented Jul 23, 2025

This adds release workflow that can be triggered manually which performs the release using cargo release. It requires CARGO_REGISTRY_TOKEN to be set in the repository secrets. The token has to be for one of the users that belong to the proofs-crate-owners team or filecoin-crate-owner.

@Copilot Copilot AI review requested due to automatic review settings July 23, 2025 13:52
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds automated release functionality to the repository by introducing a GitHub Actions workflow that uses cargo release for publishing releases. The changes also update several dependency versions in the Cargo.toml file.

  • Creates a manual GitHub Actions workflow for automated releases with configurable release levels (patch, minor, major)
  • Updates dependency versions for filecoin-proofs-v1, fr32, and storage-proofs-core packages

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
.github/workflows/release.yml Adds new release workflow with manual trigger and cargo release automation
Cargo.toml Updates dependency versions to newer major/minor releases

run: cargo install --version 0.25.17 cargo-release
- name: Set git user
run: |
git config --global user.email "${GITHUB_TRIGGERING_ACTOR}@users.noreply.github.com>"
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

There is an extra closing angle bracket '>' at the end of the email address. It should be '${GITHUB_TRIGGERING_ACTOR}@users.noreply.github.com' without the trailing '>'.

Suggested change
git config --global user.email "${GITHUB_TRIGGERING_ACTOR}@users.noreply.github.com>"
git config --global user.email "${GITHUB_TRIGGERING_ACTOR}@users.noreply.github.com"

Copilot uses AI. Check for mistakes.

- name: Install required packages
run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
- name: Install cargo release
run: cargo install --version 0.25.17 cargo-release
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

[nitpick] The cargo-release version is pinned to a specific version (0.25.17). Consider using a more recent version or document why this specific version is required, as newer versions may contain bug fixes and improvements.

Suggested change
run: cargo install --version 0.25.17 cargo-release
run: cargo install cargo-release

Copilot uses AI. Check for mistakes.

steps:
- uses: actions/checkout@v4
- name: Install required packages
run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
Copy link
Preview

Copilot AI Jul 23, 2025

Choose a reason for hiding this comment

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

Installing packages with sudo without specifying versions could introduce security risks. Consider pinning package versions or using a container image with pre-installed dependencies for more reproducible and secure builds.

Suggested change
run: sudo apt install --no-install-recommends --yes libhwloc-dev nvidia-cuda-toolkit ocl-icd-opencl-dev
run: sudo apt install --no-install-recommends --yes libhwloc-dev=2.4.1-1 nvidia-cuda-toolkit=11.5.2-1 ocl-icd-opencl-dev=2.2.12-2

Copilot uses AI. Check for mistakes.

BigLep added a commit to filecoin-project/github-mgmt that referenced this pull request Jul 23, 2025
Copy link
Member

@BigLep BigLep left a comment

Choose a reason for hiding this comment

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

I added @FilOzzy to proofs-crate-owners.
I created a scoped token:

Image

I added an organizational secret: https://github.com/organizations/filecoin-project/settings/secrets/actions/FILOZZY_CI_CARGO_PUBLISH_UPDATE_TOKEN

(It looks like there are some potential Copilot comments to look at too.)

git config --global user.name "${GITHUB_TRIGGERING_ACTOR}"
- name: Run cargo release
env:
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
CARGO_REGISTRY_TOKEN: ${{ secrets.FILOZZY_CI_CARGO_PUBLISH_UPDATE_TOKEN }}

I debated about the name here, but I thought best to make this an organizational token at which point CARGO_REGISTRY_TOKEN would be too broad for the organization.

@rvagg
Copy link
Member

rvagg commented Jul 24, 2025

@galargh did you see this recently from crates.io? https://crates.io/docs/trusted-publishing (mentioned here filecoin-project/ref-fvm#2185)

@galargh
Copy link
Contributor Author

galargh commented Jul 25, 2025

@galargh did you see this recently from crates.io? https://crates.io/docs/trusted-publishing (mentioned here filecoin-project/ref-fvm#2185)

Oh yeah! That's really cool :) Thank you for bringing this up! @rvagg would you be able to enable trusted publishing for https://crates.io/crates/filecoin-proofs-api ? It seems like it would be a good testing ground. The name of the workflow is release.yml.

@rvagg
Copy link
Member

rvagg commented Jul 26, 2025

OK, done, but it was a bit tricky so I'll document here:

  • Can't modify a crate's settings as team member, even if that team is supposed to be "owners" - the "Settings" doesn't show up for a crate and none of them show up in my dashboard even though I'm in that owners team. I think that team might just have publish permissions and that's it, can't do cargo owners .. stuff on the CLI either.
  • Logged in as filecoin-crate-owner and did the following:
Screenshot 2025-07-26 at 11 46 15 am

But it resulted in:

Screenshot 2025-07-26 at 11 48 02 am

Which is a bit odd, I wonder if there's some auth thing that it's not getting right. But I decided not to tinker too much with that account since it's the only one supposedly with owner permission.

  • Using that account, I added rvagg as an owner of the crate
  • As rvagg I went through the above process and successfully got it added (i.e. it's good to go now)
  • Removed rvagg as a crate owner so we're back to where we started wrt permissions.

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