release-automation

This commit is contained in:
ed
2025-10-17 21:59:37 +00:00
parent 5d96862c45
commit f73742b6a4
5 changed files with 94 additions and 17 deletions

View File

@@ -48,7 +48,7 @@ done
filt=
[ $clean ] && filt='/<none>/{print$$3}'
[ $hclean ] && filt='/localhost\/copyparty-|^<none>.*localhost\/alpine-/{print$3}'
[ $hclean ] && filt='/localhost\/(copyparty|alpine)-/{print$3}'
[ $purge ] && filt='NR>1{print$3}'
[ $filt ] && {
[ $purge ] && {

44
scripts/genhelp.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
set -e
[ -e make-sfx.sh ] || cd scripts
[ -e make-sfx.sh ] && [ -e deps-docker ] || {
echo cd into the scripts folder first
exit 1
}
cd ../dist
kwds='-bind -accounts -auth -auth-ord -flags -handlers -hooks -idp -urlform -exp -ls -dbd -chmod -pwhash -zm'
html() {
for a in '' $kwds; do
echo "html$a" >&2
COLUMNS=140 ./copyparty-sfx.py --ansi --help$a 2>/dev/null
printf '\n\n\n%0139d\n\n'
done | aha -b --no-xml | sed -r '
s/color:black/color:#222/g;
s/color:dimgray\b/color:#606060/g;
s/color:red\b/color:#c75b79/g;
s/color:lime\b/color:#b8e346/g;
s/color:yellow\b/color:#ffa402/g;
s/color:#3333[Ff]{2}\b/color:#02a2ff/g;
s/color:fuchsia\b/color:#f65be3/g;
s/color:aqua\b/color:#3da698/g;
s/color:white\b/color:#fff/g;
s/style="filter:[^;]+/style="/g;
' |
HLPTXT=CAT python3 ../scripts/help2html.py
}
txt() {
(for a in '' $kwds; do
echo "txt$a" >&2
COLUMNS=9001 ./copyparty-sfx.py --help$a 2>/dev/null
printf '\n\n\n%0255d\n\n\n'
done;printf '\n\n\n') |
HLPTXT=CAT ../scripts/help2txt.sh
}
html
txt

View File

@@ -1,5 +1,6 @@
#!/usr/bin/env python3
import os
import re
import socket
import subprocess as sp
@@ -21,6 +22,9 @@ def readclip():
"xclip -selection CLIPBOARD -o",
"pbpaste",
]
if os.getenv("HLPTXT") == "CAT":
cmds = ["cat"]
for cmd in cmds:
try:
return sp.check_output(cmd.split()).decode("utf-8")
@@ -44,7 +48,7 @@ def cnv(src):
while True:
ln = next(src)
if "<font" in ln:
if "<font" in ln or "<span" in ln:
if not ln.startswith("<pre>"):
ln = "<pre>" + ln
yield ln
@@ -53,12 +57,14 @@ def cnv(src):
for ln in src:
ln = ln.rstrip()
t = ln
if re.search(r"^<font[^>]+>copyparty v[0-9]", ln):
if re.search(r"^<(font|span)[^>]+>copyparty v[0-9]", ln):
in_sfx = 3
if in_sfx:
in_sfx -= 1
if not skip_sfx:
yield ln
elif not in_sfx:
yield "<span>"
continue
if '">uuid:' in ln:
ln = re.sub(r">uuid:[0-9a-f-]{36}<", ">autogenerated<", ln)

View File

@@ -1,7 +1,7 @@
#!/bin/bash
set -e
( xsel -ob | sed -r '
( ( HLPTXT=CAT && cat || xsel -ob ) | sed -r '
s`/home/ed/`~/`;
s/uuid:[0-9a-f-]{36}/autogenerated/;
s/(-salt SALT.*default: )[0-9a-zA-Z/+]{24}\)/\124-character-autogenerated)/;

View File

@@ -1,9 +1,13 @@
#!/bin/bash
set -e
# if specified, keep the following sfx flags last: gz gzz fast
parallel=1
# usage: ./scripts/rls.sh 1.9.11 gzz 50 # create full release
# usage: ./scripts/rls.sh sfx gzz 10 # just create sfx.py + en.py + helptext
#
# if specified, keep the following sfx-args last: gz gzz xz nopk udep fast
#
# WARNING: when creating full release, will DELETE all of ../dist/,
# and all docker-images matching 'localhost/(copyparty|alpine)-'
[ -e make-sfx.sh ] || cd scripts
[ -e make-sfx.sh ] && [ -e deps-docker ] || {
@@ -11,26 +15,24 @@ parallel=1
exit 1
}
v=$1
v=$1; shift
[ "$v" = sfx ] &&
rls= || rls=1
[ "$v" = sfx ] || {
[ $rls ] && {
printf '%s\n' "$v" | grep -qE '^[0-9\.]+$' || exit 1
grep -E "(${v//./, })" ../copyparty/__version__.py || exit 1
git push all
./make-sfx.sh nopk gz
../dist/copyparty-sfx.py --version >/dev/null
git tag v$v
git push all --tags
rm -rf ../dist
./make-pypi-release.sh u
(cd .. && python3 ./setup.py clean2)
./make-tgz-release.sh $v
}
rm -f ../dist/copyparty-sfx*
shift
rm -rf /tmp/pe-copyparty* ../sfx ../dist/copyparty-sfx*
./make-sfx.sh "$@"
../dist/copyparty-sfx.py --version >/dev/null
mv ../dist/copyparty-{sfx,int}.py
@@ -38,6 +40,9 @@ mv ../dist/copyparty-{sfx,int}.py
while [ "$1" ]; do
case "$1" in
gz*) break;;
xz) break;;
nopk) break;;
udep) break;;
fast) break;;
esac
shift
@@ -49,4 +54,26 @@ done
mv ../dist/copyparty-{sfx,en}.py
mv ../dist/copyparty-{int,sfx}.py
./genhelp.sh
[ $rls ] || exit # ----------------------------------------------------
./prep.sh
git add ../contrib/package/arch/PKGBUILD ../contrib/package/makedeb-mpr/PKGBUILD ../contrib/package/nix/copyparty/pin.json
git commit -m "update pkgs to $v"
git log | head
( cd docker
#./make.sh purge
./make.sh hclean
./make.sh hclean
./make.sh hclean pull img push
)
git push
git push --all
git push --tags
git push all
git push all --all
git push all --tags
# git tag -d v$v; git push --delete origin v$v