Skip to content

Commit ff770ac

Browse files
committed
fix: strip oxc deps from analyzer for crates.io publishing
The oxc_linter and related crates are not published to crates.io, only available via git. This causes cargo publish to fail validation even with --no-default-features since it validates all deps in Cargo.toml. Solution: Use sed to remove the oxc dependencies from analyzer's Cargo.toml before publishing, allowing all 8 RMA crates to be published successfully.
1 parent 59dbe39 commit ff770ac

File tree

1 file changed

+22
-2
lines changed

1 file changed

+22
-2
lines changed

.github/workflows/release.yml

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,26 @@ jobs:
147147
~/.cargo/git/db/
148148
key: cargo-registry-${{ runner.os }}-${{ hashFiles('**/Cargo.lock') }}
149149

150+
- name: Strip oxc deps from analyzer (not on crates.io)
151+
run: |
152+
# oxc_linter and related crates are NOT published to crates.io
153+
# We need to remove them from Cargo.toml for publishing
154+
cd crates/analyzer
155+
# Remove the oxc feature definition and dependencies
156+
sed -i '/^oxc = \[/,/^\]/d' Cargo.toml
157+
sed -i '/^default = \["oxc"\]/d' Cargo.toml
158+
sed -i '/oxc_linter/d' Cargo.toml
159+
sed -i '/oxc_diagnostics/d' Cargo.toml
160+
sed -i '/oxc_span/d' Cargo.toml
161+
sed -i '/oxc_allocator/d' Cargo.toml
162+
sed -i '/oxc_parser/d' Cargo.toml
163+
sed -i '/oxc_semantic/d' Cargo.toml
164+
sed -i '/oxc_ast/d' Cargo.toml
165+
# Remove empty [features] section if it exists
166+
sed -i '/^\[features\]$/,/^\[/{/^\[features\]$/d;/^$/d}' Cargo.toml
167+
echo "Modified Cargo.toml for publishing:"
168+
cat Cargo.toml
169+
150170
- name: Publish crates
151171
env:
152172
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
@@ -156,8 +176,8 @@ jobs:
156176
sleep 15
157177
cargo publish -p rma-parser --allow-dirty || true
158178
sleep 15
159-
# Analyzer without oxc feature (oxc uses git deps not on crates.io)
160-
cargo publish -p rma-analyzer --allow-dirty --no-default-features || true
179+
# Analyzer (oxc deps stripped above)
180+
cargo publish -p rma-analyzer --allow-dirty || true
161181
sleep 15
162182
cargo publish -p rma-indexer --allow-dirty || true
163183
sleep 15

0 commit comments

Comments
 (0)