Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
921801756d | ||
|
|
217aeb9fb3 | ||
|
|
64aa16fcbb | ||
|
|
176bd9259e |
No files matched your search
@@ -0,0 +1,64 @@
|
||||
name: Wurm portable download
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
target:
|
||||
description: Build target
|
||||
type: choice
|
||||
required: true
|
||||
default: zx
|
||||
options: [zx]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: wurm-portable
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
zx:
|
||||
if: github.ref == 'refs/heads/master' && inputs.target == 'zx'
|
||||
runs-on: build-native-wurm-zx
|
||||
timeout-minutes: 45
|
||||
env:
|
||||
BUILD_NATIVE_TARGET: ${{ inputs.target }}
|
||||
ZIRAN_PAR_THREADS: '1'
|
||||
MAKEFLAGS: -j1
|
||||
OMP_NUM_THREADS: '1'
|
||||
YUE_DESKTOP_RECOVERY: '0'
|
||||
defaults:
|
||||
run:
|
||||
working-directory: waozixyz/wurm
|
||||
steps:
|
||||
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955
|
||||
with:
|
||||
path: waozixyz/wurm
|
||||
persist-credentials: false
|
||||
- name: Resolve first-party sources on Gitea
|
||||
run: |
|
||||
git config --global url.https://git.waozi.xyz/waozi/.insteadOf https://github.com/waozixyz/
|
||||
git config --global url.https://git.waozi.xyz/ziranlang/.insteadOf https://github.com/ziranlang/
|
||||
git config --global url.https://git.waozi.xyz/kryonlabs/.insteadOf https://github.com/kryonlabs/
|
||||
- name: Set up the locked compiler and packages
|
||||
uses: https://git.waozi.xyz/ziranlang/ziran/.github/actions/setup@979159a55bcf1f9edb9eb8f26ea10aca421412e2
|
||||
with:
|
||||
project: waozixyz/wurm
|
||||
path: ziranlang/ziran
|
||||
fetch: true
|
||||
packages: build-essential python3 zlib1g-dev
|
||||
- name: Build the game-owned portable downloads
|
||||
run: |
|
||||
python3 tests/portable_export_test.py
|
||||
python3 tools/build_portable.py
|
||||
python3 tests/portable_export_test.py --built
|
||||
- name: Keep Wurm's portable downloads
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: wurm-portable
|
||||
path: |
|
||||
waozixyz/wurm/build/downloads/wurm.zx
|
||||
waozixyz/wurm/build/downloads/wurm-portable-v*.tar.gz
|
||||
if-no-files-found: error
|
||||
retention-days: 7
|
||||
@@ -74,7 +74,7 @@ jobs:
|
||||
env:
|
||||
LDLIBS: -lz
|
||||
run: ziran run --target=c tests/run_local.zi
|
||||
- name: Build the portable release for Arcade
|
||||
- name: Build the portable release and standalone download
|
||||
run: |
|
||||
python3 tests/portable_export_test.py
|
||||
python3 tools/build_portable.py
|
||||
@@ -152,6 +152,8 @@ jobs:
|
||||
test -f "build/downloads/wurm-v$VERSION-gplay.apk"
|
||||
test -f "build/downloads/wurm-web-v$VERSION.zip"
|
||||
test -s "build/downloads/wurm-portable-v$VERSION.tar.gz"
|
||||
test -s build/downloads/wurm.zx
|
||||
cmp build/games/wurm.zx build/downloads/wurm.zx
|
||||
cmp "build/downloads/wurm-v$VERSION.apk" "build/downloads/wurm-$VERSION-fdroid.apk"
|
||||
# This version's section of CHANGELOG.md, without surrounding blank lines.
|
||||
awk -v heading="## [$VERSION] - " '
|
||||
@@ -177,7 +179,7 @@ jobs:
|
||||
if [ "$state" = missing ]; then
|
||||
gh release create "$tag" --draft --target "$GITHUB_SHA" --title "Apfelwurm $VERSION" --notes-file build/release-notes.md
|
||||
fi
|
||||
gh release upload "$tag" "build/downloads/wurm-v$VERSION.apk" "build/downloads/wurm-$VERSION-fdroid.apk" "build/downloads/wurm-v$VERSION-gplay.apk" "build/downloads/wurm-web-v$VERSION.zip" "build/downloads/wurm-portable-v$VERSION.tar.gz" --clobber
|
||||
gh release upload "$tag" "build/downloads/wurm-v$VERSION.apk" "build/downloads/wurm-$VERSION-fdroid.apk" "build/downloads/wurm-v$VERSION-gplay.apk" "build/downloads/wurm-web-v$VERSION.zip" "build/downloads/wurm-portable-v$VERSION.tar.gz" build/downloads/wurm.zx --clobber
|
||||
gh release edit "$tag" --draft=false --latest
|
||||
echo "published=true" >> "$GITHUB_OUTPUT"
|
||||
- name: Install itch.io Butler
|
||||
|
||||
@@ -67,7 +67,7 @@ jobs:
|
||||
path: ziranlang/ziran
|
||||
fetch: true
|
||||
packages: >-
|
||||
build-essential cmake pkg-config zlib1g-dev libssl-dev
|
||||
build-essential cmake nasm meson ninja-build pkg-config zlib1g-dev libssl-dev
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
- Offer the standalone Wurm ZX download in Wurm’s own releases, alongside its portable archive.
|
||||
|
||||
- Use the Apps frame type so Apfelwurm and its editor open in Arcade inside Breeze.
|
||||
|
||||
- Use Mesh naming and its canonical local referral fixture for browser tests.
|
||||
|
||||
- Use Ziran’s standard audio mixer and SDL, Android and WebAudio sinks, preserving music transitions and volume while testing playback, pause, seek and loop behavior. Take desktop codecs from Kryon’s desktop artifact.
|
||||
|
||||
@@ -176,3 +176,16 @@ LDLIBS=-lz ziran run --target=c tests/run_local.zi
|
||||
See the [build and development guide](docs/building.md) for the editor's
|
||||
save files, Android and portable builds, asset recovery and verification.
|
||||
[Report a bug or suggest a level](https://github.com/waozixyz/wurm/issues).
|
||||
|
||||
## Portable downloads
|
||||
|
||||
`python3 tools/build_portable.py` builds Wurm and its editor in this repository.
|
||||
It writes the complete portable archive and the identical standalone game to
|
||||
`build/downloads/wurm.zx`. Verify their agreement with
|
||||
`python3 tests/portable_export_test.py --built`.
|
||||
|
||||
The Gitea `portable.yml` workflow on `master` accepts only `target=zx` and uses
|
||||
the repository-scoped `build-native-wurm-zx` runner. It builds portable downloads
|
||||
without starting the Android or browser release jobs and retains the outputs as
|
||||
build artifacts. Installing that runner and verifying a hosted run are separate
|
||||
from the local packaging test. Published downloads belong to Wurm’s own releases.
|
||||
+5
-18
@@ -1,28 +1,13 @@
|
||||
Apps :: #import "apps/node_types";
|
||||
Node :: #import "apps/node_app";
|
||||
#import "kryon/geometry"
|
||||
#import "kryon/session"
|
||||
UiSession :: #import "kryon/session";
|
||||
App :: #import, file "app.zi";
|
||||
Runtime :: #import "portable_runtime";
|
||||
Locale :: #import, file "localization.zi";
|
||||
host_api :: #system_library "host_api";
|
||||
|
||||
// Keep the portable UI ABI on this app's Kryon package. Apps.AppUiFrame has
|
||||
// the same public value layout, but importing its Session would couple the
|
||||
// portable entry to whichever Kryon revision the host package was built with.
|
||||
AppUiFrame :: struct {
|
||||
session: Session
|
||||
width: s32
|
||||
height: s32
|
||||
bottom: s32
|
||||
top: s32
|
||||
scale: float32
|
||||
font: s32
|
||||
now: float64
|
||||
dark: bool
|
||||
}
|
||||
|
||||
ReadAppUiHost :: () -> AppUiFrame #foreign host_api;
|
||||
ReadAppUiHost :: () -> Apps.AppUiFrame #foreign host_api;
|
||||
|
||||
#program_export
|
||||
Main :: () -> s32 { return Node.RunNodeApp(WurmFrame, WurmBack) }
|
||||
@@ -33,7 +18,9 @@ WurmFrame :: (message: Apps.AppMessage) -> bool {
|
||||
Runtime.FrameTime(frame.now)
|
||||
area := Rectangle.{0.0, cast(float32)frame.top, cast(float32)frame.width,
|
||||
cast(float32)(frame.height - frame.top - frame.bottom)}
|
||||
return App.Frame(frame.session, area) == 0
|
||||
// The portable entry and Apps may use different Kryon revisions.
|
||||
session := UiSession.Session.{.slot = frame.session.slot, .epoch = frame.session.epoch}
|
||||
return App.Frame(session, area) == 0
|
||||
}
|
||||
|
||||
WurmBack :: (message: Apps.AppMessage) -> bool {
|
||||
|
||||
@@ -26,7 +26,7 @@ Own :: #import, file "../src/own_levels.zi";
|
||||
using WidgetKind;
|
||||
|
||||
message: Apps.AppMessage;
|
||||
frame: Portable.AppUiFrame;
|
||||
frame: Apps.AppUiFrame;
|
||||
profile_opens: s32;
|
||||
balance_reads: s32;
|
||||
failures: s32;
|
||||
@@ -48,7 +48,7 @@ ReadAppHost :: () -> Apps.AppMessage { return message }
|
||||
#program_export
|
||||
WriteAppHost :: (value: Apps.AppMessage) { message = value }
|
||||
#program_export
|
||||
ReadAppUiHost :: () -> Portable.AppUiFrame { return frame }
|
||||
ReadAppUiHost :: () -> Apps.AppUiFrame { return frame }
|
||||
field_input: TextField.Input;
|
||||
// Scripted input reaches the real collection/search field widget.
|
||||
#program_export
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
"""The portable release contains the complete public exports and no private data."""
|
||||
import importlib.util
|
||||
import json
|
||||
import hashlib
|
||||
import sys
|
||||
from pathlib import Path
|
||||
import tarfile
|
||||
import tempfile
|
||||
@@ -31,10 +33,26 @@ class PortableExport(unittest.TestCase):
|
||||
for member in archive:
|
||||
self.assertTrue(member.isfile())
|
||||
self.assertEqual(archive.extractfile(member).read(), (exports / member.name).read_bytes())
|
||||
self.assertEqual((root / 'build/downloads/wurm.zx').read_bytes(),
|
||||
(exports / 'wurm.zx').read_bytes())
|
||||
(exports / 'wurm.zx').unlink()
|
||||
with self.assertRaisesRegex(ValueError, 'Missing portable export: wurm.zx'):
|
||||
portable.package_archive(root)
|
||||
|
||||
|
||||
def verify_built():
|
||||
version = json.loads((ROOT / 'version.json').read_text())['version']
|
||||
standalone = ROOT / 'build/downloads/wurm.zx'
|
||||
with standalone.open('rb') as stream:
|
||||
assert stream.read(4) == b'ZX\0\0', 'Standalone is not a ZX bundle'
|
||||
with tarfile.open(ROOT / f'build/downloads/wurm-portable-v{version}.tar.gz') as archive:
|
||||
with archive.extractfile('wurm.zx') as member, standalone.open('rb') as stream:
|
||||
assert hashlib.file_digest(member, 'sha256').digest() == hashlib.file_digest(stream, 'sha256').digest(), 'Standalone and archive differ'
|
||||
print('Local packaging test: standalone ZX matches the portable archive')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
if sys.argv[1:] == ['--built']:
|
||||
verify_built()
|
||||
else:
|
||||
unittest.main()
|
||||
@@ -32,6 +32,8 @@ def package_archive(root=ROOT):
|
||||
with tarfile.open(archive, 'w:gz') as output:
|
||||
for name in EXPORT_FILES:
|
||||
output.add(exports / name, arcname=name, recursive=False)
|
||||
# The standalone download and archive member must be the same build.
|
||||
shutil.copyfile(exports / "wurm.zx", archive.parent / "wurm.zx")
|
||||
return archive
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user