Skip to content

Commit 64e6f43

Browse files
committed
🐛 Fixing cargo publish --dry-run with unpublished dependencies
1 parent 4df9a8c commit 64e6f43

File tree

2 files changed

+47
-17
lines changed

2 files changed

+47
-17
lines changed

.github/workflows/publish-bolt-crates.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ jobs:
5151
with:
5252
toolchain: stable
5353

54+
- name: Install Rust nightly
55+
uses: dtolnay/rust-toolchain@nightly
56+
with:
57+
toolchain: nightly
58+
5459
- name: Cache rust
5560
uses: Swatinem/rust-cache@v2
5661

@@ -170,23 +175,22 @@ jobs:
170175
NO_VERIFY_FLAG="--no-verify"
171176
fi
172177
173-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/utils/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
174-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
175-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-deserialize/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
176-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/component-id/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
177-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
178-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/system-input/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
179-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/extra-accounts/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
180-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/arguments/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
181-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/bolt-program/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
182-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/attribute/delegate/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
183-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/programs/bolt-system/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
184-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/programs/bolt-component/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
185-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/programs/world/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
186-
cargo publish $DRY_RUN_FLAG --manifest-path=crates/bolt-lang/Cargo.toml --token $CRATES_TOKEN $NO_VERIFY_FLAG
187-
if [ "${DRY_RUN}" != "true" ]; then
188-
cargo publish --manifest-path=crates/bolt-cli/Cargo.toml --token $CRATES_TOKEN
189-
fi
178+
cargo +nightly publish -Zpackage-workspace $DRY_RUN_FLAG $NO_VERIFY_FLAG --token $CRATES_TOKEN \
179+
-p world \
180+
-p bolt-cli \
181+
-p bolt-lang \
182+
-p bolt-utils \
183+
-p bolt-system \
184+
-p bolt-component \
185+
-p bolt-attribute-bolt-arguments \
186+
-p bolt-attribute-bolt-component \
187+
-p bolt-attribute-bolt-component-deserialize \
188+
-p bolt-attribute-bolt-component-id \
189+
-p bolt-attribute-bolt-delegate \
190+
-p bolt-attribute-bolt-extra-accounts \
191+
-p bolt-attribute-bolt-program \
192+
-p bolt-attribute-bolt-system \
193+
-p bolt-attribute-bolt-system-input
190194
env:
191195
CRATES_TOKEN: ${{ secrets.CRATES_TOKEN }}
192196
DRY_RUN: ${{ env.DRY_RUN }}

scripts/test-publish.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
DRY_RUN="true"
2+
DRY_RUN_FLAG=""
3+
if [ "${DRY_RUN}" = "true" ]; then
4+
DRY_RUN_FLAG="--dry-run"
5+
fi
6+
7+
if [ "${DRY_RUN}" = "true" ]; then
8+
NO_VERIFY_FLAG="--no-verify"
9+
fi
10+
11+
cargo +nightly publish -Zpackage-workspace $DRY_RUN_FLAG $NO_VERIFY_FLAG \
12+
-p world \
13+
-p bolt-cli \
14+
-p bolt-lang \
15+
-p bolt-utils \
16+
-p bolt-system \
17+
-p bolt-component \
18+
-p bolt-attribute-bolt-arguments \
19+
-p bolt-attribute-bolt-component \
20+
-p bolt-attribute-bolt-component-deserialize \
21+
-p bolt-attribute-bolt-component-id \
22+
-p bolt-attribute-bolt-delegate \
23+
-p bolt-attribute-bolt-extra-accounts \
24+
-p bolt-attribute-bolt-program \
25+
-p bolt-attribute-bolt-system \
26+
-p bolt-attribute-bolt-system-input

0 commit comments

Comments
 (0)