Skip to content

Allow non-1.20.1 or 1.21 branch releases#4748

Merged
jurrejelle merged 2 commits into1.20.1from
jj/fix-release-branches
Mar 24, 2026
Merged

Allow non-1.20.1 or 1.21 branch releases#4748
jurrejelle merged 2 commits into1.20.1from
jj/fix-release-branches

Conversation

@jurrejelle
Copy link
Contributor

What

Allow non-1.20.1 or 1.21 releases

Implementation Details

Pass the tag name to the publish action and do most stuff based on that instead of version number
It does still make the version bump / changelog PR to/from the 1.20.1 or 1.21 branch bcs idt it can do that off of tags since they're not branches

How Was This Tested

Not, needs to be tested still somehow? Also needs like 4x review before we mess up another release lol

@jurrejelle jurrejelle requested a review from a team as a code owner March 22, 2026 21:49
@jurrejelle jurrejelle added ignore changelog PR should not be added to the changelog. type: bugfix General bug fixes 1.20.1 Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. labels Mar 22, 2026
simulate: ${{ startsWith(github.event.release.name, 'simulate') || github.repository_owner != 'GregTechCEu' }}
branch: '1.20.1'
tag-name: ${{ github.ref_name }}
version: '1.20.1'

This comment was marked as outdated.

name: Metadata
runs-on: ubuntu-latest
outputs:
CHANGELOG: ${{ steps.changelog.outputs.changelog }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add this after CHANGELOG:

      VERSION: ${{ (contains(github.ref_name, '1.21') || !contains(github.ref_name, '1.20.1')) && '1.21.1' || '1.20.1' }}

CONFIG: ${{ contains(github.ref_name, '1.21') && '-1.21' || '' }}
uses: mikepenz/release-changelog-builder-action@v5
with:
configuration: './.github/json/config${{ env.CONFIG }}.json'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the files in .github/json/config/ should probably be changed so that the 1.20 branch only contains 1.20's files (and vice versa).
That way that CONFIG value doesn't need to exist and that directory wouldn't be nearly as odd-looking as it is now

fetchViaCommits: true
failOnError: true

publish-20:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This replaces both publish-20 and publish-21. It also requires adding the third suggestion.
I can't format it as a proper suggestion because github doesn't like adding suggestions to unchanged lines.

  publish:
    name: Publish
    needs: [ meta ]
    secrets: inherit
    uses: ./.github/workflows/publish.yml
    with:
      simulate: ${{ startsWith(github.event.release.name, 'simulate') || github.repository_owner != 'GregTechCEu' }}
      tag-name: ${{ github.ref_name }}
      version: ${{ needs.meta.outputs.VERSION }}
      release-body: ${{ github.event.release.body }}
      changelog-body: ${{ needs.meta.outputs.CHANGELOG }}

MC_VERSION: ${{ inputs.version == '1.21' && '1.21.1' || '1.20.1' }}
LOADER: ${{ inputs.version == '1.21' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21' && 'alpha' || 'beta' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1.21 files published as betas to Modrinth but as alphas to curse. oops?
They should probably be alphas on both, right?

Comment on lines +95 to +98
MC_VERSION: ${{ inputs.version == '1.21' && '1.21.1' || '1.20.1' }}
LOADER: ${{ inputs.version == '1.21' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21' && 'beta' || 'beta' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MC_VERSION: ${{ inputs.version == '1.21' && '1.21.1' || '1.20.1' }}
LOADER: ${{ inputs.version == '1.21' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21' && 'beta' || 'beta' }}
MC_VERSION: ${{ inputs.version }}
LOADER: ${{ inputs.version == '1.21.1' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21.1' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21.1' && 'alpha' || 'beta' }}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

MC_VERSION is just inputs.version now because the suggestion in the meta job in publish-on-release makes the 1.21 branch have its version set to 1.21.1 by default.

Comment on lines +128 to +131
MC_VERSION: ${{ inputs.version == '1.21' && '1.21.1' || '1.20.1' }}
LOADER: ${{ inputs.version == '1.21' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21' && 'alpha' || 'beta' }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
MC_VERSION: ${{ inputs.version == '1.21' && '1.21.1' || '1.20.1' }}
LOADER: ${{ inputs.version == '1.21' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21' && 'alpha' || 'beta' }}
MC_VERSION: ${{ inputs.version }}
LOADER: ${{ inputs.version == '1.21.1' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.version == '1.21.1' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.version == '1.21.1' && 'alpha' || 'beta' }}

tag-name:
description: 'Tag to upload to'
version:
description: 'Version identifier; 1.20.1 or 1.21'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
description: 'Version identifier; 1.20.1 or 1.21'
description: 'Version identifier; 1.20.1 or 1.21.1'

Copy link
Member

@htmlcsjs htmlcsjs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on a fork at https://github.com/IssueFloppa/GregTech-Modern, Worked but need to make sure to propagate this change to any tags we are releasing from

@jurrejelle jurrejelle merged commit a72bf74 into 1.20.1 Mar 24, 2026
4 checks passed
@jurrejelle jurrejelle deleted the jj/fix-release-branches branch March 24, 2026 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.20.1 ignore changelog PR should not be added to the changelog. Release: Patch - 0.0.X Smaller changes that either are bug fixes or very minor tweaks. type: bugfix General bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants