diff --git a/.github/workflows/Push-BetaRes.yml b/.github/workflows/Push-BetaRes.yml index 1ec23ae1..4084d913 100644 --- a/.github/workflows/Push-BetaRes.yml +++ b/.github/workflows/Push-BetaRes.yml @@ -1,15 +1,34 @@ name: Push Beta Resourcepack on: + workflow_dispatch: + inputs: + debug: + description: 'Enable Debug log generate' + required: false + default: false + type: boolean push: branches: - "ci/new_packer" jobs: iapacker: + name: IA Packer uses: ./.github/workflows/resuable_ia.yml + if: | + github.repository == 'xMikux/Slimefun-Resourcepack' + with: + DEBUG: ${{ inputs.debug }} secrets: RCON_PASSWORD: ${{ secrets.RCON_PASSWORD }} S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }} S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }} + + makeres: + name: Slimefun Packer + needs: iapacker + uses: ./.github/workflows/resuable_packer.yml + with: + DEBUG: ${{ inputs.debug }} \ No newline at end of file diff --git a/.github/workflows/resuable_ia.yml b/.github/workflows/resuable_ia.yml index 99a5b822..21ab7421 100644 --- a/.github/workflows/resuable_ia.yml +++ b/.github/workflows/resuable_ia.yml @@ -2,6 +2,10 @@ name: Makeup IA Resourcepack on: workflow_call: + inputs: + debug: + type: boolean + required: false secrets: RCON_PASSWORD: required: true @@ -16,7 +20,6 @@ jobs: ia_resourcepack: name: Generate IA Resourcepack runs-on: ubuntu-latest - steps: - name: Checkout Repository @@ -24,7 +27,8 @@ jobs: with: fetch-depth: 0 - - name: Setup - S3cmd Cli Tool + - + name: Setup - S3cmd Cli Tool uses: s3-actions/s3cmd@v1.7.0 with: provider: "vultr" @@ -42,8 +46,8 @@ jobs: rm LICENSE mcrcon.tar.gz working-directory: .github - - - name: S3 - Download Plugins + - + name: S3 - Download Plugins run: | mkdir external s3cmd get s3://${{ secrets.S3_BUCKET_NAME }}/ItemsAdder.jar external/ItemsAdder.jar @@ -73,21 +77,23 @@ jobs: env: MCRCON_PASS: ${{ secrets.RCON_PASSWORD }} - - + - name: DEBUG - Get compose log + if: ${{ inputs.debug == true }} run: | docker compose -f .github/compose/docker-compose.yml logs > .github/compose.log - name: DEBUG - Upload compose log + if: ${{ inputs.debug == true }} uses: actions/upload-artifact@v4 with: name: compose-log path: .github/compose.log - - name: DEBUG - Upload generated pack + name: Artifact - Upload generated pack uses: actions/upload-artifact@v4 with: name: ia_generatedpack - path: output/*.zip + path: output/generated.zip diff --git a/.github/workflows/resuable_packer.yml b/.github/workflows/resuable_packer.yml new file mode 100644 index 00000000..2095725d --- /dev/null +++ b/.github/workflows/resuable_packer.yml @@ -0,0 +1,53 @@ +name: Make Slimefun Resourcepack + +on: + workflow_call: + inputs: + debug: + type: boolean + required: false + +jobs: + sf_resourcepack: + name: Generate Slimefun Resourcepack + runs-on: ubuntu-latest + steps: + - + name: Checkout Repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - + name: Artifact - Download Pre Generate Pack + uses: actions/download-artifact@v4 + with: + name: ia_generatedpack + path: workdir + + - + name: Setup - Decompress and Move + run: | + mkdir pack + cd workdir + unzip generated.zip + mv generated/* ../pack + ls -alh ../pack + + - + name: Setup - Decompress and Move + run: | + mkdir pack + cd workdir + unzip generated.zip + mv generated/* ../pack + + - + name: PackSquash - Optimize It! + uses: ComunidadAylas/PackSquash-action@v4 + with: + packsquash_version: latest-unstable + artifact_name: Slimefun-ResourcePack + options: | + pack_directory = 'pack' + allow_mods = [ 'OptiFine' ]