-
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7eb8a80
commit 2ec8b48
Showing
55 changed files
with
559 additions
and
448 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
name: publish-release | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
bump: | ||
description: 'The bump in version for this release' | ||
required: true | ||
type: choice | ||
default: patch | ||
options: | ||
- major | ||
- minor | ||
- patch | ||
|
||
jobs: | ||
create-release: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
ref: v${{ steps.bump-version.outputs.version }} | ||
version: ${{ steps.bump-version.outputs.version }} | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Extracting version from properties | ||
shell: bash | ||
run: echo "version=$(cat gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT | ||
id: extract-version | ||
- name: Bumping version | ||
uses: TwelveIterationMods/bump-version@v1 | ||
with: | ||
version: ${{ steps.extract-version.outputs.version }} | ||
bump: ${{ inputs.bump }} | ||
id: bump-version | ||
- name: Updating version properties | ||
run: | | ||
sed -i "s/^\s*version\s*=.*/version = ${{ steps.bump-version.outputs.version }}/g" gradle.properties | ||
git config user.name "GitHub Actions" | ||
git config user.email "<>" | ||
git commit -am "Set version to ${{ steps.bump-version.outputs.version }}" | ||
git push origin ${BRANCH_NAME} | ||
git tag -a "v${{ steps.bump-version.outputs.version }}" -m "Release ${{ steps.bump-version.outputs.version }}" | ||
git push origin "v${{ steps.bump-version.outputs.version }}" | ||
shell: bash | ||
env: | ||
BRANCH_NAME: ${{ github.head_ref || github.ref_name }} | ||
publish-release: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
strategy: | ||
matrix: | ||
loader: [ common, fabric, forge, neoforge ] | ||
site: [ curseforge, modrinth, publish ] | ||
exclude: | ||
- loader: common | ||
site: curseforge | ||
- loader: common | ||
site: modrinth | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ needs.create-release.outputs.ref }} | ||
- name: Validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 21 | ||
distribution: temurin | ||
- name: Make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: Publish | ||
run: ./gradlew :${{ matrix.loader }}:${{ matrix.site }} '-Pversion=${{needs.create-release.outputs.version}}' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}' | ||
env: | ||
CURSEFORGE_TOKEN: ${{secrets.CURSEFORGE_TOKEN}} | ||
MODRINTH_TOKEN: ${{secrets.MODRINTH_TOKEN}} | ||
needs: create-release |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: publish-snapshot | ||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish-snapshot: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
packages: write | ||
strategy: | ||
matrix: | ||
loader: [common, fabric, forge, neoforge] | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
- name: Validate gradle wrapper | ||
uses: gradle/wrapper-validation-action@v1 | ||
- name: Setup JDK | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: 21 | ||
distribution: temurin | ||
- name: Make gradle wrapper executable | ||
run: chmod +x ./gradlew | ||
- name: Extracting version from properties | ||
shell: bash | ||
run: echo "version=$(cat gradle.properties | grep -w "\bversion" | cut -d= -f2)" >> $GITHUB_OUTPUT | ||
id: extract-version | ||
- name: Bumping version | ||
uses: TwelveIterationMods/bump-version@v1 | ||
with: | ||
version: ${{ steps.extract-version.outputs.version }} | ||
bump: minor | ||
id: bump-version | ||
- name: Publish | ||
run: ./gradlew :${{ matrix.loader }}:publish '-Pversion=${{ steps.bump-version.outputs.version }}-SNAPSHOT' '-PtwelveIterationsNexusUsername=${{ secrets.NEXUS_USER }}' '-PtwelveIterationsNexusPassword=${{ secrets.NEXUS_PASSWORD }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
Updated to Minecraft 1.20.6 | ||
|
||
- Increased mixin priority to possibly support some additional mods in extra default configs | ||
- Fixed difficulty resetting to default even if it was already changed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
plugins { | ||
id 'groovy-gradle-plugin' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,123 @@ | ||
plugins { | ||
id 'java-library' | ||
id 'maven-publish' | ||
} | ||
|
||
base { | ||
archivesName = "${mod_id}-${project.name}" | ||
version = "${version}+${minecraft_version}" | ||
} | ||
|
||
java { | ||
toolchain.languageVersion = JavaLanguageVersion.of(java_version) | ||
withSourcesJar() | ||
withJavadocJar() | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
// https://docs.gradle.org/current/userguide/declaring_repositories.html#declaring_content_exclusively_found_in_one_repository | ||
exclusiveContent { | ||
forRepository { | ||
maven { | ||
name = 'Sponge' | ||
url = 'https://repo.spongepowered.org/repository/maven-public' | ||
} | ||
} | ||
filter { includeGroupAndSubgroups("org.spongepowered") } | ||
} | ||
maven { url "https://maven.twelveiterations.com/repository/maven-public/" } | ||
} | ||
|
||
dependencies { | ||
implementation 'org.jetbrains:annotations:24.1.0' | ||
} | ||
|
||
// Declare capabilities on the outgoing configurations. | ||
// Read more about capabilities here: https://docs.gradle.org/current/userguide/component_capabilities.html#sec:declaring-additional-capabilities-for-a-local-component | ||
['apiElements', 'runtimeElements', 'sourcesElements', 'javadocElements'].each { variant -> | ||
configurations."$variant".outgoing { | ||
capability("$group:$mod_id-${project.name}:$version") | ||
capability("$group:$mod_id:$version") | ||
} | ||
publishing.publications.configureEach { | ||
suppressPomMetadataWarningsFor(variant) | ||
} | ||
} | ||
|
||
sourcesJar { | ||
from(rootProject.file("LICENSE")) { | ||
rename { "${it}_${mod_name}" } | ||
} | ||
} | ||
|
||
jar { | ||
from(rootProject.file("LICENSE")) { | ||
rename { "${it}_${mod_name}" } | ||
} | ||
|
||
manifest { | ||
attributes([ | ||
'Specification-Title' : mod_name, | ||
'Specification-Vendor' : mod_author, | ||
'Specification-Version' : project.jar.archiveVersion, | ||
'Implementation-Title' : project.name, | ||
'Implementation-Version': project.jar.archiveVersion, | ||
'Implementation-Vendor' : mod_author, | ||
'Built-On-Minecraft' : minecraft_version | ||
]) | ||
} | ||
} | ||
|
||
processResources { | ||
def expandProps = [ | ||
"version": version, | ||
"group": project.group, //Else we target the task's group. | ||
"minecraft_version": minecraft_version, | ||
"forge_version": forge_version, | ||
"forge_loader_version_range": forge_loader_version_range, | ||
"forge_version_range": forge_version_range, | ||
"minecraft_version_range": minecraft_version_range, | ||
"fabric_version": fabric_version, | ||
"fabric_loader_version": fabric_loader_version, | ||
"mod_name": mod_name, | ||
"mod_author": mod_author, | ||
"mod_id": mod_id, | ||
"license": license, | ||
"description": project.description, | ||
"neoforge_version": neoforge_version, | ||
"neoforge_version_range": neoforge_version_range, | ||
"neoforge_loader_version_range": neoforge_loader_version_range, | ||
"credits": credits, | ||
"java_version": java_version, | ||
"pack_format_number": pack_format_number, | ||
"homepage": homepage, | ||
"issues": issues, | ||
"sources": sources, | ||
"balm_version_range": balm_version_range, | ||
] | ||
|
||
filesMatching(['pack.mcmeta', 'fabric.mod.json', 'META-INF/mods.toml', 'META-INF/neoforge.mods.toml', '*.mixins.json']) { | ||
expand expandProps | ||
} | ||
inputs.properties(expandProps) | ||
} | ||
|
||
publishing { | ||
publications { | ||
register('mavenJava', MavenPublication) { | ||
version = project.version + (!project.version.endsWith("SNAPSHOT") ? "+" + minecraft_version : "") | ||
artifactId base.archivesName.get() | ||
from components.java | ||
} | ||
} | ||
repositories { | ||
maven { | ||
var releasesRepoUrl = "https://maven.twelveiterations.com/repository/maven-releases/" | ||
var snapshotsRepoUrl = "https://maven.twelveiterations.com/repository/maven-snapshots/" | ||
url = uri(version.toString().endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl) | ||
name = "twelveIterationsNexus" | ||
credentials(PasswordCredentials) | ||
} | ||
} | ||
} |
Oops, something went wrong.