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

Feat/rust cicd #131

Merged
merged 5 commits into from
Jun 7, 2024
Merged

Feat/rust cicd #131

merged 5 commits into from
Jun 7, 2024

Conversation

Alessandro100
Copy link
Contributor

Add the ability to publish Rust crate for gbfs_types as well as PR checks. Modified the readme.
Will fail the publish build if the version in Cargo.toml is not changed

@Alessandro100 Alessandro100 self-assigned this Jun 5, 2024
Copy link

github-actions bot commented Jun 5, 2024

Thank you for opening/editing this pull request. Please update the models/java/gbfs-java-model/pom.xml version so that your changes will be published.

Copy link

github-actions bot commented Jun 5, 2024

Thank you for opening/editing this pull request. Please update the models/rust/Cargo.toml version so that your changes will be published.

Comment on lines 25 to 26
env:
CARGO_REGISTRY_TOKEN: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/ms6rxv2lhpok44mg32wuihbv7q/credential"
Copy link
Member

Choose a reason for hiding this comment

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

We need to add the 1password token to be able to connect with the proper vault:

Suggested change
env:
CARGO_REGISTRY_TOKEN: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/ms6rxv2lhpok44mg32wuihbv7q/credential"
env:
OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }}
CARGO_REGISTRY_TOKEN: "op://rbiv7rvkkrsdlpcrz3bmv7nmcu/ms6rxv2lhpok44mg32wuihbv7q/credential"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good catch! OP_SERVICE_ACCOUNT_TOKEN should already be a secret in this repo

- name: Publish to crates.io
env:
CARGO_REGISTRY_TOKEN: ${{ env.CARGO_REGISTRY_TOKEN }}
run: cargo publish --token $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.

Sorry for my lack of knowledge of Rust. Does cargo publish test and build also? If not, I suggest building and testing before publishing.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The tests and build are run in the PR check .github/workflows/rust_pr_check.yml, and yes cargo publish builds and publishes

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just looked up cargo publish also runs tests

Copy link
Member

@davidgamez davidgamez left a comment

Choose a reason for hiding this comment

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

LGTM

@Alessandro100 Alessandro100 merged commit 766d6e6 into master Jun 7, 2024
4 checks passed
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