-
Notifications
You must be signed in to change notification settings - Fork 8
49 lines (46 loc) · 1.61 KB
/
rust_release_dry_run.yaml
File metadata and controls
49 lines (46 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Crates Publish (Dry Run)
on:
workflow_dispatch:
inputs:
ref:
description: "Optional git tag or commit SHA to publish from"
type: string
required: false
exclude_crates:
description: "Optional comma-separated list of crates to exclude (e.g., 'sift_error,sift_connect')"
type: string
required: false
jobs:
rust-ci:
uses: ./.github/workflows/rust_ci.yaml
with:
ref: ${{ github.event.inputs.ref }}
publish-to-crates-io-dry-run:
runs-on: ubuntu-latest
name: Do a dry run publish to crates.io for the sift rust libraries
needs: rust-ci
environment:
name: crates.io (dry run)
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref || github.sha }}
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable
- name: Build exclude flags
id: excludes
run: |
EXCLUDE_FLAGS="--exclude sift-stream-bindings --exclude sift_cli"
if [ -n "${{ inputs.exclude_crates }}" ]; then
IFS=',' read -ra CRATES <<< "${{ inputs.exclude_crates }}"
for crate in "${CRATES[@]}"; do
crate=$(echo "$crate" | xargs)
if [ -n "$crate" ]; then
EXCLUDE_FLAGS="$EXCLUDE_FLAGS --exclude $crate"
fi
done
fi
echo "flags=$EXCLUDE_FLAGS" >> $GITHUB_OUTPUT
- name: Publish crates (dry run)
run: cargo publish --workspace ${{ steps.excludes.outputs.flags }} --manifest-path ./Cargo.toml --locked --dry-run