diff --git a/.github/ISSUE_TEMPLATE/000-bug-report.yml b/.github/ISSUE_TEMPLATE/000-bug-report.yml index e0fea8e2b27..67e88aac192 100644 --- a/.github/ISSUE_TEMPLATE/000-bug-report.yml +++ b/.github/ISSUE_TEMPLATE/000-bug-report.yml @@ -22,36 +22,40 @@ body: id: gtceu-version attributes: label: GregTech CEu Version - description: The version of Gregtech CEu you were using when this bug was encountered. If you do not know where to find this, look for the mod jar file in the mods folder, or in the mods viewer in-game. + description: The version of GregTech CEu you were using when this bug was encountered. If you do not know where to find this, look for the mod jar file in the mods folder, or in the mods viewer in-game. placeholder: "Example: v2.3.4" validations: required: true - - type: input + - type: dropdown id: mc-version attributes: label: Minecraft Version - description: The version of Minecraft you were using when this bug was encountered. If you do not know where to find this, in the main menu at the bottom left. - placeholder: "Example: 1.20.1" + description: The version of Minecraft you were using when this bug was encountered. If you do not know where to find this, it is in the bottom left of the main menu. Any version not listed is not supported. + options: + - "1.20.1 Forge" + - "1.21.1 NeoForge" validations: required: true - type: dropdown id: recipe-viewer attributes: label: Recipe Viewer Installed - description: The recipe viewer installed. If you were not using addons, please leave this field blank. + description: The recipe viewer installed. options: - "JEI" - "REI" - "EMI" - - "No Recipe Viewer" validations: required: false - - type: input + - type: dropdown id: environment attributes: label: Environment - description: "How you were playing on the world. Typical answers include: Singleplayer, Open to LAN, Dedicated Server." - placeholder: "Example: Singleplayer" + description: How you were playing on the world. Hybrid servers are unsupported. + options: + - "Singleplayer" + - "Multiplayer - Open to LAN" + - "Multiplayer - Dedicated Server" validations: required: true - type: dropdown @@ -69,8 +73,8 @@ body: id: other-mods attributes: label: Other Installed Mods - description: List all mods you have installed here, or the name of the modpack you're playing. - placeholder: "Example: ATM9, Embeddium, NuclearCraft Neoteric, AE2..." + description: Enter the name of the modpack you're playing, or list all mods you have installed here. + placeholder: "Example: Cosmic Frontiers, Monifactory, Embeddium, NuclearCraft Neoteric, AE2,..." validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/001-feature-request.yml b/.github/ISSUE_TEMPLATE/001-feature-request.yml index 899e5f18bc1..0c251a0822e 100644 --- a/.github/ISSUE_TEMPLATE/001-feature-request.yml +++ b/.github/ISSUE_TEMPLATE/001-feature-request.yml @@ -8,6 +8,15 @@ body: label: Cross-mod Integration description: "Does this feature involve integration with another mod? If so specify the mod(s). Otherwise, leave this blank." placeholder: "Example: Create Mod" + - type: dropdown + id: mc-version + attributes: + label: Minecraft Version + description: The version of Minecraft you wish this feature was added for. + options: + - "Both" + - "1.20.1 Forge" + - "1.21.1 NeoForge" - type: textarea id: description attributes: diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml new file mode 100644 index 00000000000..9842c5c9025 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -0,0 +1,5 @@ +blank_issues_enabled: false +contact_links: + - name: GregTech CEu Discord + url: https://discord.gg/bWSWuYvURP + about: Join us on Discord to discuss questions, bugs, and more. diff --git a/.github/actions/build_setup/action.yml b/.github/actions/build_setup/action.yml index a19adcdf6a3..dcdbe4a170e 100644 --- a/.github/actions/build_setup/action.yml +++ b/.github/actions/build_setup/action.yml @@ -24,20 +24,9 @@ runs: distribution: temurin java-version: ${{ contains(env.REF, '1.20.1') && '17' || '21' }} - - name: Validate Gradle wrapper - uses: gradle/actions/wrapper-validation@v3 - - - name: Grant execute permission for gradlew - shell: bash - run: chmod +x gradlew - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 + uses: gradle/actions/setup-gradle@v4 with: cache-write-only: ${{ inputs.update-cache }} - generate-job-summary: false - gradle-home-cache-includes: | - caches - notifications - jdks - wrapper + cache-read-only: ${{ github.ref != 'refs/heads/1.20.1' && github.ref != 'refs/heads/1.21' }} + add-job-summary: 'on-failure' diff --git a/.github/json/config-latest-1.21.json b/.github/json/config-latest-1.21.json new file mode 100644 index 00000000000..7ba17eeadaa --- /dev/null +++ b/.github/json/config-latest-1.21.json @@ -0,0 +1,34 @@ +{ + "categories": [ + { + "title": "### Added", + "labels": ["type: feature"] + }, + { + "title": "### Fixed", + "labels": ["type: bugfix"] + }, + { + "title": "### Changed", + "labels": ["type: refactor", "type: translation"] + } + ], + "sort": "ASC", + "template": "## What's Changed since #{{FROM_TAG}}\n#{{CHANGELOG}}\n#{{UNCATEGORIZED}}\n#{{CHANGES}} lines changed - see the [full diff here](#{{RELEASE_DIFF}})", + "pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in [##{{NUMBER}}](#{{URL}})", + "empty_template": "", + "ignore_labels": ["ignore changelog"], + "tag_resolver": { + "method": "semver", + "filter": { + "pattern": "^(?!v?[0-9\\.]+(-1\\.21)$).+$", + "flags": "gu" + }, + "transformer": { + "pattern": "v?([0-9\\.]+)(-[0-9\\.]+)?", + "target": "$1" + } + }, + "max_pull_requests": 1000, + "max_back_track_time_days": 60 +} diff --git a/.github/json/config-latest.json b/.github/json/config-latest.json index de302dc8b26..c4229675864 100644 --- a/.github/json/config-latest.json +++ b/.github/json/config-latest.json @@ -14,10 +14,21 @@ } ], "sort": "ASC", - "template": "## What's Changed\n#{{CHANGELOG}}\n#{{UNCATEGORIZED}}", + "template": "## What's Changed since #{{FROM_TAG}}\n#{{CHANGELOG}}\n#{{UNCATEGORIZED}}\n#{{CHANGES}} lines changed - see the [full diff here](#{{RELEASE_DIFF}})", "pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in [##{{NUMBER}}](#{{URL}})", "empty_template": "", "ignore_labels": ["ignore changelog"], + "tag_resolver": { + "method": "semver", + "filter": { + "pattern": "^(?!v?[0-9\\.]+(-1\\.20\\.1)?$).+$", + "flags": "gu" + }, + "transformer": { + "pattern": "v?([0-9\\.]+)(-[0-9\\.]+)?", + "target": "$1" + } + }, "max_pull_requests": 1000, - "max_back_track_time_days": 30 + "max_back_track_time_days": 60 } diff --git a/.github/labeler.yml b/.github/labeler.yml new file mode 100644 index 00000000000..04913da3cdf --- /dev/null +++ b/.github/labeler.yml @@ -0,0 +1,5 @@ +# https://github.com/github/issue-labeler#usage +1.20.1: + - '^1\.20\.1 Forge$' +1.21: + - '^1\.21\.1 NeoForge$' \ No newline at end of file diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index af2231e3a3d..2b5414e28d0 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -3,7 +3,7 @@ name: Latest Build on: push: branches: ['1.20.1', '1.21'] - paths-ignore: ['.github/**', '**/*.md'] + paths: ['src/**', '**/*.gradle', 'gradle.properties'] concurrency: group: auto-build-${{ github.ref }} @@ -13,25 +13,35 @@ jobs: build: runs-on: ubuntu-latest env: + GITHUB_TOKEN: ${{ github.token }} + PUBLISH: ${{ !contains(github.event.commits[0].message, '[no-snapshot]') }} MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} MAVEN_USER: ${{ secrets.MAVEN_USER }} SNAPSHOT: true - GITHUB_TOKEN: ${{ github.token }} + CI: true permissions: contents: write steps: - uses: actions/checkout@v4 - name: Setup Build uses: ./.github/actions/build_setup - - name: Get Version + - name: Get Mod Version id: ver run: echo "version=$(./gradlew -q printVersion)" >> $GITHUB_OUTPUT + - name: Version Suffix + id: suffix + run: echo "VERSION_SUFFIX=$(echo "${{ github.sha }}" | cut -c 1-7)" >> $GITHUB_ENV + - run: git fetch origin 1.20.1 - name: Build run: ./gradlew build --build-cache - name: Publish to Maven - if: github.repository_owner == 'GregTechCEu' + if: ${{ github.repository_owner == 'GregTechCEu' && env.PUBLISH == 'true' }} run: ./gradlew publish --build-cache + - name: Rename Jars + if: ${{ env.PUBLISH == 'true' }} + run: for file in build/libs/*; do mv "$file" "${file/SHOT/SHOT+$(date --utc '+%Y%m%d-%H%M%S')-${{ env.VERSION_SUFFIX }}}"; done; - name: Upload Artifacts + if: ${{ env.PUBLISH == 'true' }} uses: actions/upload-artifact@v4 with: name: build-artifacts @@ -40,21 +50,22 @@ jobs: retention-days: 90 - name: Changelog id: changelog + if: ${{ env.PUBLISH == 'true' }} uses: mikepenz/release-changelog-builder-action@v5 with: - configuration: ./.github/json/config-latest.json - fromTag: latest-${{ github.ref_name }} + configuration: "./.github/json/config-latest${{ contains(github.ref_name, '1.21') && '-1.21' || '' }}.json" toTag: ${{ github.ref }} fetchViaCommits: true failOnError: false - name: Release Latest + if: ${{ env.PUBLISH == 'true' }} uses: andelf/nightly-release@46e2d5f80828ecc5c2c3c819eb31186a7cf2156c with: tag_name: latest-${{ github.ref_name }} - name: '${{ github.ref_name }}-${{ steps.ver.outputs.version}} SNAPSHOT $$' + name: '${{ github.ref_name }}-${{ steps.ver.outputs.version}} SNAPSHOT ${{ env.VERSION_SUFFIX }}' prerelease: true body: | The latest build of GTM for Minecraft ${{ github.ref_name }}. Please report any [issues](https://github.com/GregTechCEu/GregTech-Modern/issues). ${{ steps.changelog.outputs.changelog }} - files: build/libs/*.jar \ No newline at end of file + files: build/libs/*.jar diff --git a/.github/workflows/build-on-push.yml b/.github/workflows/build-on-push.yml index 451fc40a646..5eb2d5ec38a 100644 --- a/.github/workflows/build-on-push.yml +++ b/.github/workflows/build-on-push.yml @@ -12,6 +12,8 @@ concurrency: jobs: build: runs-on: ubuntu-latest + env: + VERSION_SUFFIX: "PR-${{ github.event.number }}" steps: - uses: actions/checkout@v4 - name: Check Path Filter @@ -31,10 +33,20 @@ jobs: - name: Build if: steps.filter.outputs.code == 'true' run: ./gradlew assemble --build-cache - - name: Upload Artifact + - name: Rename Jars + if: steps.filter.outputs.code == 'true' + run: for file in build/libs/*; do mv "$file" "${file/.jar/-${{ env.VERSION_SUFFIX }}.jar}"; done; + - name: Upload All Artifacts if: steps.filter.outputs.code == 'true' uses: actions/upload-artifact@v4.0.0 with: - name: build output + name: Full Package path: build/libs/* retention-days: 15 + - name: Upload Main Jar + if: steps.filter.outputs.code == 'true' + uses: actions/upload-artifact@v4.0.0 + with: + name: Main Jar + path: build/libs/*[0-9]-PR-*.jar + retention-days: 15 diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml new file mode 100644 index 00000000000..f82c9328980 --- /dev/null +++ b/.github/workflows/deploy-pages.yml @@ -0,0 +1,56 @@ +name: Publish docs via GitHub Pages +on: + workflow_dispatch: + push: + branches: [1.20.1] + paths: ['docs/**'] + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: 'pages' + cancel-in-progress: false + +jobs: + build: + name: build docs + runs-on: ubuntu-latest + defaults: + run: + working-directory: './docs' + steps: + - uses: actions/checkout@v4 + with: + ref: '1.20.1' + sparse-checkout: './docs' + - uses: actions/setup-python@v4 + with: + python-version: '3.11' + cache: 'pip' + - run: pip install -r ./requirements.txt + - uses: actions/cache@v4 + with: + key: 'mkdocs-cache' + path: './docs/.cache' + - name: Build static files + id: mkdocs + run: mkdocs build + - name: Upload pages as artifact + id: artifact + uses: actions/upload-pages-artifact@v3 + with: + path: './docs/site/' + + deploy: + runs-on: ubuntu-latest + needs: build + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/.github/workflows/format-java.yml b/.github/workflows/format-java.yml index 44ec187744e..262e441d770 100644 --- a/.github/workflows/format-java.yml +++ b/.github/workflows/format-java.yml @@ -29,6 +29,8 @@ jobs: code: - 'src/main/java/**' - 'src/test/**' + - run: git fetch origin 1.20.1 + if: steps.filter.outputs.code == 'true' - name: Setup Build if: steps.filter.outputs.code == 'true' uses: ./.github/actions/build_setup diff --git a/.github/workflows/manage-issue-labels.yml b/.github/workflows/manage-issue-labels.yml new file mode 100644 index 00000000000..d771705cdbb --- /dev/null +++ b/.github/workflows/manage-issue-labels.yml @@ -0,0 +1,19 @@ +# Manages labels on new issues +name: Issue Labels + +on: + issues: + types: [opened, edited] + +permissions: + issues: write + contents: read + +jobs: + label: + runs-on: ubuntu-latest + steps: + - uses: github/issue-labeler@v3.3 + with: + configuration-path: .github/labeler.yml + enable-versioned-regex: false diff --git a/.github/workflows/manage-pr-labels.yml b/.github/workflows/manage-pr-labels.yml index 2e983e807a6..3ef69bcd1f6 100644 --- a/.github/workflows/manage-pr-labels.yml +++ b/.github/workflows/manage-pr-labels.yml @@ -3,19 +3,16 @@ name: Pull Request Labels # Checks for label once PR has been reviewed or label is applied on: - pull_request_review: - types: [submitted] pull_request: - types: [labeled] + types: [opened, labeled, unlabeled] concurrency: group: pr-labels-${{ github.head_ref }} cancel-in-progress: true jobs: - Labels: - name: On Approval - if: github.event.review.state == 'approved' + labels: + name: Label Check runs-on: ubuntu-latest permissions: pull-requests: read # needed to utilize required-labels diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 847d470ac3a..032be550165 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -29,6 +29,8 @@ jobs: runs-on: ubuntu-latest permissions: contents: write + env: + CI: 'true' outputs: ver: ${{ steps.ver.outputs.version }} steps: @@ -173,4 +175,4 @@ jobs: GH_TOKEN: ${{ github.token }} run: | git push --force --set-upstream origin gh/release-${{ inputs.branch }} - gh pr create -B ${{ inputs.branch }} -H gh/release-${{ inputs.branch }} --title "RELEASE for ${{ inputs.branch }}" --body "Created by GH Workflow" --label "ignore changelog" + gh pr create -B ${{ inputs.branch }} -H gh/release-${{ inputs.branch }} --title "RELEASE for ${{ inputs.branch }} [no-snapshot]" --body "Created by GH Workflow" --label "ignore changelog" diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 633161fae66..b68eade10e2 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -22,4 +22,4 @@ jobs: git checkout origin/1.20.1 -- .github git commit -am "Sync Workflows" git push --force --set-upstream origin gh/workflow-sync - gh pr create -B 1.21 -H gh/workflow-sync --title "Sync Workflows with 1.20.1" --body "Created by GH Workflow" --label "ignore changelog" + gh pr create -B 1.21 -H gh/workflow-sync --title "Sync Workflows with 1.20.1 [no-snapshot]" --body "Created by GH Workflow" --label "ignore changelog"