Skip to content

Commit 08f5e66

Browse files
authored
rust(chore): add additional exclude flags to cargo publish (#454)
1 parent abc207a commit 08f5e66

2 files changed

Lines changed: 38 additions & 2 deletions

File tree

.github/workflows/rust_release.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: "Optional git tag or commit SHA to publish from"
88
type: string
99
required: false
10+
exclude_crates:
11+
description: "Optional comma-separated list of crates to exclude (e.g., 'sift_error,sift_connect')"
12+
type: string
13+
required: false
1014

1115
jobs:
1216
rust-ci:
@@ -27,7 +31,21 @@ jobs:
2731
ref: ${{ github.event.inputs.ref || github.sha }}
2832
- name: Install stable toolchain
2933
uses: dtolnay/rust-toolchain@stable
34+
- name: Build exclude flags
35+
id: excludes
36+
run: |
37+
EXCLUDE_FLAGS="--exclude sift_stream_bindings --exclude sift_cli"
38+
if [ -n "${{ inputs.exclude_crates }}" ]; then
39+
IFS=',' read -ra CRATES <<< "${{ inputs.exclude_crates }}"
40+
for crate in "${CRATES[@]}"; do
41+
crate=$(echo "$crate" | xargs)
42+
if [ -n "$crate" ]; then
43+
EXCLUDE_FLAGS="$EXCLUDE_FLAGS --exclude $crate"
44+
fi
45+
done
46+
fi
47+
echo "flags=$EXCLUDE_FLAGS" >> $GITHUB_OUTPUT
3048
- name: Publish crates
31-
run: cargo publish --workspace --exclude sift-stream-bindings --exclude sift_cli --manifest-path ./Cargo.toml --locked --token ${CARGO_REGISTRY_TOKEN}
49+
run: cargo publish --workspace ${{ steps.excludes.outputs.flags }} --manifest-path ./Cargo.toml --locked --token ${CARGO_REGISTRY_TOKEN}
3250
env:
3351
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}

.github/workflows/rust_release_dry_run.yaml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ on:
77
description: "Optional git tag or commit SHA to publish from"
88
type: string
99
required: false
10+
exclude_crates:
11+
description: "Optional comma-separated list of crates to exclude (e.g., 'sift_error,sift_connect')"
12+
type: string
13+
required: false
1014

1115
jobs:
1216
rust-ci:
@@ -27,5 +31,19 @@ jobs:
2731
ref: ${{ github.event.inputs.ref || github.sha }}
2832
- name: Install stable toolchain
2933
uses: dtolnay/rust-toolchain@stable
34+
- name: Build exclude flags
35+
id: excludes
36+
run: |
37+
EXCLUDE_FLAGS="--exclude sift_stream_bindings --exclude sift_cli"
38+
if [ -n "${{ inputs.exclude_crates }}" ]; then
39+
IFS=',' read -ra CRATES <<< "${{ inputs.exclude_crates }}"
40+
for crate in "${CRATES[@]}"; do
41+
crate=$(echo "$crate" | xargs)
42+
if [ -n "$crate" ]; then
43+
EXCLUDE_FLAGS="$EXCLUDE_FLAGS --exclude $crate"
44+
fi
45+
done
46+
fi
47+
echo "flags=$EXCLUDE_FLAGS" >> $GITHUB_OUTPUT
3048
- name: Publish crates (dry run)
31-
run: cargo publish --workspace --exclude sift-stream-bindings --exclude sift_cli --manifest-path ./Cargo.toml --locked --dry-run
49+
run: cargo publish --workspace ${{ steps.excludes.outputs.flags }} --manifest-path ./Cargo.toml --locked --dry-run

0 commit comments

Comments
 (0)