Package and install the Crysknife release on Arrakis only
This commit is contained in:
parent
46e1234a65
commit
683b738672
2 changed files with 80 additions and 7 deletions
49
.forgejo/workflows/arrakis-crysknife.yml
Normal file
49
.forgejo/workflows/arrakis-crysknife.yml
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
name: Arrakis Crysknife Build
|
||||
on:
|
||||
workflow_dispatch:
|
||||
push:
|
||||
branches: ['feat/jarvis-crysknife-*']
|
||||
|
||||
jobs:
|
||||
crysknife:
|
||||
runs-on: dune-ci
|
||||
steps:
|
||||
- name: Check out exact revision
|
||||
shell: bash
|
||||
env:
|
||||
REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git init .
|
||||
git -c http.extraheader="AUTHORIZATION: basic $(printf 'x-access-token:%s' "$REPO_TOKEN" | base64 -w0)" fetch --depth=1 https://www.dunerealms.com/git/unimatrix/plugins.git "$GITHUB_SHA"
|
||||
git checkout --detach FETCH_HEAD
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '21'
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
gradle-version: '9.2.1'
|
||||
- name: Package the Arrakis J.A.R.V.I.S., Terrain and resource pack release
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
gradle --no-daemon -p JarvisConnector test jar
|
||||
gradle --no-daemon -p DuneTerrain test jar
|
||||
python3 tools/plugin_pillager_abi.py JarvisConnector/build/libs/jarvistranslator.jar
|
||||
python3 tools/verify-arrakis-terrain.py DuneTerrain/build/libs/DuneRealms-Terrain.jar DuneTerrain/src/test/resources/retained-arrakis-terrain.json
|
||||
python3 tools/test_plugin_fleet_install.py -v
|
||||
python3 tools/test_plugin_pack_properties.py -v
|
||||
mkdir crysknife-artifacts
|
||||
cp JarvisConnector/build/libs/jarvistranslator.jar DuneTerrain/build/libs/DuneRealms-Terrain.jar crysknife-artifacts/
|
||||
printf '%s\n' "$(git rev-parse HEAD)" > crysknife-artifacts/SOURCE_COMMIT
|
||||
python3 tools/build-unified-resourcepack.py --source "$GITHUB_SHA" --output "crysknife-artifacts/DuneRealms-Resources-${GITHUB_SHA}.zip"
|
||||
python3 tools/write-plugin-manifest.py crysknife-artifacts "$GITHUB_SHA"
|
||||
cp tools/install-plugin-fleet.py tools/plugin_menu_pack.py tools/plugin_backend_abi.py tools/plugin_pillager_abi.py tools/plugin_fleet_rollback.py tools/plugin_pack_properties.py tools/publish-plugin-menu.py crysknife-artifacts/
|
||||
cp JarvisConnector/src/test/resources/retained-jarvis-public-abi.json JarvisConnector/src/test/resources/medieval-factions-11.1-raid-api.json JarvisConnector/src/test/resources/worldguard-raid-api.json DuneTerrain/src/test/resources/retained-arrakis-terrain.json crysknife-artifacts/
|
||||
(cd crysknife-artifacts && sha256sum -- *.jar *.zip *.json *.py SOURCE_COMMIT > SHA256SUMS)
|
||||
- uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: DuneRealms-Arrakis-Crysknife
|
||||
path: crysknife-artifacts/
|
||||
if-no-files-found: error
|
||||
|
|
@ -52,9 +52,10 @@ def identity(path):
|
|||
|
||||
def plan(artifacts, inventory, expected_source):
|
||||
mode=inventory.get('mode')
|
||||
if mode not in {'gui-preserve-backends','pillager-preserve-economy'}:
|
||||
raise ValueError("An explicit gui-preserve-backends or pillager-preserve-economy mode is required")
|
||||
if mode not in {'gui-preserve-backends','pillager-preserve-economy','arrakis-crysknife'}:
|
||||
raise ValueError('An explicit supported rollout mode is required')
|
||||
pillager=mode=='pillager-preserve-economy'
|
||||
crysknife=mode=='arrakis-crysknife'
|
||||
artifacts = Path(artifacts).resolve(strict=True)
|
||||
manifest = json.loads((artifacts / 'release-manifest.json').read_text())
|
||||
if not re.fullmatch(r'[0-9a-f]{40}', expected_source) or manifest.get('sourceCommit') != expected_source:
|
||||
|
|
@ -92,8 +93,8 @@ def plan(artifacts, inventory, expected_source):
|
|||
if inventory.get('menuPack') is not None:
|
||||
_, menu = load_menu(artifacts, expected_source)
|
||||
verify_public_menu(inventory['menuPack']['url'], menu)
|
||||
if pillager and not(menu and menu.get('unified')):
|
||||
raise ValueError('Pillager rollout requires its verified unified item/skin pack')
|
||||
if (pillager or crysknife) and not(menu and menu.get('unified')):
|
||||
raise ValueError('This rollout requires its verified unified item/skin pack')
|
||||
servers, ids, roots, units = [], set(), set(), set()
|
||||
for server in inventory['servers']:
|
||||
sid, unit = server['id'], server['serviceUnit']
|
||||
|
|
@ -116,11 +117,17 @@ def plan(artifacts, inventory, expected_source):
|
|||
raise ValueError('Server private prerequisites must be explicitly provided and reviewed')
|
||||
chosen = [files[name] for name in selected] + [prerequisites[key] for key in selected_prerequisites]
|
||||
wanted = {entry['name'].casefold() for entry in chosen}
|
||||
uses_menu='dunemenus' in wanted or bool(menu and menu.get('unified'))
|
||||
if menu and menu.get('unified') and 'dunerealmsgui' not in wanted:
|
||||
uses_menu='dunemenus' in wanted or bool(menu and menu.get('unified') and not crysknife)
|
||||
if menu and menu.get('unified') and not crysknife and 'dunerealmsgui' not in wanted:
|
||||
raise ValueError('Unified pack rollout must select its matching DunerealmsGUI adapter')
|
||||
if not pillager and wanted - {'dunemenus','dunerealmsgui','dunenpc','dunelobby','mcgui'}:
|
||||
if not (pillager or crysknife) and wanted - {'dunemenus','dunerealmsgui','dunenpc','dunelobby','mcgui'}:
|
||||
raise ValueError('GUI rollout must retain working Ess/JARVIS/Core/Terrain binaries')
|
||||
if crysknife and (
|
||||
sid != 'arrakis' or unit != 'dune-arrakis.service'
|
||||
or root != Path('/opt/dunerealms/servers/arrakis')
|
||||
or wanted != {'jarvistranslator','duneterrain'} or selected_prerequisites
|
||||
):
|
||||
raise ValueError('Crysknife rollout is restricted to the Arrakis JARVIS and Terrain pair')
|
||||
if pillager:
|
||||
if sid not in {'lobby','arrakis','caladan','giedi_prime','kaitain','sigma_draconis_iv'}:
|
||||
raise ValueError('Pillager rollout requires a reviewed backend identity')
|
||||
|
|
@ -198,6 +205,23 @@ def plan(artifacts, inventory, expected_source):
|
|||
for path in plugins.glob('*.jar'):
|
||||
if path.name not in {p['filename'] for p in previous} and path.name not in retained_names:
|
||||
retained.append({'filename':path.name,'sha256':digest(path),'metadata':metadata(path)})
|
||||
if crysknife:
|
||||
incoming = {entry['name'].casefold(): entry for entry in chosen}
|
||||
pins = {'jarvistranslator': '663c28c5fb246b3d5c14b2faeaf0b6c000e38a53b3d45459221e4d3b85f242c3',
|
||||
'duneterrain': REVIEWED_TERRAIN_SHA256}
|
||||
for name, prior_pin in pins.items():
|
||||
installed = existing_paths.get(name)
|
||||
if installed is None or digest(installed) not in {prior_pin, incoming[name]['sha256']}:
|
||||
raise ValueError('Crysknife rollout runtime differs from the reviewed pin: ' + name)
|
||||
vendor, worldguard = (existing_paths.get(name) for name in ('medievalfactions', 'worldguard'))
|
||||
if vendor is None or worldguard is None:
|
||||
raise ValueError('Crysknife rollout requires the existing vendor runtimes')
|
||||
abi_result = verify_pillager_abi(incoming['jarvistranslator']['source'], vendor, artifacts, worldguard)
|
||||
abi_result['terrain'] = verify_pillager_terrain(incoming['duneterrain']['source'],
|
||||
json.loads((artifacts/'retained-arrakis-terrain.json').read_text()))
|
||||
replaced = {entry['filename'] for entry in previous}
|
||||
retained = [{'filename': path.name, 'sha256': digest(path), 'metadata': metadata(path)}
|
||||
for path in sorted(plugins.glob('*.jar')) if path.name not in replaced]
|
||||
configurations = []
|
||||
if uses_menu:
|
||||
if menu is None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff