Skip to content

Commit 60da7fc

Browse files
committed
Release v6.6: SofVault XP mirror cron pull from GitHub
Replace SSH publish with server-side sync_from_github.sh; drop CI sofvault_latest.json artifact.
1 parent b0b614f commit 60da7fc

8 files changed

Lines changed: 109 additions & 41 deletions

File tree

.github/workflows/build-and-release.yaml

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -180,18 +180,6 @@ jobs:
180180
draft: false
181181
prerelease: false
182182

183-
- name: Generate sofvault XP mirror manifest
184-
run: |
185-
TAG="v${{ steps.version.outputs.version }}-build${{ github.run_number }}"
186-
cat > sofvault_latest.json <<EOF
187-
{
188-
"tag_name": "$TAG",
189-
"html_url": "http://sofvault.org/sof_buddy/releases/latest",
190-
"zip_url": "http://sofvault.org/sof_buddy/releases/files/release_windows_xp.zip"
191-
}
192-
EOF
193-
cat sofvault_latest.json
194-
195183
- name: Upload Windows Release Asset
196184
uses: actions/upload-release-asset@v1
197185
env:
@@ -222,16 +210,6 @@ jobs:
222210
asset_name: release_windows_xp.zip
223211
asset_content_type: application/zip
224212

225-
- name: Upload sofvault XP mirror manifest
226-
uses: actions/upload-release-asset@v1
227-
env:
228-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
229-
with:
230-
upload_url: ${{ steps.create_release.outputs.upload_url }}
231-
asset_path: sofvault_latest.json
232-
asset_name: sofvault_latest.json
233-
asset_content_type: application/json
234-
235213
- name: Upload Windows Debug Asset
236214
uses: actions/upload-release-asset@v1
237215
env:

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## v6.6
4+
5+
### Updates — SofVault XP mirror (cron pull)
6+
7+
- **`rsrc/sofvault_mirror/sync_from_github.sh`:** Server-side cron script polls GitHub’s latest release API, downloads `release_windows_xp.zip` when the tag changes, and writes `latest.json` for XP in-game updater checks.
8+
- **Removed `publish.sh`:** No SSH push from GitHub Actions; sofvault syncs from GitHub like the sof1maps mirror.
9+
- **CI:** Dropped redundant `sofvault_latest.json` generate/upload release-asset steps.
10+
- **Docs:** `rsrc/sofvault_mirror/README.md` and README XP section note the cron pull model.
11+
312
## v6.5
413

514
### CallsiteClassifier — funcmap parser fix

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
set _sofbuddy_update_releases_url "http://your-endpoint/releases/latest"
153153
```
154154
- XP users may hit WinHTTP TLS failures on modern HTTPS endpoints (for example GitHub API). The mirror defaults above avoid that path.
155+
- The sofvault host syncs the XP zip + `latest.json` from GitHub on a cron schedule (`rsrc/sofvault_mirror/sync_from_github.sh`); no SSH publish from CI is required.
155156

156157
</details>
157158

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.5
1+
6.6

hdr/version.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
Increment version using: ./increment_version.sh
88
*/
99

10-
#define SOFBUDDY_VERSION "6.5"
10+
#define SOFBUDDY_VERSION "6.6"

rsrc/sofvault_mirror/README.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# SofVault XP updater mirror
2+
3+
XP builds fetch updates over HTTP from `sofvault.org/sof_buddy/releases/` (see `src/core/update_command.cpp`).
4+
5+
## Server setup (cron pull)
6+
7+
Install `sync_from_github.sh` on the sofvault host. It polls GitHub’s latest release API, downloads `release_windows_xp.zip` when the tag changes, and writes `latest.json` for in-game updater checks.
8+
9+
Requires: `curl`, `jq`
10+
11+
```bash
12+
chmod +x sync_from_github.sh
13+
SOFVAULT_ROOT=/var/www/html/sofvault.org/sof_buddy/releases ./sync_from_github.sh
14+
```
15+
16+
Example crontab:
17+
18+
```
19+
*/30 * * * * /path/to/sync_from_github.sh >> /var/log/sofvault-buddy-sync.log 2>&1
20+
```
21+
22+
Output layout:
23+
24+
```
25+
$SOFVAULT_ROOT/
26+
latest.json # manifest (tag_name, html_url, zip_url)
27+
latest # plain tag text
28+
.synced_tag # last downloaded tag
29+
files/
30+
release_windows_xp.zip
31+
```
32+
33+
No SSH push from GitHub Actions is required; the server pulls assets like the sof1maps mirror.

rsrc/sofvault_mirror/publish.sh

Lines changed: 0 additions & 17 deletions
This file was deleted.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env bash
2+
# Pull latest Windows XP release from GitHub into the sofvault HTTP mirror.
3+
# Intended for cron on the sofvault host (same pull model as sof1maps sync).
4+
#
5+
# Example crontab (every 30 minutes):
6+
# */30 * * * * /path/to/sync_from_github.sh >> /var/log/sofvault-buddy-sync.log 2>&1
7+
#
8+
# Override paths for testing:
9+
# SOFVAULT_ROOT=/tmp/sof_buddy/releases ./sync_from_github.sh
10+
11+
set -euo pipefail
12+
13+
ROOT="${SOFVAULT_ROOT:-/var/www/html/sofvault.org/sof_buddy/releases}"
14+
FILES="$ROOT/files"
15+
TMP="$(mktemp -d)"
16+
trap 'rm -rf "$TMP"' EXIT
17+
18+
API="https://api.github.com/repos/d3nd3/sof_buddy/releases/latest"
19+
UA="sofvault-mirror/1.0"
20+
XP_ZIP="release_windows_xp.zip"
21+
22+
curl -fsSL \
23+
-H "Accept: application/vnd.github+json" \
24+
-H "X-GitHub-Api-Version: 2022-11-28" \
25+
-H "User-Agent: $UA" \
26+
"$API" -o "$TMP/release.json"
27+
28+
TAG="$(jq -r '.tag_name // .version // .tag // empty' "$TMP/release.json")"
29+
ASSET_URL="$(jq -r --arg zip "$XP_ZIP" '
30+
[ .assets[]?.browser_download_url
31+
| select(test("/" + $zip + "$"; "i"))
32+
] | first // empty
33+
' "$TMP/release.json")"
34+
35+
if [[ -z "$TAG" || -z "$ASSET_URL" ]]; then
36+
echo "No valid release tag or $XP_ZIP asset found"
37+
exit 1
38+
fi
39+
40+
FN="$XP_ZIP"
41+
mkdir -p "$FILES"
42+
43+
TAG_FILE="$ROOT/.synced_tag"
44+
NEED_DL=0
45+
[[ ! -s "$FILES/$FN" ]] && NEED_DL=1
46+
[[ ! -f "$TAG_FILE" || "$(<"$TAG_FILE")" != "$TAG" ]] && NEED_DL=1
47+
48+
if [[ "$NEED_DL" -eq 1 ]]; then
49+
curl -fL --retry 3 -H "User-Agent: $UA" "$ASSET_URL" -o "$FILES/$FN.tmp"
50+
mv "$FILES/$FN.tmp" "$FILES/$FN"
51+
echo "$TAG" > "$TAG_FILE"
52+
fi
53+
54+
cat > "$ROOT/latest.json.tmp" <<EOF
55+
{
56+
"tag_name": "$TAG",
57+
"html_url": "http://sofvault.org/sof_buddy/releases/latest",
58+
"zip_url": "http://sofvault.org/sof_buddy/releases/files/$FN"
59+
}
60+
EOF
61+
mv "$ROOT/latest.json.tmp" "$ROOT/latest.json"
62+
63+
echo "$TAG" > "$ROOT/latest"
64+
echo "Synced $TAG -> $FN"

0 commit comments

Comments
 (0)