From bb7a1323a70298760681639b79e7464965d8e540 Mon Sep 17 00:00:00 2001 From: Scott Killen <scott@scottkillen.com> Date: Sat, 11 Jun 2022 23:48:11 -0400 Subject: [PATCH] Add github action to upload pack upon release --- .github/workflows/packsquash.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/packsquash.yml diff --git a/.github/workflows/packsquash.yml b/.github/workflows/packsquash.yml new file mode 100644 index 0000000..8d5248f --- /dev/null +++ b/.github/workflows/packsquash.yml @@ -0,0 +1,31 @@ +name: Optimize resource pack +on: + release: + types: [published] +jobs: + packsquash: + name: Optimize resource pack + runs-on: ubuntu-latest + steps: + - 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@v3 + with: + path: source + - name: Download optimized pack + uses: actions/download-artifact@v3 + with: + name: Optimized pack + - name: Upload Release Asset + id: upload-release-asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./pack.zip + asset_name: ${{ github.event.repository.name }}-1.16.X-${{ github.event.release.tag_name }}.zip + asset_content_type: application/zip