From e61357dfaf210526851c7c876790d06ed87b7605 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 24 Nov 2026 14:29:05 +0000 Subject: [PATCH] Sync Workflows --- .github/actions/build_setup/action.yml | 6 +-- .github/json/config-1.21.json | 45 +++++++++++++++++++++++ .github/json/config-latest-1.21.json | 35 ++++++++++++++++++ .github/workflows/auto-build.yml | 4 +- .github/workflows/publish-on-release.yml | 18 ++++++++- .github/workflows/publish.yml | 12 +++--- .github/workflows/sync.yml | 6 ++- .github/workflows/update-gradle-cache.yml | 2 +- 8 files changed, 113 insertions(+), 15 deletions(-) create mode 100644 .github/json/config-1.21.json create mode 100644 .github/json/config-latest-1.21.json diff --git a/.github/actions/build_setup/action.yml b/.github/actions/build_setup/action.yml index c1bf4ed..c852a0c 100644 --- a/.github/actions/build_setup/action.yml +++ b/.github/actions/build_setup/action.yml @@ -19,14 +19,14 @@ runs: - name: Set up JDK uses: actions/setup-java@v4 env: - REF: ${{ inputs.ref || github.ref }} + REF: ${{ inputs.ref || github.base_ref || github.ref }} with: distribution: temurin - java-version: 25 + java-version: ${{ contains(env.REF, '1.21') && '21' || '25' }} - name: Setup Gradle uses: gradle/actions/setup-gradle@v4 with: cache-write-only: ${{ inputs.update-cache }} - cache-read-only: ${{ github.ref != 'refs/heads/26.1' }} + cache-read-only: ${{ github.ref != 'refs/heads/26.1' && github.ref != 'refs/heads/1.21' }} add-job-summary: 'on-failure' diff --git a/.github/json/config-1.21.json b/.github/json/config-1.21.json new file mode 100644 index 0000000..a726d5d --- /dev/null +++ b/.github/json/config-1.21.json @@ -0,0 +1,45 @@ +{ + "categories": [ + { + "title": "### Added", + "labels": ["type: feature"] + }, + { + "title": "### Fixed", + "labels": ["type: bugfix"] + }, + { + "title": "### Changed", + "labels": ["type: refactor", "type: translation"] + } + ], + "sort": "ASC", + "template": "## Version [v#{{VERSION}}](#{{RELEASE_DIFF}})\n#{{CHANGELOG}} ", + "pr_template": "- #{{TITLE}} by @#{{AUTHOR}} in [##{{NUMBER}}](#{{URL}})", + "custom_placeholders": [ + { + "name": "VERSION", + "source": "TO_TAG", + "transformer": { + "pattern": "v?([0-9\\.]+)(-[0-9\\.]+)?", + "target": "$1" + } + } + ], + "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": 365, + "base_branches": ["1.21"] +} diff --git a/.github/json/config-latest-1.21.json b/.github/json/config-latest-1.21.json new file mode 100644 index 0000000..3ebbf9f --- /dev/null +++ b/.github/json/config-latest-1.21.json @@ -0,0 +1,35 @@ +{ + "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": 365, + "base_branches": ["1.21"] +} diff --git a/.github/workflows/auto-build.yml b/.github/workflows/auto-build.yml index 59e4e89..2a592df 100644 --- a/.github/workflows/auto-build.yml +++ b/.github/workflows/auto-build.yml @@ -2,7 +2,7 @@ name: Latest Build on: push: - branches: ['26.1'] + branches: ['26.1', '1.21'] paths: ['src/**', '**/*.gradle', 'gradle.properties'] concurrency: @@ -53,7 +53,7 @@ jobs: if: ${{ env.PUBLISH == 'true' }} uses: mikepenz/release-changelog-builder-action@v5 with: - configuration: "./.github/json/config-latest.json" + configuration: "./.github/json/config-latest${{ contains(github.ref_name, '1.21') && '-1.21' || '' }}.json" toTag: ${{ github.ref }} fetchViaCommits: true failOnError: false diff --git a/.github/workflows/publish-on-release.yml b/.github/workflows/publish-on-release.yml index ecd72fb..0d8a2a4 100644 --- a/.github/workflows/publish-on-release.yml +++ b/.github/workflows/publish-on-release.yml @@ -23,9 +23,10 @@ jobs: id: changelog env: GITHUB_TOKEN: ${{ github.token }} + CONFIG: ${{ contains(github.ref_name, '1.21') && '-1.21' || '' }} uses: mikepenz/release-changelog-builder-action@v5 with: - configuration: './.github/json/config.json' + configuration: './.github/json/config${{ env.CONFIG }}.json' ignorePreReleases: true fetchViaCommits: true failOnError: true @@ -41,4 +42,17 @@ jobs: tag-name: ${{ github.ref_name }} version: '26.1' release-body: ${{ github.event.release.body }} - changelog-body: ${{ needs.meta.outputs.CHANGELOG }} \ No newline at end of file + changelog-body: ${{ needs.meta.outputs.CHANGELOG }} + + publish-21: + name: '1.21.1' + needs: [ meta ] + if: ${{ contains(github.ref_name, '1.21') }} + secrets: inherit + uses: ./.github/workflows/publish.yml + with: + simulate: ${{ startsWith(github.event.release.name, 'simulate') || github.repository_owner != 'ModularMCLib' }} + tag-name: ${{ github.ref_name }} + version: '1.21' + release-body: ${{ github.event.release.body }} + changelog-body: ${{ needs.meta.outputs.CHANGELOG }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 7e5bf0a..5f5679b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -11,7 +11,7 @@ on: required: true type: string version: - description: 'Version identifier;' + description: 'Version identifier; 26.1 or 1.21' required: true type: string release-body: @@ -36,11 +36,11 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.branch }} + ref: ${{ inputs.tag-name }} - name: Setup Build uses: ./.github/actions/build_setup with: - ref: ${{ inputs.branch }} + ref: ${{ inputs.tag-name }} - name: Grant execute permission for gradlew run: chmod +x gradlew - name: Get Version @@ -158,7 +158,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - ref: ${{ inputs.branch }} + ref: ${{ inputs.version }} - name: Bump Version run: | git config user.name 'github-actions[bot]' @@ -169,8 +169,10 @@ jobs: git commit -am "Bump version to ${BUMPED}" - name: Prepend to CHANGELOG if: inputs.changelog-body + env: + CHANGELOG_BODY: ${{ inputs.changelog-body }} run: | - { head -n 2 CHANGELOG.md; echo -e "${{ inputs.changelog-body }}"; tail -n +3 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md + { head -n 2 CHANGELOG.md; printf '%s\n' "$CHANGELOG_BODY"; tail -n +3 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md git commit -am "Updated CHANGELOG" - name: Push and PR env: diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 4890463..f3debe9 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -12,12 +12,14 @@ jobs: GH_TOKEN: ${{ github.token }} steps: - uses: actions/checkout@v4 + with: + ref: '1.21' - run: | git config user.name 'github-actions[bot]' git config user.email '41898282+github-actions[bot]@users.noreply.github.com' git switch -C gh/workflow-sync git fetch origin git checkout origin/26.1 -- .github - git add .github - git commit --allow-empty -m "Sync Workflows" + 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 26.1 [no-snapshot]" --body "Created by GH Workflow" --label "ignore changelog" diff --git a/.github/workflows/update-gradle-cache.yml b/.github/workflows/update-gradle-cache.yml index 1146b6b..51fd9f7 100644 --- a/.github/workflows/update-gradle-cache.yml +++ b/.github/workflows/update-gradle-cache.yml @@ -3,7 +3,7 @@ name: Update Gradle Cache on: push: - branches: ['26.1'] + branches: ['26.1', '1.21'] paths: ['gradle/**', '**/*.gradle', 'gradle.properties', 'gradlew*', 'src/main/resources/META-INF/accesstransformer.cfg'] workflow_dispatch: