Skip to content

Release Workflow with pack squash #18

Release Workflow with pack squash

Release Workflow with pack squash #18

name: Release Workflow with pack squash
# Controls when the workflow will run
on:
# # Triggers the workflow on push or pull request events but only for the "master" branch
# push:
# branches: [ "master" ]
# pull_request:
# branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
packsquash:
name: Optimize resource pack
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Get current date
id: date
run: echo "date=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Get current date
id: tag
run: echo "tag=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
- name: Set release name
run: echo "RELEASE_NAME=HBCubemonde_${{env.date}}" >> $GITHUB_ENV
- name: Clone repository
uses: actions/checkout@v3
with:
fetch-depth: 0 # A non-shallow repository clone is required
- name: Run PackSquash
uses: ComunidadAylas/PackSquash-action@v4
with:
packsquash_version: latest
options: |
# Optimize the pack in the root repository directory.
# This is the default value for pack_directory when no PackSquash options are defined
pack_directory = '.'
# Set a custom output file path to work with the generated ZIP file
# without needing to download its artifact in a separate step
output_file_path = "/tmp/${{env.RELEASE_NAME}}.zip"
allow_mods = ['OptiFine']
# Temporary removing .properties processing because of accentued character encoding
['**/?*.properties']
minify_properties = false
- name: Tag and create release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{env.date}}
name: ${{env.RELEASE_NAME}}
files: /tmp/${{env.RELEASE_NAME}}.zip