Skip to content

feat: github release bot#100

Open
lirenjie95 wants to merge 4 commits into
masterfrom
feat/releaseBot
Open

feat: github release bot#100
lirenjie95 wants to merge 4 commits into
masterfrom
feat/releaseBot

Conversation

@lirenjie95
Copy link
Copy Markdown
Collaborator

@lirenjie95 lirenjie95 commented Jul 27, 2025

Fixes #98

Automated Release Workflow:

  • .github/workflows/release.yml: Added a GitHub Actions workflow to handle automated releases triggered by version tags or manual dispatch. The workflow includes steps for building multi-platform artifacts, generating changelogs, publishing to crates.io, and uploading release assets.

Documentation Updates:

  • RELEASE.md: Added a comprehensive guide detailing the release process, including setup instructions, versioning conventions, and step-by-step workflows for automated and manual releases.

Version Management:

  • scripts/update-version.sh: Added a script to update version numbers in Cargo.toml files and synchronize dependencies across the workspace. The script supports both Go-style (v1.2.3) and Rust-style (1.2.3) version formats.

@lirenjie95 lirenjie95 marked this pull request as draft July 27, 2025 02:13
@lirenjie95 lirenjie95 requested a review from Copilot July 27, 2025 02:14

This comment was marked as outdated.

@lirenjie95 lirenjie95 requested a review from Copilot July 27, 2025 02:25

This comment was marked as outdated.

lirenjie95 added a commit that referenced this pull request Jul 27, 2025
- Improve cargo publish error handling with proper logging
- Fix sed path separator consistency in update-version.sh
- Add reusable check_and_copy function for file operations
- Keep sccache-action@v0.0.9 (verified as latest version)
@lirenjie95 lirenjie95 requested a review from Copilot July 27, 2025 02:30

This comment was marked as outdated.

@lirenjie95 lirenjie95 requested a review from Copilot July 27, 2025 02:38

This comment was marked as outdated.

@lirenjie95 lirenjie95 marked this pull request as ready for review July 27, 2025 03:42
@lirenjie95 lirenjie95 added the github_actions Pull requests that update GitHub Actions code label Jul 27, 2025
Copy link
Copy Markdown

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 introduces an automated release system for the Rust2Go project, supporting both Go and Rust ecosystems with unified version management using Go-style versioning (v1.2.3) as the primary format.

  • Adds GitHub Actions workflow for automated releases triggered by version tags or manual dispatch
  • Provides comprehensive documentation for the release process including setup and workflow instructions
  • Implements a shell script for updating version numbers across the workspace with support for both Go and Rust version formats

Reviewed Changes

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

File Description
.github/workflows/release.yml GitHub Actions workflow for automated releases with multi-platform builds, changelog generation, and publishing to crates.io
RELEASE.md Comprehensive documentation covering release processes, version management, and troubleshooting
scripts/update-version.sh Shell script for updating version numbers in Cargo.toml files and synchronizing workspace dependencies
Comments suppressed due to low confidence (1)

Comment thread scripts/update-version.sh
Comment thread scripts/update-version.sh
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread .github/workflows/release.yml
Comment thread scripts/update-version.sh
lirenjie95 added 2 commits May 9, 2026 20:44
…ggestion

- Use Go-style versioning (v1.2.3) as primary format for Git tags
- Automatically convert between Go format (v1.2.3) and Rust format (1.2.3)
- Update release workflow to handle both version formats correctly
- Enhanced release notes with installation instructions for both ecosystems
- Update version script to accept both formats with automatic detection
- Improve documentation with unified version management strategy

This enables:
- Go users: go get github.com/ihciah/rust2go@v1.2.3
- Rust users: cargo add rust2go@1.2.3
- Consistent versioning across both ecosystems
- Add explicit workflow permissions (contents: write)
- Fix Windows target from gnu to msvc (matches GitHub runner toolchain)
- Upgrade sccache-action v0.0.9 -> v0.0.10 (consistent with CI)
- Dedupe cargo build steps in artifact job
- Fix crate publish order (mem-ring before rust2go-mem-ffi)
- Complete DEPENDENCIES mapping in update-version.sh
- Use cargo update --workspace to avoid unintended dep bumps
@lirenjie95
Copy link
Copy Markdown
Collaborator Author

Hi @ihciah @suikammd,

I've rebased onto latest master, resolved the CI failures, and fixed several issues found during review. Here's a summary:


🔧 Fixes Applied

1. .github/workflows/release.yml

Issue Fix
Missing workflow permissions Added permissions: contents: write at workflow level. Without this, if the repo's default Actions permission is "Read-only", `actio
n-gh-release` will fail to create releases.
Windows target unreliable Changed x86_64-pc-windows-gnux86_64-pc-windows-msvc. GitHub windows-latest runners have MSVC toolchain by default; GNU requires
manual MinGW installation which is fragile.
sccache version inconsistent Upgraded v0.0.9v0.0.10 to match the repo's CI workflow.
Duplicate build steps Removed redundant cargo build --release --target (whole workspace) before cargo build -p rust2go-cli. The CLI binary is what we actually
ship.
Wrong crate publish order Moved mem-ring before rust2go-mem-ffi in publish sequence, since rust2go-mem-ffi depends on mem-ring.

2. scripts/update-version.sh

Issue Fix
Incomplete dependency mapping Added missing internal deps: rust2go-macrorust2go-common, rust2go-clirust2go-common, rust2go-mem-ffimem-ring + `rust2
go-convert`. Without these, running the script would leave some path dependency versions stale.
Overly aggressive cargo update Changed to cargo update --workspace to avoid bumping external crates.io dependencies unexpectedly.

🔑 About Secrets Configuration

There's a common misconception here — let me clarify what actually needs to be done:

GITHUB_TOKEN — No manual secret needed ✅

secrets.GITHUB_TOKEN is automatically injected by GitHub Actions on every run. You do not need to create it in Settings > Secrets.

What you DO need to check:

  • Go to Settings > Actions > General > Workflow permissions
  • Ensure it's set to "Read and write permissions" (not "Read repository contents and packages permissions only")
  • If restricted, the release job will fail with a permission denied error when trying to create the GitHub Release

CARGO_REGISTRY_TOKEN — Must be configured once ⚠️

This is the only secret that requires manual setup:

  1. Visit https://crates.io/me → generate an API token
  2. Go to Settings > Secrets and variables > Actions > New repository secret
  3. Name: CARGO_REGISTRY_TOKEN, Value: your crates.io token

Why this matters: Without this token, the release workflow will:

  • ✅ Successfully create GitHub Release with binaries
  • Fail to publish to crates.io, leaving Rust users unable to cargo add rust2go@0.4.2

This is a one-time setup for permanent automated releases. After configuring, every future release is just:

git tag v0.5.0 && git push origin master --tags
──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
✅ Current Status
• cargo build — passing
• cargo clippy --all-features --all-targets -- --deny warnings — passing
• PR mergeable state: clean
Ready for final review!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tag releases

2 participants