Skip to content

Commit

Permalink
test: add packer
Browse files Browse the repository at this point in the history
  • Loading branch information
xMikux committed Sep 16, 2024
1 parent 9f77a94 commit 1c3d233
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 7 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/Push-BetaRes.yml
Original file line number Diff line number Diff line change
@@ -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 }}
20 changes: 13 additions & 7 deletions .github/workflows/resuable_ia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ name: Makeup IA Resourcepack

on:
workflow_call:
inputs:
debug:
type: boolean
required: false
secrets:
RCON_PASSWORD:
required: true
Expand All @@ -16,15 +20,15 @@ jobs:
ia_resourcepack:
name: Generate IA Resourcepack
runs-on: ubuntu-latest

steps:
-
name: Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup - S3cmd Cli Tool
-
name: Setup - S3cmd Cli Tool
uses: s3-actions/[email protected]
with:
provider: "vultr"
Expand All @@ -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
Expand Down Expand Up @@ -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
53 changes: 53 additions & 0 deletions .github/workflows/resuable_packer.yml
Original file line number Diff line number Diff line change
@@ -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' ]

0 comments on commit 1c3d233

Please sign in to comment.