@@ -18,15 +18,47 @@ jobs:
1818
1919 - name : Verify tag matches Cargo.toml version
2020 run : |
21- CARGO_VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
21+ CARGO_VERSION=$(grep '^version' crates/rustmotion/ Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
2222 TAG_VERSION=${GITHUB_REF#refs/tags/}
2323 if [ "$CARGO_VERSION" != "$TAG_VERSION" ]; then
2424 echo "Tag $TAG_VERSION does not match Cargo.toml version $CARGO_VERSION"
2525 exit 1
2626 fi
2727
2828 - name : Run tests
29- run : cargo test
29+ run : cargo test --workspace
30+
31+ - name : Publish rustmotion-core
32+ run : cargo publish -p rustmotion-core --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
33+
34+ - name : Wait for rustmotion-core on crates.io
35+ run : |
36+ VERSION=$(grep '^version' crates/rustmotion-core/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
37+ for i in $(seq 1 30); do
38+ if curl -sf "https://crates.io/api/v1/crates/rustmotion-core/$VERSION" > /dev/null; then
39+ echo "rustmotion-core $VERSION available"
40+ exit 0
41+ fi
42+ echo "Waiting... ($i)"
43+ sleep 5
44+ done
45+ echo "Timeout waiting for rustmotion-core" && exit 1
46+
47+ - name : Publish rustmotion-components
48+ run : cargo publish -p rustmotion-components --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
49+
50+ - name : Wait for rustmotion-components on crates.io
51+ run : |
52+ VERSION=$(grep '^version' crates/rustmotion-components/Cargo.toml | head -1 | sed 's/.*"\(.*\)".*/\1/')
53+ for i in $(seq 1 30); do
54+ if curl -sf "https://crates.io/api/v1/crates/rustmotion-components/$VERSION" > /dev/null; then
55+ echo "rustmotion-components $VERSION available"
56+ exit 0
57+ fi
58+ echo "Waiting... ($i)"
59+ sleep 5
60+ done
61+ echo "Timeout waiting for rustmotion-components" && exit 1
3062
3163 - name : Publish rustmotion
32- run : cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}
64+ run : cargo publish -p rustmotion - -token ${{ secrets.CARGO_REGISTRY_TOKEN }}
0 commit comments