forked from unimatrix/web
Build the central pack from pinned production common artwork
This commit is contained in:
parent
f0af8b375f
commit
7f19cc85ce
2 changed files with 25 additions and 4 deletions
|
|
@ -88,18 +88,21 @@ jobs:
|
|||
run: |
|
||||
set -euo pipefail
|
||||
node --test tools/build-planet-texture-packs.test.mjs
|
||||
curl --fail --location --retry 2 https://www.dunerealms.com/downloads/DuneRealms-Network-Artwork-v3.zip -o central-pack-baseline.zip
|
||||
curl --fail --location --retry 2 https://www.dunerealms.com/downloads/DuneRealms-Network-Artwork-v6.zip -o central-pack-baseline.zip
|
||||
python3 - <<'PYTHON'
|
||||
import pathlib
|
||||
import runpy
|
||||
repair = runpy.run_path('tools/build-resourcepack-repair.py')
|
||||
entries = repair['read_pack'](pathlib.Path('central-pack-baseline.zip'), repair['OLD_NETWORK'])
|
||||
for name, data in repair['world_artwork'](entries).items():
|
||||
entries = repair['read_pack'](
|
||||
pathlib.Path('central-pack-baseline.zip'),
|
||||
'ed2533646ee5e19a1dbfeec66e5791d1011a5107e6fcc4153372e431dfc5f56a',
|
||||
)
|
||||
for name, data in entries.items():
|
||||
target = pathlib.Path('central-pack-base') / name
|
||||
target.parent.mkdir(parents=True, exist_ok=True)
|
||||
target.write_bytes(data)
|
||||
PYTHON
|
||||
node tools/build-central-resource-pack.mjs central-pack-base central-pack-output 1
|
||||
node tools/build-central-resource-pack.mjs central-pack-base central-pack-output 2
|
||||
printf '%s\n' "$GITHUB_SHA" > central-pack-output/SOURCE_COMMIT
|
||||
(cd central-pack-output && sha256sum -- *.zip central-pack-manifest.json SOURCE_COMMIT > SHA256SUMS)
|
||||
- uses: actions/upload-artifact@v3
|
||||
|
|
|
|||
|
|
@ -96,3 +96,21 @@ test('central generation refuses to overwrite a different item definition or mod
|
|||
error=>error.message==='Conflicting pack entry: '+file);
|
||||
}
|
||||
});
|
||||
|
||||
test('the central builder preserves compatible common runtime assets and leaves native overlays outside the base',()=>{
|
||||
const inherited=[
|
||||
'pack.mcmeta',
|
||||
'assets/dunerealms/items/ecology/water_of_life.json',
|
||||
'assets/dunerealms/models/item/ecology/jerboa_egg.json',
|
||||
'assets/dunerealms/textures/entity/npc/chani.png',
|
||||
'assets/dunerealms/particles/fixture.json',
|
||||
'assets/dunerealms/sounds.json',
|
||||
'assets/dunerealms/sounds/fixture.ogg'
|
||||
];
|
||||
const base=new Map(inherited.map(name=>[name,Buffer.from(name==='pack.mcmeta'
|
||||
?JSON.stringify({pack:{pack_format:64}}):name)]));
|
||||
const entries=centralPackEntries(base);
|
||||
for(const name of inherited)assert.deepEqual(entries.get(name),base.get(name),name);
|
||||
assert(!entries.has('assets/minecraft/textures/block/stone.png'));
|
||||
assert(entries.has('assets/dunerealms/textures/planets/arrakis/block/stone.png'));
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue

Staff