Conversation
There was a problem hiding this comment.
Pull Request Overview
Adds a GitHub Actions workflow to build, test, and publish the Rust crates when manually triggered.
- Introduces
crate-publish.ymlunder.github/workflowswith build, test, and publish steps - Publishes
onig_sysfollowed byonigcrates - Sets
CARGO_TERM_COLORto always for colored output
Comments suppressed due to low confidence (1)
.github/workflows/crate-publish.yml:20
- There's a typo in the cargo command (
pubish); it should becargo publish.
run: (cd onig_sys/ && cargo pubish)
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull Request Overview
Automates packaging and publishing of Rust crates for pre-release and official releases.
- Introduces
pre-release-packages.ymlto build, test, version-suffix, and either upload artifacts or push to GitHub Packages. - Introduces
crate-publish.ymlto publish crates to crates.io on tagged releases.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| .github/workflows/pre-release-packages.yml | Adds a workflow to build, test, suffix versions, and package crates for pre-release distribution. |
| .github/workflows/crate-publish.yml | Adds a workflow to checkout a release tag, build, test, and publish crates to crates.io. |
| ONIG_VERSION=$(grep -m 1 '^version =' onig/Cargo.toml | sed -E 's/version = "([^"]+)"/\1/') | ||
|
|
||
| # Create temporary version files with pre-release suffix | ||
| echo "$ONIG_SYS_VERSION-${{ github.inputs.version_suffix }}" > onig_sys/VERSION |
There was a problem hiding this comment.
Inputs from a workflow_dispatch must use github.event.inputs. Change ${{ github.inputs.version_suffix }} to ${{ github.event.inputs.version_suffix }} (and similarly for the onig version).
| - name: Publish `onig` crate | ||
| run: (cd onig/ && cargo publish --allow-dirty) | ||
| env: | ||
| # Add a short delay to ensure the onig_sys crate is available on crates.io | ||
| CARGO_PUBLISH_DELAY: "30" |
There was a problem hiding this comment.
The CARGO_PUBLISH_DELAY environment variable is declared but not used. Consider adding a sleep $CARGO_PUBLISH_DELAY before the second publish step to ensure the first crate is propagated.
| - name: Publish `onig` crate | |
| run: (cd onig/ && cargo publish --allow-dirty) | |
| env: | |
| # Add a short delay to ensure the onig_sys crate is available on crates.io | |
| CARGO_PUBLISH_DELAY: "30" | |
| - name: Wait for crate propagation | |
| run: sleep $CARGO_PUBLISH_DELAY | |
| env: | |
| CARGO_PUBLISH_DELAY: "30" | |
| - name: Publish `onig` crate | |
| run: (cd onig/ && cargo publish --allow-dirty) |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Addresses #195