Skip to content

Create crate-publish.yml#199

Merged
iwillspeak merged 7 commits intomainfrom
feature/crate-deploy
May 23, 2025
Merged

Create crate-publish.yml#199
iwillspeak merged 7 commits intomainfrom
feature/crate-deploy

Conversation

@iwillspeak
Copy link
Copy Markdown
Collaborator

@iwillspeak iwillspeak commented May 21, 2025

Addresses #195

@iwillspeak iwillspeak requested a review from Copilot May 21, 2025 14:44
Copy link
Copy Markdown
Contributor

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

Adds a GitHub Actions workflow to build, test, and publish the Rust crates when manually triggered.

  • Introduces crate-publish.yml under .github/workflows with build, test, and publish steps
  • Publishes onig_sys followed by onig crates
  • Sets CARGO_TERM_COLOR to 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 be cargo publish.
run: (cd onig_sys/ && cargo pubish)

iwillspeak and others added 4 commits May 21, 2025 07:45
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iwillspeak iwillspeak requested a review from Copilot May 21, 2025 15:08
Copy link
Copy Markdown
Contributor

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

Automates packaging and publishing of Rust crates for pre-release and official releases.

  • Introduces pre-release-packages.yml to build, test, version-suffix, and either upload artifacts or push to GitHub Packages.
  • Introduces crate-publish.yml to 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
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +42
- 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"
Copy link

Copilot AI May 21, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
- 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)

Copilot uses AI. Check for mistakes.
iwillspeak and others added 2 commits May 23, 2025 18:14
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@iwillspeak iwillspeak merged commit c5e599b into main May 23, 2025
16 of 18 checks passed
@iwillspeak iwillspeak deleted the feature/crate-deploy branch May 23, 2025 17:19
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