Упрощение кода: улучшена читаемость скрипта создания архивов исходного кода
This commit is contained in:
@@ -125,20 +125,20 @@ jobs:
|
||||
)
|
||||
else
|
||||
ARCHIVE_BASE="${ARCHIVE_BASE}" DIST_DIR="${DIST_DIR}" python3 - <<'PY'
|
||||
import os
|
||||
import zipfile
|
||||
import os
|
||||
import zipfile
|
||||
|
||||
base = os.environ["ARCHIVE_BASE"]
|
||||
src = os.path.join(".release-work", base)
|
||||
dst = os.path.join(os.environ["DIST_DIR"], f"{base}.zip")
|
||||
base = os.environ["ARCHIVE_BASE"]
|
||||
src = os.path.join(".release-work", base)
|
||||
dst = os.path.join(os.environ["DIST_DIR"], f"{base}.zip")
|
||||
|
||||
with zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as zf:
|
||||
with zipfile.ZipFile(dst, "w", zipfile.ZIP_DEFLATED) as zf:
|
||||
for root, _, files in os.walk(src):
|
||||
for file_name in files:
|
||||
full = os.path.join(root, file_name)
|
||||
arc = os.path.relpath(full, ".release-work")
|
||||
zf.write(full, arc)
|
||||
PY
|
||||
for file_name in files:
|
||||
full = os.path.join(root, file_name)
|
||||
arc = os.path.relpath(full, ".release-work")
|
||||
zf.write(full, arc)
|
||||
PY
|
||||
fi
|
||||
|
||||
sha256sum "${DIST_DIR}"/* > "${DIST_DIR}/checksums-sha256.txt"
|
||||
@@ -231,12 +231,13 @@ jobs:
|
||||
HOST="${HOST#http://}"
|
||||
TAG="${{ steps.meta.outputs.tag }}"
|
||||
|
||||
BODY_JSON=$(python3 - <<'PY'
|
||||
import json
|
||||
with open('/tmp/release_body.md', 'r', encoding='utf-8') as f:
|
||||
BODY_JSON=$(python3 - <<'PY'
|
||||
import json
|
||||
|
||||
with open('/tmp/release_body.md', 'r', encoding='utf-8') as f:
|
||||
print(json.dumps(f.read(), ensure_ascii=False))
|
||||
PY
|
||||
)
|
||||
PY
|
||||
)
|
||||
|
||||
if [ "${HOST}" = "github.com" ]; then
|
||||
CREATE_URL="https://api.github.com/repos/${REPO}/releases"
|
||||
|
||||
Reference in New Issue
Block a user