chore: release v1.0.4
Deploy / build-windows (push) Failing after 19s
Deploy / build-linux-web (push) Successful in 51s
Deploy / build-macos (push) Failing after 32s
Deploy / release-deploy (push) Has been skipped

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
wangjia
2026-05-30 23:53:51 +08:00
parent 75e3b934bc
commit d94c6b109b
6 changed files with 98 additions and 12 deletions
+44
View File
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
# compile-macos.sh <tag> — build Flutter macOS desktop, package into dist/
set -euo pipefail
export GOPROXY="${GOPROXY:-https://goproxy.cn,direct}"
export PUB_HOSTED_URL="${PUB_HOSTED_URL:-https://pub.flutter-io.cn}"
export FLUTTER_STORAGE_BASE_URL="${FLUTTER_STORAGE_BASE_URL:-https://storage.flutter-io.cn}"
TAG="$1"
VER="${TAG#v}"
echo "==> compile-macos: version=${VER}"
# Sync Flutter pubspec version (BSD sed on macOS)
sed -i '' "s/^version:.*/version: ${VER}+1/" client/pubspec.yaml
# Build Flutter macOS
cd client
flutter build macos --release \
"--dart-define=BASE_URL=https://jiu.51yanmei.com" \
"--dart-define=PUBLIC_URL=https://jiu.51yanmei.com" \
"--dart-define=APP_VERSION=${TAG}"
cd ..
# Package .app bundle into zip
mkdir -p dist
python3 - <<'PYEOF'
import zipfile, os
src = os.path.join('client', 'build', 'macos', 'Build', 'Products', 'Release', 'jiu.app')
dst = os.path.join('dist', 'jiu-macos-x64.zip')
with zipfile.ZipFile(dst, 'w', zipfile.ZIP_DEFLATED) as zf:
for root, dirs, files in os.walk(src):
for fname in files:
fp = os.path.join(root, fname)
zf.write(fp, os.path.join('jiu.app', os.path.relpath(fp, src)))
size = os.path.getsize(dst)
print(f'Packaged {dst} ({size // 1024 // 1024} MB)')
PYEOF
echo "==> compile-macos: done — dist/ contents:"
ls -lh dist/
+8 -3
View File
@@ -36,7 +36,7 @@ PYEOF
echo "==> release: release_notes=${RELEASE_NOTES}"
# Update backend/config/version.yaml (version, build_number, release_notes, windows URL)
# Update backend/config/version.yaml (version, build_number, release_notes, macos/windows URL)
python3 - "${VER}" "${RELEASE_NOTES}" "${TAG}" "${FORGEJO_URL}" "${GITEA_REPOSITORY}" <<'PYEOF'
import sys
ver = sys.argv[1]
@@ -44,7 +44,9 @@ notes = sys.argv[2]
tag = sys.argv[3]
furl = sys.argv[4].rstrip('/')
repo = sys.argv[5]
win_url = f"{furl}/{repo}/releases/download/{tag}/jiu-windows-x64.zip"
base = f"{furl}/{repo}/releases/download/{tag}"
mac_url = f"{base}/jiu-macos-x64.zip"
win_url = f"{base}/jiu-windows-x64.zip"
lines = []
with open('backend/config/version.yaml') as f:
@@ -59,13 +61,15 @@ with open('backend/config/version.yaml') as f:
lines.append('build_number: ' + str(build) + '\n')
elif line.startswith('release_notes:'):
lines.append('release_notes: "' + notes.replace('\\', '\\\\').replace('"', '\\"') + '"\n')
elif line.startswith(' macos:'):
lines.append(' macos: "' + mac_url + '"\n')
elif line.startswith(' windows:'):
lines.append(' windows: "' + win_url + '"\n')
else:
lines.append(line)
with open('backend/config/version.yaml', 'w') as f:
f.writelines(lines)
print('version.yaml updated to', ver, '| windows:', win_url)
print('version.yaml updated to', ver, '| macos:', mac_url, '| windows:', win_url)
PYEOF
# Package configs.tar.gz (includes updated version.yaml)
@@ -123,6 +127,7 @@ upload_asset dist/jiu-server
upload_asset dist/web.tar.gz
upload_asset dist/marketing.tar.gz
upload_asset dist/configs.tar.gz
upload_asset dist/jiu-macos-x64.zip
upload_asset dist/jiu-windows-x64.zip
echo "==> release: done — Release ${TAG} created"