Release Workflow with pack squash #14
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
# build: | |
# permissions: write-all | |
# runs-on: ubuntu-latest | |
# | |
# steps: | |
# # Checks-out the repository on master branch | |
# - uses: actions/checkout@master | |
# | |
# - 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 | |
# | |
# # Create a zip | |
# - name: Compress the pack as zip | |
# uses: TheDoctor0/[email protected] | |
# with: | |
# type: 'zip' | |
# filename: "${{env.RELEASE_NAME}}.zip" | |
# exclusions: '*.git*' | |
# | |
# # Create a new release | |
# - name: Create Release | |
# uses: ncipollo/[email protected] | |
# with: | |
# name: ${{env.RELEASE_NAME}} | |
# tag: ${{env.tag}} | |
# artifacts: "${{env.RELEASE_NAME}}.zip" | |
# token: ${{ secrets.GITHUB_TOKEN }} | |
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: action-v${{ github.run_number }} | |
files: /tmp/${{env.RELEASE_NAME}}.zip |