Skip to content
Merged
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
6 changes: 3 additions & 3 deletions .github/actions/build_setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: 21
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'
45 changes: 45 additions & 0 deletions .github/json/config-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}})\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"]
}
35 changes: 35 additions & 0 deletions .github/json/config-latest-1.21.json
Original file line number Diff line number Diff line change
@@ -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"]
}
9 changes: 5 additions & 4 deletions .github/workflows/auto-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Latest Build

on:
push:
branches: ['26.1']
branches: ['26.1', '1.21']
paths: ['src/**', '**/*.gradle', 'gradle.properties']

concurrency:
Expand All @@ -27,8 +27,6 @@ jobs:
fetch-depth: 0 # do a full checkout instead of a shallow clone of HEAD so spotless's ratchetFrom works
- name: Setup Build
uses: ./.github/actions/build_setup
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Get Mod Version
id: ver
run: echo "version=$(./gradlew -q printVersion)" >> $GITHUB_OUTPUT
Expand All @@ -37,6 +35,9 @@ jobs:
run: echo "VERSION_SUFFIX=$(echo "${{ github.sha }}" | cut -c 1-7)" >> $GITHUB_ENV
- name: Build
run: ./gradlew build
- name: Publish to Maven
if: ${{ github.repository_owner == 'ModularMCLib' && env.PUBLISH == 'true' }}
run: ./gradlew publish
- 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;
Expand All @@ -53,7 +54,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
Expand Down
22 changes: 18 additions & 4 deletions .github/workflows/publish-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,22 +23,36 @@ 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

publish-26:
name: '26.1'
name: 26.1
needs: [ meta ]
if: ${{ contains(github.ref_name, '26.1') }}
if: ${{ contains(github.ref_name, '26.1') || !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: '26.1'
release-body: ${{ github.event.release.body }}
changelog-body: ${{ needs.meta.outputs.CHANGELOG }}
changelog-body: ${{ needs.meta.outputs.CHANGELOG }}

publish-21:
name: 1.21.1
needs: [ meta ]
if: ${{ contains(github.ref_name, '1.21') || !contains(github.ref_name, '26.1') }}
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 }}
14 changes: 7 additions & 7 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -36,13 +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 }}
- name: Grant execute permission for gradlew
run: chmod +x gradlew
ref: ${{ inputs.tag-name }}
- name: Get Version
id: ver
run: echo "version=$(./gradlew -q printVersion)" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -158,7 +156,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]'
Expand All @@ -169,8 +167,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:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
4 changes: 1 addition & 3 deletions .github/workflows/update-gradle-cache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -22,7 +22,5 @@ jobs:
uses: ./.github/actions/build_setup
with:
update-cache: true
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build Project with Gradle
run: ./gradlew assemble --warning-mode all