Skip to content

hud part 2

hud part 2 #135

Workflow file for this run

name: Optimize resource pack
on: [push]
jobs:
packsquash:
name: Optimize resource pack
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
fetch-depth: 0 # A non-shallow repository clone is required
- name: Set short git commit SHA
id: vars
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$calculatedSha" >> $GITHUB_ENV
- name: Run PackSquash
uses: ComunidadAylas/PackSquash-action@v4
with:
# When changing the options passed to PackSquash, it may be a good idea to lock
# your workflow to a specific PackSquash version instead of "latest". This will
# prevent sudden failures when releases that introduce incompatible changes to
# the options file format are made, but will require you to manually update
# the PackSquash version your workflows use when a release occurs
packsquash_version: latest
options: |
pack_directory = 'core'
recompress_compressed_files = true
zip_compression_iterations = 30
zip_spec_conformance_level = 'balanced'
skip_pack_icon = false
output_file_path = 'core.zip'
['**/*?.png']
image_data_compression_iterations = 15
['**/{LICENSE,README.txt}']
force_include = true
- name: ZIP Hud
run: cd hud && zip -r ../hud.zip . && cd ..
- name: ZIP Soundscapes
run: cd soundscapes && zip -r ../soundscapes.zip . && cd ..
- uses: actions/upload-artifact@v4
with:
name: packs
path: |
core.zip
hud.zip
soundscapes.zip
- name: Hash files
run: |
calculatedCoreSha=($(sha1sum core.zip))
echo "CORE_SHA=$calculatedCoreSha" >> $GITHUB_ENV
calculatedHudSha=($(sha1sum hud.zip))
echo "HUD_SHA=$calculatedHudSha" >> $GITHUB_ENV
calculatedSoundscapesSha=($(sha1sum soundscapes.zip))
echo "SOUNDSCAPES_SHA=$calculatedHudSha" >> $GITHUB_ENV
- name: Upload core to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: core.zip
asset_name: core.zip
tag: refs/tags/latest
overwrite: true
- name: Upload hud to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: hud.zip
asset_name: hud.zip
tag: refs/tags/latest
overwrite: true
- name: Upload soundscapes to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: soundscapes.zip
asset_name: soundscapes.zip
tag: refs/tags/latest
overwrite: true
body: "core: ${{ env.CORE_SHA }} \nhud: ${{ env.HUD_SHA }} \nsoundscapes: ${{ env.SOUNDSCAPES_SHA }}"