diff --git a/.github/workflows/release_beta.yml b/.github/workflows/release_beta.yml index d9a250a9..2c59db5c 100644 --- a/.github/workflows/release_beta.yml +++ b/.github/workflows/release_beta.yml @@ -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 @@ -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 }} @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/resuable_changelog.yml b/.github/workflows/resuable_changelog.yml new file mode 100644 index 00000000..e4290520 --- /dev/null +++ b/.github/workflows/resuable_changelog.yml @@ -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 + \ No newline at end of file diff --git a/.github/workflows/resuable_configs.yml b/.github/workflows/resuable_configs.yml index d224dce2..3920a9e1 100644 --- a/.github/workflows/resuable_configs.yml +++ b/.github/workflows/resuable_configs.yml @@ -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: - diff --git a/.github/workflows/resuable_ia.yml b/.github/workflows/resuable_ia.yml index 600e4d7e..7697e855 100644 --- a/.github/workflows/resuable_ia.yml +++ b/.github/workflows/resuable_ia.yml @@ -6,6 +6,9 @@ on: debug: type: boolean required: false + pack_format_version_str: + type: string + required: true secrets: RCON_PASSWORD: required: true @@ -26,7 +29,6 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 - - name: Setup - S3cmd Cli Tool uses: s3-actions/s3cmd@v1.7.0 @@ -35,7 +37,6 @@ jobs: region: "sgp1" access_key: ${{ secrets.S3_ACCESS_KEY }} secret_key: ${{ secrets.S3_SECRET_KEY }} - - name: Setup - mcrcon run: | @@ -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: | diff --git a/.github/workflows/resuable_packer.yml b/.github/workflows/resuable_packer.yml index ef74f174..b221051e 100644 --- a/.github/workflows/resuable_packer.yml +++ b/.github/workflows/resuable_packer.yml @@ -13,14 +13,12 @@ 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: | @@ -28,7 +26,6 @@ jobs: cd workdir unzip generated.zip mv assets pack.mcmeta pack.png ../pack - - name: Clean - Remove unnecessary files run: | @@ -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 @@ -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 diff --git a/.github/workflows/resuable_release_modrinth.yml b/.github/workflows/resuable_release_modrinth.yml index 7aee94e5..39d931d4 100644 --- a/.github/workflows/resuable_release_modrinth.yml +++ b/.github/workflows/resuable_release_modrinth.yml @@ -7,6 +7,9 @@ on: type: string required: false default: "beta" + version: + type: string + required: true secrets: MODRINTH_TOKEN: required: true @@ -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/mc-publish@v3.3 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" diff --git a/.github/workflows/resuable_version.yml b/.github/workflows/resuable_version.yml index 70e7da3b..f8d60d1f 100644 --- a/.github/workflows/resuable_version.yml +++ b/.github/workflows/resuable_version.yml @@ -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 diff --git a/Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta b/Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta index 9976a17e..193e813b 100644 --- a/Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta +++ b/Resourcepack/contents/_iainternal/resourcepack/pack.mcmeta @@ -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,