Skip to content

Generate tiles for Mineways #56

Generate tiles for Mineways

Generate tiles for Mineways #56

Workflow file for this run

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: ubuntu-latest
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: echo "::set-output name=cache-key::mineways-${{ env.MINEWAYS_VERSION }}"
- uses: actions/cache@v3
name: Get Mineways executables from cache
id: cache-mineways
with:
path: |
${{ env.TM_PATH }}\ChannelMixer.exe
${{ env.TM_PATH }}\TileMaker.exe
${{ env.TM_PATH }}\textures\water_normal.png
${{ env.TM_PATH }}\terrainBase.png
key: ${{ steps.cache-keys.outputs.cache-key }}
- name: Download and Cache Dependency
if: steps.cache-mineways.outputs.cache-hit != 'true'
run: |
curl -L ${{ env.MINEWAYS_URL }} -o mineways.zip
unzip -o mineways.zip -d ${{ env.TM_PATH }}
rm mineways.zip
tilemaker:
needs: download
strategy:
matrix:
size: [256, 128, 64]
runs-on: windows-latest
defaults:
run:
shell: powershell
steps:
- uses: actions/checkout@v3
name: Checkout repo
id: checkout
- name: Cache Dependency
uses: actions/cache@v3
with:
path: |
${{ env.TM_PATH }}\ChannelMixer.exe
${{ env.TM_PATH }}\TileMaker.exe
${{ env.TM_PATH }}\textures\water_normal.png
${{ env.TM_PATH }}\terrainBase.png
key: ${{ needs.download.outputs.cache-key }}
- name: Create required directories
id: setup-directories
shell: powershell
run: |
[System.IO.Directory]::CreateDirectory($env:TILE_PATH)
- name: Copy Mineways textures
id: mineways-textures
shell: powershell
run: |
Copy-Item -Path "${env:GITHUB_WORKSPACE}\mineways\textures\blocks" -Destination $env:PACK_PATH -Recurse -Force
- 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