From 009bf3ecd072b3e2ba187ad33ebc1bf02e7c40b9 Mon Sep 17 00:00:00 2001 From: Xikaro <0regon.end@gmail.com> Date: Sun, 27 Oct 2024 01:39:48 +0500 Subject: [PATCH] Update release.yml --- .github/workflows/build.yml | 261 ------------------ .github/workflows/release.yml | 482 +++++++++++++++++++++++++--------- 2 files changed, 356 insertions(+), 387 deletions(-) delete mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml deleted file mode 100644 index f8974b8c..00000000 --- a/.github/workflows/build.yml +++ /dev/null @@ -1,261 +0,0 @@ -name: Build -run-name: "Build #${{ github.run_number }} by @${{ github.actor }}" - -env: - RELEASE_TYPE: "release" - MC_VERSION: "1.12.2" - -on: - push: - branches: - - pakku - # tags: - # - "*.*.*" - -concurrency: - group: ${{ github.ref }} - cancel-in-progress: true - -jobs: - info: - name: Project Info - runs-on: ubuntu-latest - - outputs: - project_version: ${{ steps.project_version.outputs.tag }} - project_name: ${{ steps.project_name.outputs.value }} - changelog: ${{ steps.changelog.outputs.description }} - diff: ${{ steps.lockfile.outputs.diff }} - release_type: ${{ env.RELEASE_TYPE }} - mc_version: ${{ env.MC_VERSION }} - - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - - name: Check lockfile - shell: bash - run: | - set +e - echo "๐Ÿ”Ž Getting modpack info..." - - if [ ! -f pakku-lock.json ]; then - echo "::error::Could not find pakku-lock.json" && exit 1 - else - echo "โœ”๏ธ pakku-lock.json" - fi - - if [ ! -f pakku.json ]; then - echo "::error::Could not find pakku.json" && exit 1 - else - echo "โœ”๏ธ pakku.json" - fi - - - name: Get previous lockfile - id: lockfile - shell: bash - run: | - set +e - echo "๐Ÿ”Ž Getting previous lockfile..." - if [ "$latest_tag" = ${{ github.ref_name }} ]; then - latest_tag_prev=$(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^) - latest_tagged_commit=$(git rev-list -n 1 --pretty=format:"%h" $latest_tag_prev | sed -n 2p) - - if git cat-file -e $latest_tagged_commit:./pakku-lock.json; then - git show $latest_tagged_commit:./pakku-lock.json > ./pakku-lock-prev.json - java -jar ./pakku.jar diff -v --markdown PROJECTS_DIFF.md ./pakku-lock-pre.json ./pakku-lock.json - else - echo "โŒ File pakku-lock.json not found in previous tag" - fi - fi - if [ ! -f PROJECTS_DIFF.md ]; then - touch PROJECTS_DIFF.md - fi - { - echo 'diff<> "$GITHUB_OUTPUT" - - - name: Get Project Name - id: project_name - uses: ActionsTools/read-json-action@v1.0.5 - with: - file_path: "pakku.json" - prop_path: "name" - - - name: Get Project Version - id: project_version - uses: "WyriHaximus/github-action-get-previous-tag@v1.4.0" - with: - fallback: build.${{ github.run_number }} - - - name: Changelog Parser - id: changelog - uses: coditory/changelog-parser@v1.0.2 - with: - path: CHANGELOG.md - - - name: Generate list using Markdown - run: | - echo "๐Ÿ“ƒ Project Name=${{ steps.project_name.outputs.value }}" >> $GITHUB_STEP_SUMMARY - echo "๐Ÿ“ƒ Project Version=${{ steps.project_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY - echo "๐Ÿ“ƒ MC Versions=${{ env.MC_VERSION }}" >> $GITHUB_STEP_SUMMARY - echo "๐Ÿ“ƒ Release Type=${{ env.RELEASE_TYPE }}" >> $GITHUB_STEP_SUMMARY - echo "${{ steps.changelog.outputs.description }}" >> $GITHUB_STEP_SUMMARY - echo "${{ steps.lockfile.outputs.diff }}" >> $GITHUB_STEP_SUMMARY - - build-modpack: - name: Build Modpack - runs-on: ubuntu-latest - needs: [info] - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - - name: Replace strings - shell: bash - run: | - set +e - - grooovy="./groovy/runConfig.json" - cat <<< $(jq '.debug = false' $grooovy) > $grooovy - sed -i -e "s/DEV/${{ needs.info.outputs.project_version }}/g" pakku.json - - - name: Cache pakku - uses: actions/cache@v4.1.2 - with: - path: build/.cache - key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }} - restore-keys: | - ${{ runner.OS }}-pakku-cache- - - - name: Export modpack - run: | - java -jar ./pakku.jar export - - - name: Rename artifact curseforge - run: | - cd ./build/curseforge/ - mv *.zip $(basename -s .zip *.zip)-curseforge.zip - - - name: Upload artifact CurseForge - uses: actions/upload-artifact@v4.4.0 - with: - name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge - path: ./build/curseforge/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip - if-no-files-found: error - - - name: Rename artifact modrinth - run: | - cd ./build/modrinth/ - mv *.mrpack $(basename -s .mrpack *.mrpack)-modrinth.mrpack - - - name: Upload artifact modrinth - uses: actions/upload-artifact@v4.4.0 - with: - name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-modrinth - path: ./build/modrinth/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-modrinth.mrpack - if-no-files-found: warn - - build-server: - name: Build Server Pack - runs-on: ubuntu-latest - needs: [info] - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - - name: Replace strings - shell: bash - run: | - set +e - - grooovy="./groovy/runConfig.json" - cat <<< $(jq '.debug = false' $grooovy) > $grooovy - sed -i -e "s/DEV/${{ needs.info.outputs.project_version }}/g" pakku.json - - - name: Cache pakku - uses: actions/cache@v4.1.2 - with: - path: build/.cache - key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }} - restore-keys: | - ${{ runner.OS }}-pakku-cache- - - - name: Export modpack - run: | - mv -vf ./.pakku/server-overrides/* ./ - java -jar ./pakku.jar export - - - name: Rename artifact server - run: | - cd ./build/serverpack/ - mv *.zip $(basename -s .zip *.zip)-serverpack.zip - - - name: Upload artifact server - uses: actions/upload-artifact@v4.4.0 - with: - name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack - path: ./build/serverpack/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack.zip - if-no-files-found: error - - build-multimc: - name: Build MultiMC Pack - runs-on: ubuntu-latest - needs: [info] - steps: - - name: Checkout - uses: actions/checkout@v4.2.2 - - - name: Replace strings - shell: bash - run: | - set +e - - grooovy="./groovy/runConfig.json" - cat <<< $(jq '.debug = false' $grooovy) > $grooovy - - - name: Cache pakku - uses: actions/cache@v4.1.2 - with: - path: build/.cache - key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }} - restore-keys: | - ${{ runner.OS }}-pakku-cache- - - - name: Export - run: | - java -jar pakku.jar --debug fetch - java -jar pakku.jar --debug export - - - name: Move files - run: | - ls - mkdir -p .pakku/multimc-overrides/flame - mv -vf ./build/.cache/curseforge/manifest.json .pakku/multimc-overrides/flame/manifest.json - mv -vf ./build/.cache/curseforge/overrides .pakku/multimc-overrides/.minecraft - mv -vf ./mods .pakku/multimc-overrides/.minecraft/mods - cd .pakku/multimc-overrides/ - - zip -r ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip icon.png mmc-pack.json instance.cfg .minecraft/ flame/ - - - name: Upload zip multimc - uses: actions/upload-artifact@v4.4.0 - with: - name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc - path: .pakku/multimc-overrides/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip - if-no-files-found: error - - release: - name: Release - needs: [info, build-modpack, build-server, build-multimc] - uses: ./.github/workflows/release.yml - with: - project_name: ${{ needs.info.outputs.project_name }} - project_version: ${{ needs.info.outputs.project_version }} - release_type: ${{ needs.info.outputs.release_type }} - mc_version: ${{ needs.info.outputs.mc_version }} - changelog: ${{ needs.info.outputs.changelog }} - diff: ${{ needs.info.outputs.diff }} - secrets: inherit \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4bf26307..13d2ab8d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,148 +1,382 @@ name: Release run-name: "Release #${{ github.run_number }} by @${{ github.actor }}" +env: + RELEASE_TYPE: "release" + MC_VERSION: "1.12.2" + on: - workflow_call: - inputs: - project_name: - required: true - type: string - project_version: - required: true - type: string - release_type: - required: true - type: string - mc_version: - required: true - type: string - changelog: - required: true - type: string - diff: - required: true - type: string + push: + branches: + - pakku + # tags: + # - "*.*.*" + +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true jobs: - # release-curseforge: - # name: Deploy to CurseForge - # runs-on: ubuntu-latest - # outputs: - # cf_release_id: ${{ steps.cf_release.outputs.id }} - # steps: - # - name: Check if CF_API_TOKEN exist - # shell: bash - # run: | - # if [ "${{ secrets.CF_API_TOKEN }}" == '' ]; then - # echo '::error::No value found for secret key `CF_API_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1 - # fi - - # - name: Download artifact curseforge - # uses: actions/download-artifact@v4.1.8 - # with: - # name: ${{ inputs.project_name }}-${{ inputs.project_version }}-curseforge - - # - name: Download artifact server - # uses: actions/download-artifact@v4.1.8 - # with: - # name: ${{ inputs.project_name }}-${{ inputs.project_version }}-serverpack - - # - name: Upload Curseforge - # id: cf_release - # uses: Xikaro/upload-curseforge-modpack-action@1.1.1 - # with: - # api-token: ${{ secrets.CF_API_TOKEN }} - # project-id: ${{ vars.CF_MODPACK_ID }} - # display-name: ${{ inputs.project_name }}-${{ inputs.project_version }} - # modpack-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-curseforge.zip - # server-display-name: ${{ inputs.project_name }}-${{ inputs.project_version }}-serverpack - # modpack-server-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-serverpack.zip - # changelog: ${{ inputs.changelog }} - # changelog-format: markdown - # game-version: ${{ inputs.mc_version }} - # release-type: ${{ inputs.release_type }} - - # 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 + info: + name: Project Info + runs-on: ubuntu-latest + + outputs: + project_version: ${{ steps.project_version.outputs.tag }} + project_name: ${{ steps.project_name.outputs.value }} + changelog: ${{ steps.changelog.outputs.description }} + diff: ${{ steps.lockfile.outputs.diff }} + release_type: ${{ env.RELEASE_TYPE }} + mc_version: ${{ env.MC_VERSION }} + + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + + - name: Check lockfile + shell: bash + run: | + set +e + echo "๐Ÿ”Ž Getting modpack info..." + + if [ ! -f pakku-lock.json ]; then + echo "::error::Could not find pakku-lock.json" && exit 1 + else + echo "โœ”๏ธ pakku-lock.json" + fi + + if [ ! -f pakku.json ]; then + echo "::error::Could not find pakku.json" && exit 1 + else + echo "โœ”๏ธ pakku.json" + fi + + - name: Get previous lockfile + id: lockfile + shell: bash + run: | + set +e + echo "๐Ÿ”Ž Getting previous lockfile..." + if [ "$latest_tag" = ${{ github.ref_name }} ]; then + latest_tag_prev=$(git describe --tags --abbrev=0 $(git describe --tags --abbrev=0)^) + latest_tagged_commit=$(git rev-list -n 1 --pretty=format:"%h" $latest_tag_prev | sed -n 2p) + + if git cat-file -e $latest_tagged_commit:./pakku-lock.json; then + git show $latest_tagged_commit:./pakku-lock.json > ./pakku-lock-prev.json + java -jar ./pakku.jar diff -v --markdown PROJECTS_DIFF.md ./pakku-lock-pre.json ./pakku-lock.json + else + echo "โŒ File pakku-lock.json not found in previous tag" + fi + fi + if [ ! -f PROJECTS_DIFF.md ]; then + touch PROJECTS_DIFF.md + fi + { + echo 'diff<> "$GITHUB_OUTPUT" + + - name: Get Project Name + id: project_name + uses: ActionsTools/read-json-action@v1.0.5 + with: + file_path: "pakku.json" + prop_path: "name" + + - name: Get Project Version + id: project_version + uses: "WyriHaximus/github-action-get-previous-tag@v1.4.0" + with: + fallback: build.${{ github.run_number }} + + - name: Changelog Parser + id: changelog + uses: coditory/changelog-parser@v1.0.2 + with: + path: CHANGELOG.md + + - name: Generate list using Markdown + run: | + echo "๐Ÿ“ƒ Project Name=${{ steps.project_name.outputs.value }}" >> $GITHUB_STEP_SUMMARY + echo "๐Ÿ“ƒ Project Version=${{ steps.project_version.outputs.tag }}" >> $GITHUB_STEP_SUMMARY + echo "๐Ÿ“ƒ MC Versions=${{ env.MC_VERSION }}" >> $GITHUB_STEP_SUMMARY + echo "๐Ÿ“ƒ Release Type=${{ env.RELEASE_TYPE }}" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.changelog.outputs.description }}" >> $GITHUB_STEP_SUMMARY + echo "${{ steps.lockfile.outputs.diff }}" >> $GITHUB_STEP_SUMMARY + + build-modpack: + name: Build Modpack + runs-on: ubuntu-latest + needs: [info] + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + + - name: Replace strings + shell: bash + run: | + set +e + + grooovy="./groovy/runConfig.json" + cat <<< $(jq '.debug = false' $grooovy) > $grooovy + sed -i -e "s/DEV/${{ needs.info.outputs.project_version }}/g" pakku.json + + - name: Cache pakku + uses: actions/cache@v4.1.2 + with: + path: build/.cache + key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }} + restore-keys: | + ${{ runner.OS }}-pakku-cache- + + - name: Export modpack + run: | + java -jar ./pakku.jar export + + - name: Rename artifact curseforge + run: | + cd ./build/curseforge/ + mv *.zip $(basename -s .zip *.zip)-curseforge.zip + + - name: Upload artifact CurseForge + uses: actions/upload-artifact@v4.4.0 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge + path: ./build/curseforge/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip + if-no-files-found: error + + - name: Rename artifact modrinth + run: | + cd ./build/modrinth/ + mv *.mrpack $(basename -s .mrpack *.mrpack)-modrinth.mrpack + + - name: Upload artifact modrinth + uses: actions/upload-artifact@v4.4.0 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-modrinth + path: ./build/modrinth/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-modrinth.mrpack + if-no-files-found: warn + + build-server: + name: Build Server Pack + runs-on: ubuntu-latest + needs: [info] + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + + - name: Replace strings + shell: bash + run: | + set +e + + grooovy="./groovy/runConfig.json" + cat <<< $(jq '.debug = false' $grooovy) > $grooovy + sed -i -e "s/DEV/${{ needs.info.outputs.project_version }}/g" pakku.json + + - name: Cache pakku + uses: actions/cache@v4.1.2 + with: + path: build/.cache + key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }} + restore-keys: | + ${{ runner.OS }}-pakku-cache- + + - name: Export modpack + run: | + mv -vf ./.pakku/server-overrides/* ./ + java -jar ./pakku.jar export + + - name: Rename artifact server + run: | + cd ./build/serverpack/ + mv *.zip $(basename -s .zip *.zip)-serverpack.zip + + - name: Upload artifact server + uses: actions/upload-artifact@v4.4.0 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack + path: ./build/serverpack/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack.zip + if-no-files-found: error + + build-multimc: + name: Build MultiMC Pack + runs-on: ubuntu-latest + needs: [info] + steps: + - name: Checkout + uses: actions/checkout@v4.2.2 + + - name: Replace strings + shell: bash + run: | + set +e + + grooovy="./groovy/runConfig.json" + cat <<< $(jq '.debug = false' $grooovy) > $grooovy + + - name: Cache pakku + uses: actions/cache@v4.1.2 + with: + path: build/.cache + key: ${{ runner.OS }}-pakku-cache-${{ hashFiles('build/.cache/') }} + restore-keys: | + ${{ runner.OS }}-pakku-cache- + + - name: Export + run: | + java -jar pakku.jar --debug fetch + java -jar pakku.jar --debug export + + - name: Move files + run: | + ls + mkdir -p .pakku/multimc-overrides/flame + mv -vf ./build/.cache/curseforge/manifest.json .pakku/multimc-overrides/flame/manifest.json + mv -vf ./build/.cache/curseforge/overrides .pakku/multimc-overrides/.minecraft + mv -vf ./mods .pakku/multimc-overrides/.minecraft/mods + cd .pakku/multimc-overrides/ + + zip -r ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip icon.png mmc-pack.json instance.cfg .minecraft/ flame/ + + - name: Upload zip multimc + uses: actions/upload-artifact@v4.4.0 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc + path: .pakku/multimc-overrides/${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip + if-no-files-found: error + + release: + name: Release + needs: [info, build-modpack, build-server, build-multimc] + uses: ./.github/workflows/release.yml + with: + project_name: ${{ needs.info.outputs.project_name }} + project_version: ${{ needs.info.outputs.project_version }} + release_type: ${{ needs.info.outputs.release_type }} + mc_version: ${{ needs.info.outputs.mc_version }} + changelog: ${{ needs.info.outputs.changelog }} + diff: ${{ needs.info.outputs.diff }} + secrets: inherit + + release-curseforge: + name: Deploy to CurseForge + needs: [info, build-modpack, build-server] + runs-on: ubuntu-latest + outputs: + id: ${{ steps.cf_release.outputs.id }} + steps: + - name: Check if CF_API_TOKEN exist + shell: bash + run: | + if [ "${{ secrets.CF_API_TOKEN }}" == '' ]; then + echo '::error::No value found for secret key `CF_API_TOKEN`. See https://docs.github.com/en/actions/security-guides/encrypted-secrets#creating-encrypted-secrets-for-a-repository' && exit 1 + fi + + - name: Download artifact curseforge + uses: actions/download-artifact@v4.1.8 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge + + - name: Download artifact server + uses: actions/download-artifact@v4.1.8 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack + + - name: Upload Curseforge + id: cf_release + uses: Xikaro/upload-curseforge-modpack-action@1.1.1 + with: + api-token: ${{ secrets.CF_API_TOKEN }} + project-id: ${{ vars.CF_MODPACK_ID }} + display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }} + modpack-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip + server-display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack + modpack-server-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack.zip + changelog: ${{ needs.info.outputs.changelog }} + changelog-format: markdown + game-version: ${{ needs.info.outputs.mc_version }} + release-type: ${{ needs.info.outputs.release_type }} + + release-modrinth: + name: Deploy to Modrinth + needs: [info, build-modpack, build-server] + 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 artifact modrinth - # uses: actions/download-artifact@v4.1.8 - # with: - # name: ${{ inputs.project_name }}-${{ inputs.project_version }}-modrinth + - name: Download artifact modrinth + uses: actions/download-artifact@v4.1.8 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-modrinth - # - name: Download artifact server - # uses: actions/download-artifact@v4.1.8 - # with: - # name: ${{ inputs.project_name }}-${{ inputs.project_version }}-serverpack + - name: Download artifact server + uses: actions/download-artifact@v4.1.8 + with: + name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack - # - name: Upload Modrinth - # id: cf_release - # uses: Xikaro/upload-curseforge-modpack-action@1.1.1 - # with: - # api-token: ${{ secrets.MODRINTH_API_TOKEN }} - # project-id: ${{ vars.MODRINTH_MODPACK_ID }} - # modpack-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-modrinth.mrpack - # modpack-server-path: ${{ inputs.project_name }}-${{ inputs.project_version }}-serverpack.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 }}-serverpack - # release-type: ${{ inputs.release_type }} - - # close-fixed-issues: - # name: Close Fixed Issues - # runs-on: ubuntu-latest - # steps: - # - name: Checkout - # uses: actions/checkout@v4.2.2 - - # - name: ะกlose fixed in dev - # uses: Xikaro/close-issues-based-on-label@master - # env: - # LABEL: "2. Status: In Dev" - # COMMENT: In ${{ inputs.project_version }} - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Modrinth + id: cf_release + uses: Xikaro/upload-curseforge-modpack-action@1.1.1 + with: + api-token: ${{ secrets.MODRINTH_API_TOKEN }} + project-id: ${{ vars.MODRINTH_MODPACK_ID }} + modpack-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-modrinth.mrpack + modpack-server-path: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack.zip + changelog: ${{ needs.info.outputs.changelog }} + changelog-format: markdown + game-version: ${{ needs.info.outputs.mc_version }} + display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }} + server-display-name: ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack + release-type: ${{ needs.info.outputs.release_type }} release-github: name: Deploy to GitHub - needs: [ ] + needs: [info, build-modpack, build-server, build-multimc] runs-on: ubuntu-latest steps: - - name: Download modpack + - name: Checkout + uses: actions/checkout@v4.2.2 + + - name: Download artifact uses: actions/download-artifact@v4.1.8 with: merge-multiple: true + - name: ะกlose fixed in dev + uses: Xikaro/close-issues-based-on-label@master + env: + LABEL: "2. Status: In Dev" + COMMENT: In ${{ needs.info.outputs.project_version }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create release uses: softprops/action-gh-release@v2.0.8 with: prerelease: false generate_release_notes: true - name: ${{ inputs.project_version }} + name: ${{ needs.info.outputs.project_version }} body: | - ${{ inputs.changelog }} - ${{ inputs.diff }} + ${{ needs.info.outputs.changelog }} + ${{ needs.info.outputs.diff }} files: | - ${{ inputs.project_name }}-${{ inputs.project_version }}-curseforge.zip - ${{ inputs.project_name }}-${{ inputs.project_version }}-serverpack.zip - ${{ inputs.project_name }}-${{ inputs.project_version }}-multimc.zip + ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-curseforge.zip + ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-serverpack.zip + ${{ needs.info.outputs.project_name }}-${{ needs.info.outputs.project_version }}-multimc.zip tag_name: 4.5.3 - # tag_name: ${{ inputs.project_version }} + # tag_name: ${{ needs.info.outputs.project_version }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} discord-message: name: Discord Message - needs: [release-github] + needs: [info, release-github] runs-on: ubuntu-latest steps: - name: Send Discord message @@ -151,15 +385,11 @@ jobs: webhook-url: ${{ secrets.RELEASES_1_12 }} username: "TerraFirmaGreg" avatar-url: "https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/logo.png" - embed-title: Release ${{ inputs.project_version }} - embed-url: https://github.com/${{ github.repository }}/releases/tag/${{ inputs.project_version }} - embed-thumbnail-url: https://raw.githubusercontent.com/TerraFirmaGreg-Team/.github/main/branding/curseforge_logo.png - embed-description: | - **Release**: `${{ inputs.project_version }}` - **Release Type**: `${{ inputs.release_type }}` - **GameVersion**: `${{ inputs.mc_version }}` - [CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ needs.release-curseforge.outputs.cf_release_id }}) โ€ข [GitHub](https://github.com/${{ github.repository }}/releases/tag/${{ inputs.project_version }}) โ€ข [Issues](https://github.com/${{ github.repository }}/issues - - ```${{ inputs.changelog }}``` - ** [Read more...](https://github.com/${{ github.repository }}/releases/tag/${{ inputs.project_version }}) ** - embed-color: 5814783 \ No newline at end of file + content: | + **Release**: `${{ needs.info.outputs.project_version }}` + **Release Type**: `${{ needs.info.outputs.release_type }}` + **GameVersion**: `${{ needs.info.outputs.mc_version }}` + [CurseForge](https://www.curseforge.com/minecraft/modpacks/terrafirmagreg/files/${{ needs.release-curseforge.outputs.id }}) โ€ข [GitHub](https://github.com/${{ github.repository }}/releases/tag/${{ needs.info.outputs.project_version }}) โ€ข [Issues](https://github.com/${{ github.repository }}/issues) + + ```${{ needs.info.outputs.changelog }}``` + ** [Read more...](https://github.com/${{ github.repository }}/releases/tag/${{ needs.info.outputs.project_version }}) ** \ No newline at end of file