Skip to content

Commit

Permalink
ci: Refactor Mineways workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonjgardner committed Nov 23, 2023
1 parent 8fdeaeb commit aa633dd
Showing 1 changed file with 21 additions and 27 deletions.
48 changes: 21 additions & 27 deletions .github/workflows/mineways.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ env:
jobs:
download:
name: Download Mineways
runs-on: windows-latest
runs-on: ubuntu-latest
outputs:
cache-key: ${{ steps.cache-keys.outputs.cache-key }}
steps:
- uses: actions/checkout@v3
name: Checkout repo
Expand All @@ -25,6 +27,9 @@ jobs:
shell: powershell
run: |
[System.IO.Directory]::CreateDirectory($env:TM_PATH)
- name: Generate Cache Key
id: cache-keys
run: echo "::set-output name=cache-key::mineways-${{ hashFiles('mineways/**') }}"
- uses: actions/cache@v3
name: Get Mineways executables from cache
id: cache-mineways
Expand All @@ -34,15 +39,13 @@ jobs:
${{ env.TM_PATH }}\TileMaker.exe
${{ env.TM_PATH }}\textures\water_normal.png
${{ env.TM_PATH }}\terrainBase.png
key: mineways-tilemaker
restore-keys: mineways-
- name: Download Mineways executables
id: download-mineways
key: ${{ steps.cache-keys.outputs.cache-key }}
- name: Download and Cache Dependency
if: steps.cache-mineways.outputs.cache-hit != 'true'
shell: powershell
run: |
Invoke-WebRequest -Uri $env:MINEWAYS_URL -OutFile mineways.zip
Expand-Archive -Path mineways.zip -DestinationPath $env:TM_PATH -Force
curl -L ${{ env.MINEWAYS_URL }} -o mineways.zip
unzip -o mineways.zip -d ${{ env.TM_PATH }}
rm mineways.zip
tilemaker:
needs: download
strategy:
Expand All @@ -56,6 +59,15 @@ jobs:
- 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
Expand All @@ -65,25 +77,7 @@ jobs:
id: mineways-textures
shell: powershell
run: |
Copy-Item -Path "${env:GITHUB_WORKSPACE}\mineways\textures\blocks" -Destination $env:PACK_PATH -Recurse
- 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: mineways-tilemaker
restore-keys: mineways-
- name: Download Mineways executables
id: download-mineways
if: steps.cache-mineways.outputs.cache-hit != 'true'
shell: powershell
run: |
Invoke-WebRequest -Uri $env:MINEWAYS_URL -OutFile mineways.zip
Expand-Archive -Path mineways.zip -DestinationPath $env:TM_PATH -Force
Copy-Item -Path "${env:GITHUB_WORKSPACE}\mineways\textures\blocks" -Destination $env:PACK_PATH -Recurse -Force
- name: ChannelMixer
id: channelmixer
run: |
Expand Down

0 comments on commit aa633dd

Please sign in to comment.