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

chore(CI): allow push to crates.io for version tag #53

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

fMeow
Copy link
Collaborator

@fMeow fMeow commented Sep 3, 2022

Current workflow require manual action by @moriturus when publishing new version to crates.io.

This PR enable github action to push new version to crates.io for version tag (e.x. v0.6.0, v0.1.2). With Actions secrets, we can publish to crates.io with token configured before hand without leaking.

Now the only missing piece is a valid cargo token. This require repo owner @moriturus to setup secret in repo settings actions secret page(only repo owner can open this link).
I named the cargo token CARGO_TOKEN and here is a snapshot of another repo that has correctly setup cargo token in action secrests.
image

Here I call for @moriturus to manually add CARGO_TOKEN to repo setting.

Thanks a lot.

@fMeow fMeow requested a review from moriturus September 3, 2022 01:31
@fMeow fMeow mentioned this pull request Sep 3, 2022
3 tasks
@gagbo gagbo self-assigned this Sep 7, 2022
publish:
name: Publish Package
needs: [check, lints, test]
if: startsWith(github.ref, 'refs/tags/v')
Copy link
Collaborator

Choose a reason for hiding this comment

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

The tags we use for now don't start with v, so either

  • we start using v{MAJOR}.{MINOR}.{PATCH} now, or
  • we match against refs/tags/ instead

I don't have any strong opinion on the matter.

@gagbo
Copy link
Collaborator

gagbo commented Sep 13, 2022

You might as well create a new workflow file called publish.yml that would deal exclusively with cargo publishing step.

That would allow (you, me, or someone else) later to add a "check" step that ensures the tag on github matches the version in the Cargo.toml before publishing (it's something that is easy to check and easy to forget, so it's a nice addition to the workflow imo)

@fMeow
Copy link
Collaborator Author

fMeow commented Sep 14, 2022

Sounds good.

I suggest match against refs/tags/ and create a new publish workflow which requires manual trigger.

@fMeow
Copy link
Collaborator Author

fMeow commented Sep 21, 2022

I personllay think to safer to run through all test before publish. But might clean the publish workflow to publish related pipeline only.

Copy link
Collaborator

@gagbo gagbo left a comment

Choose a reason for hiding this comment

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

No worries there, only blocked by access to repo settings

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.

None yet

2 participants