forked from HyperSafeD/Sanctifier
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (35 loc) · 1.39 KB
/
Copy pathpublish.yml
File metadata and controls
43 lines (35 loc) · 1.39 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
name: Publish to Crates.io
on:
push:
tags:
- "v*"
permissions: {}
env:
CARGO_TERM_COLOR: always
jobs:
publish:
name: Publish crates on version tag
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install stable Rust toolchain
uses: dtolnay/rust-toolchain@stable
- name: Publish sanctifier-core
run: cargo publish --manifest-path tooling/sanctifier-core/Cargo.toml --token ${{ secrets.CRATES_IO_TOKEN }}
- name: Wait for sanctifier-core to reach crates.io
run: |
core_version=$(cargo metadata --format-version 1 --no-deps --manifest-path tooling/sanctifier-core/Cargo.toml | python -c "import json,sys; print(json.load(sys.stdin)['packages'][0]['version'])")
for attempt in {1..12}; do
if cargo search sanctifier-core --limit 1 | grep "sanctifier-core = \"${core_version}\""; then
exit 0
fi
echo "sanctifier-core ${core_version} is not visible on crates.io yet; retrying in 10 seconds"
sleep 10
done
echo "Timed out waiting for sanctifier-core ${core_version} to appear on crates.io"
exit 1
- name: Publish sanctifier-cli
run: cargo publish --manifest-path tooling/sanctifier-cli/Cargo.toml --token ${{ secrets.CRATES_IO_TOKEN }}