forked from sealad886/DeepFilterNet4
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpost-release.sh
More file actions
executable file
·35 lines (26 loc) · 1.35 KB
/
Copy pathpost-release.sh
File metadata and controls
executable file
·35 lines (26 loc) · 1.35 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
#!/bin/bash
set -e
MODIFIED=$(fd "(pyproject)|(Cargo)" -t f -e toml -X git diff --name-only {})
[[ -n "$MODIFIED" ]] && { echo "Project files are modified:" && echo "$MODIFIED" && exit 1; }
CUR_VERSION=$(sed -nr "/^\[package\]/ { :l /^version[ ]*=/ { s/.*=[ ]*//; p; q;}; n; b l;}" libDF/Cargo.toml | tr -d "\"")
# Increment last part
VERSION=$(echo "$CUR_VERSION" | awk -F. -v OFS=. 'NF==1{print ++$NF}; NF>1{$NF=sprintf("%0*d", length($NF), ($NF+1)); print}')-pre
set_version() {
FILE=$1
VERSION=$2
sed -i "0,/^version/s/^version *= *\".*\"/version = \"$VERSION\"/" "$FILE"
}
export -f set_version
fd "(pyproject)|(Cargo)" -t f -e toml -x bash -c "set_version {} $VERSION"
(
cd DeepFilterNet/
# Restore local workspace bindings for development after cutting a release.
sed -i 's|\"deepfilterlib == [^\"]*\"|\"deepfilterlib @ file:../pyDF\"|' pyproject.toml
sed -i 's|\"deepfilterdataloader == [^\"]*\"|\"deepfilterdataloader @ file:../pyDF-data\"|' pyproject.toml
)
echo cargo add --manifest-path ./pyDF/Cargo.toml --features transforms --path ./libDF
# cargo add --manifest-path ./pyDF/Cargo.toml --features transforms --path ./libDF deep_filter
# cargo add --manifest-path ./pyDF-data/Cargo.toml --features dataset --path ./libDF deep_filter
cargo update
fd "(pyproject)|(Cargo)" -I -t f -e toml -e lock -X git add {}
git commit -m "post-release v$VERSION"