Skip to content

Commit

Permalink
ci(Release): Beta workflow (#45)
Browse files Browse the repository at this point in the history
* ci: duplicate name

* ci: small update release naming

* ci: update beta release workflow

* ci: fix wrong running

* fix: new line on pack description
  • Loading branch information
xMikux authored Sep 23, 2024
1 parent 2e8d8dc commit 8325c8e
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 72 deletions.
46 changes: 23 additions & 23 deletions .github/workflows/release_beta.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Push Beta Resourcepack
name: Release | Beta Pack

on:
workflow_dispatch:
inputs:
debug:
description: 'Enable Debug log generate'
description: "Generate debug log"
required: false
default: false
type: boolean
Expand All @@ -15,13 +15,27 @@ on:
- Resourcepack/**

jobs:
version-gen:
name: Version Generator
uses: ./.github/workflows/resuable_version.yml
if: |
github.repository == 'xMikux/Slimefun-Resourcepack'
with:
release_type: "beta"

config-upload:
name: Upload Item Models
uses: ./.github/workflows/resuable_configs.yml
if: |
github.repository == 'xMikux/Slimefun-Resourcepack'
ia-packer:
name: IA Packer
needs: [ version-gen ]
uses: ./.github/workflows/resuable_ia.yml
if: |
github.repository == 'xMikux/Slimefun-Resourcepack'
with:
DEBUG: ${{ inputs.debug || false }}
debug: ${{ inputs.debug || false }}
pack_format_version_str: ${{ needs.version-gen.outputs.pack_version_name }}
secrets:
RCON_PASSWORD: ${{ secrets.RCON_PASSWORD }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
Expand All @@ -30,28 +44,14 @@ jobs:

res-packer:
name: Slimefun Packer
needs: ia-packer
needs: [ ia-packer ]
uses: ./.github/workflows/resuable_packer.yml

config-upload:
name: Upload Item Models
uses: ./.github/workflows/resuable_configs.yml

ia-cleaner:
name: Cleanup Artifact
needs: res-packer
runs-on: ubuntu-latest
steps:
-
name: Artifact - Delete It!
uses: geekyeggo/delete-artifact@v5
with:
name: |
ia-generatedpack
res-publish-modrinth:
name: Publish Modrinth Beta
needs: [ config-upload, ia-cleaner ]
needs: [ version-gen, config-upload, res-packer ]
uses: ./.github/workflows/resuable_release_modrinth.yml
with:
version: ${{ needs.version-gen.outputs.version_name }}
secrets:
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/resuable_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Resuable | ChangeLog Generator

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

2 changes: 1 addition & 1 deletion .github/workflows/resuable_configs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
path: item-models.zip

ia-config-upload:
name: Upload item models file
name: Upload ia config file
runs-on: ubuntu-latest
steps:
-
Expand Down
11 changes: 7 additions & 4 deletions .github/workflows/resuable_ia.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
debug:
type: boolean
required: false
pack_format_version_str:
type: string
required: true
secrets:
RCON_PASSWORD:
required: true
Expand All @@ -26,7 +29,6 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

-
name: Setup - S3cmd Cli Tool
uses: s3-actions/[email protected]
Expand All @@ -35,7 +37,6 @@ jobs:
region: "sgp1"
access_key: ${{ secrets.S3_ACCESS_KEY }}
secret_key: ${{ secrets.S3_SECRET_KEY }}

-
name: Setup - mcrcon
run: |
Expand All @@ -45,13 +46,15 @@ jobs:
tar xzvf mcrcon.tar.gz
rm LICENSE mcrcon.tar.gz
working-directory: .github

-
name: S3 - Download Plugins
run: |
mkdir external
s3cmd get s3://${{ secrets.S3_BUCKET_NAME }}/ItemsAdder.jar external/ItemsAdder.jar
-
name: Setup - Version Replace
run: |
sed -i 's/${VERSION_PLACEHOLDER}/${{ inputs.pack_format_version_str }}/' Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta
-
name: Setup - IA Minecraft Server
run: |
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/resuable_packer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,19 @@ jobs:
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 assets pack.mcmeta pack.png ../pack
-
name: Clean - Remove unnecessary files
run: |
Expand All @@ -41,7 +38,6 @@ jobs:
rm -r assets/minecraft/shaders
rm -r assets/minecraft/textures
working-directory: pack

-
name: PackSquash - Optimize It!
uses: ComunidadAylas/PackSquash-action@v4
Expand All @@ -51,3 +47,9 @@ jobs:
options: |
pack_directory = 'pack'
allow_mods = [ 'OptiFine' ]
-
name: Artifact - Clean IA Generate Pack
uses: geekyeggo/delete-artifact@v5
with:
name: |
ia-generatedpack
11 changes: 4 additions & 7 deletions .github/workflows/resuable_release_modrinth.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ on:
type: string
required: false
default: "beta"
version:
type: string
required: true
secrets:
MODRINTH_TOKEN:
required: true
Expand All @@ -28,19 +31,13 @@ jobs:
mv workdir/pack.zip Slimefun-ResourcePack.zip
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]
with:
modrinth-id: TznkVJky
modrinth-featured: false
version: ${{ steps.git_version.outputs.version }}
version: ${{ inputs.version }}
version-type: beta
loaders: minecraft
game-versions: ">=1.19"
Expand Down
56 changes: 25 additions & 31 deletions .github/workflows/resuable_version.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,42 @@
name: Resuable | Version Maker

on:
workflow_call: {}
workflow_call:
inputs:
release_type:
type: string
required: false
default: "beta"
outputs:
version_name:
description: "The version name (ex: git-abcdef or v1.0.0 )"
value: ${{ jobs.version_maker.outputs.version_name }}
pack_version_name:
description: "The pack format will use name (ex: Beta git-abcdef or Release v1.0.0)"
value: ${{ jobs.version_maker.outputs.pack_version_name }}

jobs:
version_maker:
name: Make Version
runs-on: ubuntu-latest
outputs:
version_name: ${{ steps.git_version.outputs.short_sha }}
pack_version_name: ${{ steps.pack_version_name.outputs.version_name }}
steps:
-
name: Setup - Checkout Repository
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Git Version - Current Version
name: Version - Get Current Version
id: git_version
run: |
echo "version=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
echo "short_sha=git-${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
-
name: Setup - Decompress and Move
name: Pack Format - Version Name
id: pack_version_name
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' ]
if [ "${{ inputs.release_type }}" == "beta" ]; then
echo "version_name=§dBeta §f${{ steps.git_version.outputs.short_sha }}" >> "$GITHUB_OUTPUT"
elif [ "${{ inputs.release_type }}" == "release" ]; then
echo "version_name=§bRelease §fvABC?" >> "$GITHUB_OUTPUT"
fi
4 changes: 2 additions & 2 deletions Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
"pack":{
"pack_format":34,
"description":[
"§bSlimefun §aResourcepack §eRemake",
"§dVerison §2Beta v1.0.12"
"§2Slimefun §9Resourcepack §6Remake",
"\n${VERSION_PLACEHOLDER}"
],
"supported_formats":{
"min_inclusive":9,
Expand Down

0 comments on commit 8325c8e

Please sign in to comment.