Skip to content

Commit 0de6895

Browse files
pRizzclaude
andcommitted
fix(ci): always verify CLI package against local core crate
cargo package --verify resolves opencode-cloud-core from crates.io, not the workspace. When core has new exports that aren't published yet (same version number, different content), the verify fails with unresolved imports. Replace the PR-vs-push branching logic with a single path that always uses [patch.crates-io] to verify against local core. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent dcfd313 commit 0de6895

1 file changed

Lines changed: 10 additions & 39 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -139,31 +139,18 @@ jobs:
139139
- name: Package opencode-cloud-core
140140
run: cargo package -p opencode-cloud-core --allow-dirty
141141

142-
- name: Determine core version and publication status
143-
id: core-publication
144-
run: |
145-
set -euo pipefail
146-
147-
core_version="$(python3 -c 'import pathlib, tomllib; print(tomllib.loads(pathlib.Path("packages/core/Cargo.toml").read_text())["package"]["version"])')"
148-
echo "core_version=${core_version}" >> "$GITHUB_OUTPUT"
149-
150-
if ./scripts/check-crate-version-published.sh opencode-cloud-core "${core_version}"; then
151-
echo "published=true" >> "$GITHUB_OUTPUT"
152-
else
153-
check_exit=$?
154-
if [ "${check_exit}" -eq 1 ]; then
155-
echo "published=false" >> "$GITHUB_OUTPUT"
156-
else
157-
exit "${check_exit}"
158-
fi
159-
fi
160-
161-
- name: Package opencode-cloud (PR no-verify archive)
162-
if: github.event_name == 'pull_request'
142+
# Package the CLI without running cargo's built-in verify, then verify
143+
# manually with [patch.crates-io] pointing at the local core crate.
144+
#
145+
# Why: cargo package --verify resolves opencode-cloud-core from crates.io,
146+
# not from the workspace. When core has new exports that aren't published
147+
# yet (same version, different content), the verify fails with unresolved
148+
# imports. By patching crates.io to use the local core, we verify the CLI
149+
# package against the actual workspace code — which is what matters.
150+
- name: Package opencode-cloud (no-verify archive)
163151
run: cargo package -p opencode-cloud --allow-dirty --no-verify
164152

165-
- name: Verify packaged opencode-cloud against local core (PR)
166-
if: github.event_name == 'pull_request'
153+
- name: Verify packaged opencode-cloud against local core
167154
run: |
168155
set -euo pipefail
169156
@@ -193,22 +180,6 @@ jobs:
193180
194181
cargo check --manifest-path "${manifest_path}" --config "${config_file}"
195182
196-
- name: Package opencode-cloud (main push, published core)
197-
if: github.event_name == 'push' && steps.core-publication.outputs.published == 'true'
198-
run: cargo package -p opencode-cloud --allow-dirty
199-
200-
- name: Skip opencode-cloud package verify (main push, core unpublished)
201-
if: github.event_name == 'push' && steps.core-publication.outputs.published != 'true'
202-
run: |
203-
echo "Skipping opencode-cloud packaging verify on main push."
204-
echo "Reason: opencode-cloud-core ${{ steps.core-publication.outputs.core_version }} is not yet published on crates.io."
205-
{
206-
echo "## Cargo Package Verify"
207-
echo ""
208-
echo "Skipped \`cargo package -p opencode-cloud\` on push to main."
209-
echo "Reason: dependency \`opencode-cloud-core ${{ steps.core-publication.outputs.core_version }}\` is not yet published on crates.io."
210-
} >> "$GITHUB_STEP_SUMMARY"
211-
212183
# Build, lint, and test on multiple platforms
213184
# Clippy/build/test must run on each platform because #[cfg(target_os)] causes
214185
# different code to compile (e.g., systemd.rs on Linux, launchd.rs on macOS)

0 commit comments

Comments
 (0)