Allow non-1.20.1 or 1.21 branch releases#4748
Conversation
| 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.
This comment was marked as outdated.
Sorry, something went wrong.
| name: Metadata | ||
| runs-on: ubuntu-latest | ||
| outputs: | ||
| CHANGELOG: ${{ steps.changelog.outputs.changelog }} |
There was a problem hiding this comment.
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' |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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' }} |
There was a problem hiding this comment.
1.21 files published as betas to Modrinth but as alphas to curse. oops?
They should probably be alphas on both, right?
.github/workflows/publish.yml
Outdated
| 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' }} |
There was a problem hiding this comment.
| 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' }} |
There was a problem hiding this comment.
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.
| 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' }} |
There was a problem hiding this comment.
| 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' |
There was a problem hiding this comment.
| description: 'Version identifier; 1.20.1 or 1.21' | |
| description: 'Version identifier; 1.20.1 or 1.21.1' |
htmlcsjs
left a comment
There was a problem hiding this comment.
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
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