-
-
Notifications
You must be signed in to change notification settings - Fork 5
90 lines (89 loc) · 3.27 KB
/
mineways.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Mineways
run-name: Generate tiles for Mineways
on:
workflow_dispatch:
env:
TERRAIN_NAME: JG-RTX
MINEWAYS_URL: https://erich.realtimerendering.com/minecraft/public/mineways/mineways.zip
MINEWAYS_VERSION: 11.04
# Path to Mineways executables
TM_PATH: bin\mineways\TileMaker
# Path to input resource pack
PACK_PATH: bedrock\pack\RP
# Path to ChannelMixer output / TileMaker input
TILE_PATH: dist\mineways\blocks
jobs:
download:
name: Download Mineways
runs-on: windows-latest
defaults:
run:
shell: powershell
outputs:
cache-key: ${{ steps.cache-keys.outputs.cache-key }}
steps:
- uses: actions/checkout@v3
name: Checkout repo
id: checkout
- name: Generate Cache Key
id: cache-keys
run: Write-Host "::set-output name=cache-key::mineways-${{ env.MINEWAYS_VERSION }}"
- uses: actions/cache@v3
name: Get Mineways executables from cache
id: cache-mineways
with:
path: mineways.zip
key: ${{ steps.cache-keys.outputs.cache-key }}
- name: Download and Cache Dependency
if: steps.cache-mineways.outputs.cache-hit != 'true'
run: |
Invoke-WebRequest -Uri $env:MINEWAYS_URL -OutFile mineways.zip
- name: Create required directories
id: setup-directories
shell: powershell
run: |
$paths = @($env:TM_PATH, $env:PACK_PATH, $env:TILE_PATH, "${env:GITHUB_WORKSPACE}\dist\mineways", "${env:GITHUB_WORKSPACE}\dist\mineways\blocks")
foreach($path in $paths) {
$createdPath = [System.IO.Directory]::CreateDirectory($path)
if(-not (Test-Path -Path $createdPath)) {
Write-Output "::error::Failed to create directory $path"
exit 1
}
}
- name: Extract Mineways
id: extract-mineways
shell: powershell
run: |
Expand-Archive -Path mineways.zip -DestinationPath mineways -Force
Copy-Item -Path "${env:GITHUB_WORKSPACE}\mineways\*.exe","${env:GITHUB_WORKSPACE}\mineways\terrainBase.png" -Destination $env:TM_PATH -Force
Copy-Item -Path "${env:GITHUB_WORKSPACE}\mineways\textures\blocks" -Destination $env:PACK_PATH -Recurse -Force
tilemaker:
needs: download
strategy:
matrix:
size: [256, 128, 64]
runs-on: windows-latest
defaults:
run:
shell: powershell
steps:
- name: ChannelMixer
id: channelmixer
run: |
Write-Output "::group::ChannelMixer Log"
& "${env:TM_PATH}\ChannelMixer.exe" -v -m -i $env:PACK_PATH -o $env:TILE_PATH
Write-Output "::endgroup::"
- name: TileMaker @ ${{ matrix.size }}
id: tilemaker
run: |
$size = ${{ matrix.size }};
Write-Output "::group::TileMaker Log ($size)"
& "${env:TM_PATH}\TileMaker.exe" -v -m -i "${env:TM_PATH}\terrainBase.png" -d $env:TILE_PATH -o "${env:GITHUB_WORKSPACE}\dist\mineways\terrainExt_${env:TERRAIN_NAME}$size.png" -t $size
Write-Output "::endgroup::"
- name: Upload terrain texture
id: upload-terrain
if: ${{ success() }}
uses: actions/upload-artifact@v3
with:
name: terrainExt_${{ env.TERRAIN_NAME }}
path: dist/mineways/*.png