Skip to content

Commit fb10eb1

Browse files
author
boquanfu
committed
build: update publish scripts
1 parent 4384790 commit fb10eb1

File tree

3 files changed

+33
-18
lines changed

3 files changed

+33
-18
lines changed

Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
[workspace]
22
resolver = "2"
33
members = [
4-
"float-pigment-css",
4+
"float-pigment-consistent-bincode",
5+
"float-pigment-mlp",
56
"float-pigment-css-macro",
7+
"float-pigment-css",
68
"float-pigment-layout",
7-
"float-pigment-consistent-bincode",
8-
"float-pigment-forest",
99
"float-pigment-forest-macro",
10-
"float-pigment-mlp",
10+
"float-pigment-forest",
1111
"float-pigment",
1212
]
1313

deprecate.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
if [ "$1" == "" ]; then
4+
echo "Missing version. Usage: $0 [VERSION]"
5+
exit -1
6+
fi
7+
8+
VERSION="$1"
9+
PROJECTS=$(egrep '^[ \t]*"(.+)",$' Cargo.toml | sed -E 's/^[ \t]*"(.+)",$/\1/g')
10+
11+
# cargo yank
12+
echo "Ready to deprecate version ${VERSION}."
13+
for PROJECT in $PROJECTS; do
14+
echo ""
15+
echo "Deprecating ${PROJECT}..."
16+
cargo yank --version "${VERSION}" "${PROJECT}"
17+
done

publish.sh

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,12 @@
11
#!/bin/bash
22

3-
PROJECTS=(
4-
float-pigment-consistent-bincode
5-
float-pigment-mlp
6-
float-pigment-css-macro
7-
float-pigment-css
8-
float-pigment-layout
9-
float-pigment-forest-macro
10-
float-pigment-forest
11-
float-pigment
12-
)
13-
143
if [ "$1" == "" ]; then
154
echo "Missing version. Usage: $0 [VERSION]"
165
exit -1
176
fi
187

198
VERSION="$1"
9+
PROJECTS=$(egrep '^[ \t]*"(.+)",$' Cargo.toml | sed -E 's/^[ \t]*"(.+)",$/\1/g')
2010

2111
# run tests
2212
if cargo test; then
@@ -66,6 +56,14 @@ fi
6656
if test -z '$(git status --porcelain)'; then
6757
echo 'Git status OK.'
6858

59+
# update compile cache for float-pigment-css
60+
if cargo run --bin float_pigment_css_update_version --features compile_cache; then
61+
echo 'Compile cache for float-pigment-css updated.'
62+
else
63+
echo 'Failed to update compile cache for float-pigment-css! Abort'
64+
exit -1
65+
fi
66+
6967
# update version fields in cargo.toml
7068
if sed -i '' -E "s/version = \"[^\"]+\"/version = \"${VERSION}\"/" Cargo.toml; then
7169
echo 'Modified versions in Cargo.toml.'
@@ -75,7 +73,7 @@ if test -z '$(git status --porcelain)'; then
7573
fi
7674

7775
# generate a new commit and tag it
78-
if git add Cargo.toml && git commit -m "chore: update version to publish"; then
76+
if git add Cargo.toml float-pigment-css/compile_cache && git commit -m "chore: update version to publish"; then
7977
echo 'Generated a new version commit.'
8078
else
8179
echo 'Failed to commit! Abort.'
@@ -102,8 +100,8 @@ fi
102100

103101
# cargo publish
104102
echo "Ready to publish version ${VERSION}."
105-
for PROJECT in "${PROJECTS[@]}"; do
103+
for PROJECT in $PROJECTS; do
106104
echo ""
107105
echo "Publishing ${PROJECT}..."
108-
cargo publish --no-verify -p "${PROJECT}"
106+
cargo publish -p "${PROJECT}"
109107
done

0 commit comments

Comments
 (0)