Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/json/config-title-only-1.21.json
Original file line number Diff line number Diff line change
@@ -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}})",
"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"]
}
45 changes: 45 additions & 0 deletions .github/json/config-title-only.json
Original file line number Diff line number Diff line change
@@ -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}})",
"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\\.20\\.1)?$).+$",
"flags": "gu"
},
"transformer": {
"pattern": "v?([0-9\\.]+)(-[0-9\\.]+)?",
"target": "$1"
}
},
"max_pull_requests": 1000,
"max_back_track_time_days": 365,
"base_branches": ["1.20.1"]
}
6 changes: 3 additions & 3 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
CONFIG: ${{ contains(github.ref_name, '1.21') && '-1.21' || '' }}
uses: mikepenz/release-changelog-builder-action@v5
with:
configuration: './.github/json/config${{ env.CONFIG }}.json'
configuration: './.github/json/config-title-only${{ env.CONFIG }}.json'
ignorePreReleases: true
fetchViaCommits: true
failOnError: true
Expand All @@ -42,7 +42,7 @@ jobs:
branch: '1.20.1'
tag-name: ${{ github.ref_name }}
release-body: ${{ github.event.release.body }}
changelog-body: ${{ needs.meta.outputs.CHANGELOG }}
changelog-title: ${{ needs.meta.outputs.CHANGELOG }}

publish-21:
name: 1.21.1
Expand All @@ -55,4 +55,4 @@ jobs:
branch: '1.21'
tag-name: ${{ github.ref_name }}
release-body: ${{ github.event.release.body }}
changelog-body: ${{ needs.meta.outputs.CHANGELOG }}
changelog-title: ${{ needs.meta.outputs.CHANGELOG }}
59 changes: 19 additions & 40 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ on:
required: true
type: string
release-body:
description: 'Body for published release notes'
description: 'Body for published release notes, also inserted into CHANGELOG.md'
required: false
type: string
changelog-body:
description: 'Body of change notes to insert into CHANGELOG.md'
changelog-title:
description: 'Title of change notes to insert into CHANGELOG.md'
required: false
type: string

Expand Down Expand Up @@ -78,8 +78,8 @@ jobs:
files: ./*.jar
fail_on_unmatched_files: true

publish-modrinth:
name: Publish to Modrinth
publish:
name: Publish to CF & Modrinth
needs: build
if: ${{ !inputs.simulate }}
runs-on: ubuntu-latest
Expand All @@ -98,41 +98,12 @@ jobs:
VERSION_TYPE: ${{ inputs.branch == '1.21' && 'beta' || 'beta' }}
uses: Kir-Antipov/mc-publish@v3.3.0
with:
curseforge-id: 890405
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

modrinth-id: 7tG215v7
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
files: |
./gtceu-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar
./!(gtceu-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar)
name: 'GregTech CEu ${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}'
version: 'mc${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}'
version-type: ${{ env.VERSION_TYPE }}
changelog: ${{ inputs.release-body }}
loaders: ${{ env.LOADER }}
java: ${{ env.JAVA }}
fail-mode: fail

publish-cf:
name: Publish to CF
needs: build
if: ${{ !inputs.simulate }}
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: build-artifacts-${{ inputs.branch }}
- name: Publish Mod
env:
MC_VERSION: ${{ inputs.branch == '1.21' && '1.21.1' || '1.20.1' }}
LOADER: ${{ inputs.branch == '1.21' && 'neoforge' || 'forge' }}
JAVA: ${{ inputs.branch == '1.21' && '21' || '17' }}
VERSION_TYPE: ${{ inputs.branch == '1.21' && 'alpha' || 'beta' }}
uses: Kir-Antipov/mc-publish@v3.3.0
with:
curseforge-id: 890405
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}
files: |
./gtceu-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar
./!(gtceu-${{ env.MC_VERSION }}-${{ needs.build.outputs.ver }}.jar)
Expand All @@ -142,7 +113,7 @@ jobs:
changelog: ${{ inputs.release-body }}
loaders: ${{ env.LOADER }}
java: ${{ env.JAVA }}
fail-mode: fail
fail-mode: skip

# After successful release, PR version bump and changelog
bump-version-and-changelog:
Expand All @@ -166,9 +137,17 @@ jobs:
sed -i "s/= ${{ needs.build.outputs.ver }}/= ${BUMPED}/" gradle.properties
git commit -am "Bump version to ${BUMPED}"
- name: Prepend to CHANGELOG
if: inputs.changelog-body
if: ${{ inputs.release-body && inputs.changelog-title }}
# Insert these into environment variables because using GitHub's input replacement with multi-line inputs will more often than not break the script, as they're inserted 'as-is'.
# e.g. if the input contains ` (backtick) characters, bash tries to use those backticks' contents as actual function input.
# Environment variables don't have that issue.
env:
RELEASE_BODY: ${{ inputs.release-body }}
CHANGELOG_TITLE: ${{ inputs.changelog-title }}
run: |
{ head -n 2 CHANGELOG.md; echo -e "${{ inputs.changelog-body }}"; tail -n +3 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md
BODY=$( echo -e "$RELEASE_BODY" | head -n -1 - | tail -n +2 - )

{ head -n 2 CHANGELOG.md; echo -e "$CHANGELOG_TITLE"; echo -e "$BODY"; tail -n +3 CHANGELOG.md; } > temp.md && mv temp.md CHANGELOG.md
git commit -am "Updated CHANGELOG"
- name: Push and PR
env:
Expand Down
Loading