diff --git a/.github/buildtools/modpack/instance.cfg b/.github/buildtools/modpack/instance.cfg index 89c1b1053..57810c8aa 100644 --- a/.github/buildtools/modpack/instance.cfg +++ b/.github/buildtools/modpack/instance.cfg @@ -1,4 +1,23 @@ [General] -ManagedPackName=TerraFirmaGreg-1.20.x DEV +ConfigVersion=1.2 +ManagedPack=true iconKey=icon -name=TerraFirmaGreg-1.20.x DEV \ No newline at end of file +ManagedPackID=385053 +ManagedPackType=flame +ManagedPackName=TerraFirmaGreg-1.20.x +ManagedPackVersionID=CF_RELEASE_ID +ManagedPackVersionName=DEV +name=TerraFirmaGreg +InstanceType=OneSix +AutoCloseConsole=false +CloseAfterLaunch=false +EnableFeralGamemode=false +EnableMangoHud=false +ExportVersion=1.0.0 +LaunchMaximized=false +LogPrePostOutput=false +QuitAfterGameStop=false +RecordGameTime=true +ShowConsole=false +ShowConsoleOnError=true +ShowGameTime=false diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index 963492fbb..000000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,184 +0,0 @@ -name: Build -run-name: "Build #${{ github.run_number }}" - -on: - push: - tags: - - "*.*.*" - -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - - -jobs: - modpack-info: - name: Modpack Info - runs-on: ubuntu-latest - outputs: - project_name: ${{ steps.info.outputs.project_name }} - project_version: ${{ steps.info.outputs.project_version }} - mc_version: ${{ steps.info.outputs.mc_version }} - changelog: ${{ steps.changelog.outputs.description }} - - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - - name: Get tag - id: version - uses: "WyriHaximus/github-action-get-previous-tag@v1.3.0" - with: - fallback: tag_not_found - - - name: Modpack info - id: info - shell: bash - run: | - set +e - - if [ ! -f ./.github/buildtools/modpack/manifest.json ]; then - echo "::error::Could not find manifest.json" && exit 1 - fi - manifestjson=`cat ./.github/buildtools/modpack/manifest.json` - - project_name=`echo $(jq -r '.name' <<< "$manifestjson")` - echo "project_name=$project_name" >> $GITHUB_OUTPUT - - mc_version=`echo $(jq -r '.minecraft.version' <<< "$manifestjson")` - echo "mc_version=$mc_version" >> $GITHUB_OUTPUT - - if [[ ${{ startsWith(github.ref, 'refs/tags/') }} == true ]]; then - echo "project_version=${{ steps.version.outputs.tag }}" >> $GITHUB_OUTPUT - else - echo "project_version=build.${{ github.run_number }}" >> $GITHUB_OUTPUT - fi - - - name: Changelog Parser - id: changelog - uses: coditory/changelog-parser@v1.0.2 - with: - path: CHANGELOG.md - - - build-cf-modpack: - name: Build CF Modpack - runs-on: ubuntu-latest - needs: [modpack-info] - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - - name: Replace strings - shell: bash - run: | - VERSION=${{ needs.modpack-info.outputs.project_version }} - sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/manifest.json - sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt - sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml - - - name: Export CF - run: | - mkdir -p overrides - mv -vf {config,defaultconfigs,kubejs} overrides/ - mv -vf .github/buildtools/modpack/manifest.json ./ - mv -vf .github/buildtools/modpack/modlist.html ./ - zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip manifest.json modlist.html overrides - - - name: Upload zip cf - uses: actions/upload-artifact@v4.0.0 - with: - name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf - path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip - retention-days: 5 - - build-mmc-modpack: - name: Build MMC Modpack - runs-on: ubuntu-latest - needs: [modpack-info] - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - - name: Replace strings - shell: bash - run: | - VERSION=${{ needs.modpack-info.outputs.project_version }} - sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/instance.cfg - sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt - sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml - - - name: Download Mods - run: | - git submodule init - cd mods - git config --global credential.helper '!f() { - echo "username=Xikaro"; - echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f' - git submodule update --recursive - - - name: Export MMC - run: | - mkdir -p .minecraft - mv -vf {config,defaultconfigs,kubejs,mods} .minecraft/ - mv -vf .github/buildtools/modpack/mmc-pack.json ./ - mv -vf .github/buildtools/modpack/instance.cfg ./ - zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip mmc-pack.json instance.cfg .minecraft/ - - - name: Upload zip mmc - uses: actions/upload-artifact@v4.0.0 - with: - name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc - path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip - retention-days: 5 - - build-serverpack: - name: Build Serverpack - runs-on: ubuntu-latest - needs: [modpack-info] - steps: - - name: Checkout - uses: actions/checkout@v4.1.1 - - - name: Replace strings - shell: bash - run: | - VERSION=${{ needs.modpack-info.outputs.project_version }} - sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml - - - name: Download Mods - run: | - git submodule init - cd mods - git config --global credential.helper '!f() { - echo "username=Xikaro"; - echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f' - git submodule update --recursive - - - name: Export serverpack - run: | - mkdir -p .minecraft - mv -vf {config,defaultconfigs,kubejs,mods,.github/buildtools/serverpack/*} .minecraft - cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done - zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip .minecraft/* - - - name: Upload zip - uses: actions/upload-artifact@v4.0.0 - with: - name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server - path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip - retention-days: 5 - - - release: - name: Release - needs: [modpack-info, build-cf-modpack, build-mmc-modpack, build-serverpack] - if: startsWith(github.ref, 'refs/tags/') - uses: ./.github/workflows/release.yml - with: - project_name: ${{ needs.modpack-info.outputs.project_name }} - project_version: ${{ needs.modpack-info.outputs.project_version }} - mc_version: ${{ needs.modpack-info.outputs.mc_version }} - changelog: ${{ needs.modpack-info.outputs.changelog }} - secrets: inherit - diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 168bf4b01..df28220c7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -2,20 +2,13 @@ name: Release run-name: "Release #${{ github.run_number }}" on: - workflow_call: - inputs: - project_name: - required: true - type: string - project_version: - required: true - type: string - mc_version: - required: true - type: string - changelog: - required: true - type: string + push: + tags: + - "*.*.*" + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true env: CF_PROJECT_ID: "385053" @@ -23,9 +16,173 @@ env: RELEASE_TYPE: "BETA" jobs: + modpack-info: + name: Modpack Info + runs-on: ubuntu-latest + outputs: + project_name: ${{ steps.info.outputs.project_name }} + project_version: ${{ steps.info.outputs.project_version }} + mc_version: ${{ steps.info.outputs.mc_version }} + changelog: ${{ steps.changelog.outputs.description }} + + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Get tag + id: version + uses: "WyriHaximus/github-action-get-previous-tag@v1.3.0" + with: + fallback: tag_not_found + + - name: Modpack info + id: info + shell: bash + run: | + set +e + + if [ ! -f ./.github/buildtools/modpack/manifest.json ]; then + echo "::error::Could not find manifest.json" && exit 1 + fi + manifestjson=`cat ./.github/buildtools/modpack/manifest.json` + + project_name=`echo $(jq -r '.name' <<< "$manifestjson")` + echo "project_name=$project_name" >> $GITHUB_OUTPUT + + mc_version=`echo $(jq -r '.minecraft.version' <<< "$manifestjson")` + echo "mc_version=$mc_version" >> $GITHUB_OUTPUT + + if [[ ${{ startsWith(github.ref, 'refs/tags/') }} == true ]]; then + echo "project_version=${{ steps.version.outputs.tag }}" >> $GITHUB_OUTPUT + else + echo "project_version=build.${{ github.run_number }}" >> $GITHUB_OUTPUT + fi + + - name: Changelog Parser + id: changelog + uses: coditory/changelog-parser@v1.0.2 + with: + path: CHANGELOG.md + + build-cf-modpack: + name: Build CF Modpack + runs-on: ubuntu-latest + needs: [modpack-info] + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Replace strings + shell: bash + run: | + VERSION=${{ needs.modpack-info.outputs.project_version }} + sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/manifest.json + sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt + sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml + + - name: Export CF + run: | + mkdir -p overrides + mv -vf {config,defaultconfigs,kubejs} overrides/ + mv -vf .github/buildtools/modpack/manifest.json ./ + mv -vf .github/buildtools/modpack/modlist.html ./ + zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip manifest.json modlist.html overrides + + - name: Upload zip cf + uses: actions/upload-artifact@v4.0.0 + with: + name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf + path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip + retention-days: 5 + + build-mmc-modpack: + name: Build MMC Modpack + runs-on: ubuntu-latest + needs: [modpack-info, release-curseforge] + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Replace strings + shell: bash + run: | + VERSION=${{ needs.modpack-info.outputs.project_version }} + CF_RELEASE_ID=${{ needs.release-curseforge.outputs.cf_release_id }} + sed -i -e "s/DEV/${VERSION}/g" .github/buildtools/modpack/instance.cfg + sed -i -e "s/DEV/${VERSION}/g" config/fancymenu/customization/main_menu.txt + sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml + sed -i -e "s/CF_RELEASE_ID/${CF_RELEASE_ID}/g" .github/buildtools/modpack/instance.cfg + + - name: Download Mods + run: | + git submodule init + cd mods + git config --global credential.helper '!f() { + echo "username=Xikaro"; + echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f' + git submodule update --recursive + + - name: Export MMC + run: | + mkdir -p .minecraft + mkdir -p flame + mv -vf {config,defaultconfigs,kubejs,mods} .minecraft/ + mv -vf .github/buildtools/modpack/mmc-pack.json ./ + mv -vf .github/buildtools/modpack/instance.cfg ./ + mv -vf .github/buildtools/modpack/modlist.html ./ + mv -vf .github/buildtools/modpack/manifest.json flame/ + zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip icon.png mmc-pack.json instance.cfg .minecraft/ + + - name: Upload zip mmc + uses: actions/upload-artifact@v4.0.0 + with: + name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc + path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip + retention-days: 5 + + build-serverpack: + name: Build Serverpack + runs-on: ubuntu-latest + needs: [modpack-info] + steps: + - name: Checkout + uses: actions/checkout@v4.1.1 + + - name: Replace strings + shell: bash + run: | + VERSION=${{ needs.modpack-info.outputs.project_version }} + sed -i -e "s/DEV/${VERSION}/g" config/bcc-common.toml + + - name: Download Mods + run: | + git submodule init + cd mods + git config --global credential.helper '!f() { + echo "username=Xikaro"; + echo "password=${{ secrets.USER_TOKEN_XIKARO }}"; }; f' + git submodule update --recursive + + - name: Export serverpack + run: | + mkdir -p .minecraft + mv -vf {config,defaultconfigs,kubejs,mods,.github/buildtools/serverpack/*} .minecraft + cat .github/buildtools/client_mod.txt | while read -r line; do find .minecraft/mods -name "$line" -delete; done + zip -r ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip .minecraft/* + + - name: Upload zip + uses: actions/upload-artifact@v4.0.0 + with: + name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server + path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip + retention-days: 5 + release-curseforge: name: Deploy to CurseForge + needs: [modpack-info, build-cf-modpack, build-serverpack] runs-on: ubuntu-latest + outputs: + cf_release_id: ${{ steps.cf_release.outputs.id }} steps: - name: Check if CF_API_TOKEN exist shell: bash @@ -37,12 +194,12 @@ jobs: - name: Download cf modpack uses: actions/download-artifact@v4.1.0 with: - name: ${{ inputs.project_name }}-${{ inputs.project_version }}-cf + name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf - name: Download serverpack uses: actions/download-artifact@v4.1.0 with: - name: ${{ inputs.project_name }}-${{ inputs.project_version }}-server + name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server - name: Upload Curseforge id: cf_release @@ -50,35 +207,54 @@ jobs: with: api-token: ${{ secrets.CF_API_TOKEN }} project-id: ${{ env.CF_PROJECT_ID }} - modpack-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-cf.zip - modpack-server-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-server.zip - changelog: ${{ inputs.changelog }} + modpack-path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip + modpack-server-path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip + changelog: ${{ needs.modpack-info.outputs.changelog }} changelog-format: markdown - game-version: ${{ inputs.mc_version }} - display-name: ${{ inputs.project_name }}-${{ inputs.project_version }} - server-display-name: ${{ inputs.project_name }}-${{ inputs.project_version }}-server + game-version: ${{ needs.modpack-info.outputs.mc_version }} + display-name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }} + server-display-name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server release-type: ${{ env.RELEASE_TYPE }} - - name: Send Discord message - uses: tsickert/discord-webhook@v5.4.0 - with: - webhook-url: ${{secrets.RELEASES_1_20}} - username: "TerraFirmaGreg" - avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/curseforge_logo.png" - embed-title: Release ${{ inputs.project_version }} - embed-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.20.x/releases/tag/${{ inputs.project_version }} - embed-thumbnail-url: https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo_new_year.png - embed-description: | - **Release Type**: `${{ env.RELEASE_TYPE }}` - **GameVersion**: `${{ inputs.mc_version }}` - **Website Link**: [CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ steps.cf_release.outputs.id }}) - - **Changelog** - ```${{ inputs.changelog }}``` - embed-color: 5814783 + # release-modrinth: + # name: Deploy to Modrinth + # runs-on: ubuntu-latest + # steps: + # - name: Check if MODRINTH_API_TOKEN exist + # shell: bash + # run: | + # if [ "${{ secrets.MODRINTH_API_TOKEN }}" == '' ]; then + # echo '::error::No value found for secret key `MODRINTH_API_TOKEN`. See https://docs.github.com/en/ actionssecurity-guides/ encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1 + # fi + + # - name: Download modpack + # uses: actions/download-artifact@v4.1.0 + # with: + # name: modpack_mrd + + # - name: Download serverpack + # uses: actions/download-artifact@v4.1.0 + # with: + # name: server_pack + + # - name: Upload Modrinth + # id: cf_release + # uses: SwitchAlpha/upload-curseforge-modpack-action@master + # with: + # api-token: ${{ secrets.MODRINTH_API_TOKEN }} + # project-id: ${{ env.MODRINTH_PROJECT_ID }} + # modpack-path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mrd.zip + # modpack-server-path: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip + # changelog: "${{ needs.modpack-info.outputs.changelog }}" + # changelog-format: markdown + # game-version: ${{ needs.modpack-info.outputs.mc_version }} + # display-name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }} + # server-display-name: ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server + # release-type: ${{ env.RELEASE_TYPE }} release-github: name: Deploy to GitHub + needs: [modpack-info, build-cf-modpack, build-mmc-modpack, build-serverpack] runs-on: ubuntu-latest steps: - name: Download modpack @@ -91,56 +267,42 @@ jobs: with: prerelease: false generate_release_notes: true - name: ${{ inputs.project_version }} - body: ${{ inputs.CHANGELOG }} + name: ${{ needs.modpack-info.outputs.project_version }} + body: ${{ needs.modpack-info.outputs.changelog }} files: | - ${{ inputs.project_name }}-${{ inputs.project_version }}-cf.zip - ${{ inputs.project_name }}-${{ inputs.project_version }}-mmc.zip - ${{ inputs.project_name }}-${{ inputs.project_version }}-server.zip - tag_name: ${{ inputs.project_version }} + ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-cf.zip + ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-mmc.zip + ${{ needs.modpack-info.outputs.project_name }}-${{ needs.modpack-info.outputs.project_version }}-server.zip + tag_name: ${{ needs.modpack-info.outputs.project_version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # release-modrinth: - # name: Deploy to Modrinth - # runs-on: ubuntu-latest - # steps: - # - name: Check if MODRINTH_API_TOKEN exist - # shell: bash - # run: | - # if [ "${{ secrets.MODRINTH_API_TOKEN }}" == '' ]; then - # echo '::error::No value found for secret key `MODRINTH_API_TOKEN`. See https://docs.github.com/en/actionssecurity-guides/ encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1 - # fi + discord-message: + needs: [modpack-info, release-github, release-curseforge] + runs-on: ubuntu-latest + steps: + - name: Send Discord message + uses: tsickert/discord-webhook@v5.4.0 + with: + webhook-url: ${{secrets.RELEASES_1_20}} + username: "TerraFirmaGreg" + avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/curseforge_logo.png" + embed-title: Release ${{ needs.modpack-info.outputs.project_version }} + embed-url: https://github.com/TerraFirmaGreg-Team/TFG-Modpack-1.20.x/releases/tag/${{ needs.modpack-info.outputs.project_version }} + embed-thumbnail-url: https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo_new_year.png + embed-description: | + **Release Type**: `${{ env.RELEASE_TYPE }}` + **GameVersion**: `${{ needs.modpack-info.outputs.mc_version }}` + **Website Link**: [CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ needs.release-curseforge.outputs.cf_release_id }}) - # - name: Download modpack - # uses: actions/download-artifact@v4.1.0 - # with: - # name: modpack_mrd - - # - name: Download serverpack - # uses: actions/download-artifact@v4.1.0 - # with: - # name: server_pack - - # - name: Upload Modrinth - # id: cf_release - # uses: SwitchAlpha/upload-curseforge-modpack-action@master - # with: - # api-token: ${{ secrets.MODRINTH_API_TOKEN }} - # project-id: ${{ env.MODRINTH_PROJECT_ID }} - # modpack-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-mrd.zip - # modpack-server-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-server.zip - # changelog: "${{ inputs.CHANGELOG }}" - # changelog-format: markdown - # game-version: ${{ inputs.mc_version }} - # display-name: ${{ inputs.project_name }}-${{ inputs.project_version }} - # server-display-name: ${{ inputs.project_name }}-${{ inputs.project_version }}-server - # release-type: ${{ env.RELEASE_TYPE }} + **Changelog** + ```${{ needs.modpack-info.outputs.changelog }}``` + embed-color: 5814783 close-fixed-issues: name: Close Fixed Issues runs-on: ubuntu-latest - needs: [release-github, release-curseforge] + needs: [modpack-info, release-github, release-curseforge] steps: - name: Checkout uses: actions/checkout@v4.1.1 @@ -149,7 +311,7 @@ jobs: uses: juraj-hrivnak/close-issues-based-on-label@master env: LABEL: "2. Status: Fixed in Dev" - VERSION: ${{ inputs.project_version }} + VERSION: ${{ needs.modpack-info.outputs.project_version }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}