Skip to content

Commit

Permalink
ci: compress all the thing
Browse files Browse the repository at this point in the history
  • Loading branch information
xMikux committed Sep 20, 2024
1 parent 5b67855 commit 32882f7
Show file tree
Hide file tree
Showing 8 changed files with 100 additions and 30 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/Push-BetaRes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
needs: ia-packer
uses: ./.github/workflows/resuable_packer.yml

yml-item_models:
config-upload:
name: Upload Item Models
uses: ./.github/workflows/resuable_item-models.yml

Expand All @@ -51,7 +51,7 @@ jobs:
res-publish-modrinth:
name: Publish Modrinth Beta
needs: ia-cleaner
needs: [ config-upload, ia-cleaner ]
uses: ./.github/workflows/resuable_release_modrinth.yml
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
43 changes: 43 additions & 0 deletions .github/workflows/resuable_configs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Resuable | Configs Upload

on:
workflow_call: {}

jobs:
item-models-upload:
name: Upload item models file
runs-on: ubuntu-latest
steps:
-
name: Setup - Checkout Repository
uses: actions/checkout@v4
-
name: Compress - Item Models
run: |
zip -j9 item-models.zip Resourcepack/item-models.yml
-
name: Artifact - Upload Item Models
uses: actions/upload-artifact@v4
with:
name: config-item-models
path: item-models.zip

ia-config-upload:
name: Upload item models file
runs-on: ubuntu-latest
steps:
-
name: Setup - Checkout Repository
uses: actions/checkout@v4
-
name: Compress - IA Config
run: |
zip -r9 ia-addons.zip contents/
mv ia-addons.zip ../
working-directory: Resourcepack
-
name: Artifact - Upload Item Models
uses: actions/upload-artifact@v4
with:
name: config-ia
path: ia-addons.zip
2 changes: 1 addition & 1 deletion .github/workflows/resuable_ia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
name: Checkout Repository
name: Setup - Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
20 changes: 0 additions & 20 deletions .github/workflows/resuable_item-models.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/resuable_packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
-
name: Checkout Repository
name: Setup - Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
Expand Down
9 changes: 4 additions & 5 deletions .github/workflows/resuable_release_modrinth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,18 @@ jobs:
with:
path: workdir
merge-multiple: true

-
name: Name - Fix naming
run: |
mv workdir/pack.zip Slimefun-ResourcePack.zip
mv workdir/item-models.yml item-models.yml
mv workdir/*.zip .
ls -alh
-
name: DEBUG Git Version - Current Version
id: git_version
run: |
echo "version=git-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "git-${GITHUB_SHA::7}"
-
name: Modrinth - Relase Beta
uses: Kir-Antipov/[email protected]
Expand All @@ -46,7 +43,9 @@ jobs:
version: ${{ steps.git_version.outputs.version }}
version-type: beta
loaders: minecraft
game-versions: ">=1.19.4"
game-versions: ">=1.19"
files: |
Slimefun-ResourcePack.zip
item-models.zip
ia-addons.zip
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
48 changes: 48 additions & 0 deletions .github/workflows/resuable_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Resuable | Version Maker

on:
workflow_call: {}

jobs:
version_maker:
name: Make Version
runs-on: ubuntu-latest
steps:
-
name: Setup - Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Git Version - Current Version
id: git_version
run: |
echo "version=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
-
name: Setup - Decompress and Move
run: |
mkdir pack
cd workdir
unzip generated.zip
mv assets pack.mcmeta pack.png ../pack
-
name: Clean - Remove unnecessary files
run: |
rm -r assets/_iainternal
rm -r assets/minecraft/blockstates
rm -r assets/minecraft/font
rm -r assets/minecraft/lang
rm -r assets/minecraft/models/block
rm -r assets/minecraft/models/item/base
rm -r assets/minecraft/shaders
rm -r assets/minecraft/textures
working-directory: 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' ]
2 changes: 1 addition & 1 deletion Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"§dVerison §2Beta v1.0.12"
],
"supported_formats":{
"min_inclusive":13,
"min_inclusive":9,
"max_inclusive":34
}
},
Expand Down

0 comments on commit 32882f7

Please sign in to comment.