-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (53 loc) · 2.25 KB
/
publish.yaml
File metadata and controls
64 lines (53 loc) · 2.25 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Publish to crates.io
on:
push:
tags:
- "[0-9]+.[0-9]+.[0-9]+"
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install system dependencies
run: sudo apt-get update && sudo apt-get install -y libfontconfig1-dev libfreetype6-dev
- uses: dtolnay/rust-toolchain@stable
- name: Verify tag matches Cargo.toml version
run: |
CARGO_VERSION=$(grep '^version' crates/rustmotion/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
TAG_VERSION=${GITHUB_REF#refs/tags/}
if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
echo "Tag $TAG_VERSION does not match Cargo.toml version $CARGO_VERSION"
exit 1
fi
- name: Run tests
run: cargo test --workspace
- name: Publish rustmotion-core
run: cargo publish -p rustmotion-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Wait for rustmotion-core on crates.io
run: |
VERSION=$(grep '^version' crates/rustmotion-core/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
for i in $(seq 1 30); do
if curl -sf "https://crates.io/api/v1/crates/rustmotion-core/$VERSION" > /dev/null; then
echo "rustmotion-core $VERSION available"
exit 0
fi
echo "Waiting... ($i)"
sleep 5
done
echo "Timeout waiting for rustmotion-core" && exit 1
- name: Publish rustmotion-components
run: cargo publish -p rustmotion-components --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
- name: Wait for rustmotion-components on crates.io
run: |
VERSION=$(grep '^version' crates/rustmotion-components/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
for i in $(seq 1 30); do
if curl -sf "https://crates.io/api/v1/crates/rustmotion-components/$VERSION" > /dev/null; then
echo "rustmotion-components $VERSION available"
exit 0
fi
echo "Waiting... ($i)"
sleep 5
done
echo "Timeout waiting for rustmotion-components" && exit 1
- name: Publish rustmotion
run: cargo publish -p rustmotion --token ${{ secrets.CARGO_REGISTRY_TOKEN }}