Skip to content

Commit

Permalink
clean
Browse files Browse the repository at this point in the history
  • Loading branch information
TexBlock committed Sep 15, 2024
1 parent 0a7099b commit 860e2dd
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 31 deletions.
48 changes: 25 additions & 23 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
name: build
on: [pull_request, push]
name: Build

on: [ push, pull_request, workflow_dispatch ]

jobs:
build:
strategy:
matrix:
java: [17]
os: [ubuntu-20.04, windows-latest]
runs-on: ${{ matrix.os }}
Build:
runs-on: ubuntu-latest

steps:
- name: checkout repository
uses: actions/checkout@v2
- name: validate gradle wrapper
uses: gradle/wrapper-validation-action@v1
- name: setup jdk ${{ matrix.java }}
uses: actions/setup-java@v1
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Cache
uses: actions/cache@v4
with:
java-version: ${{ matrix.java }}
- name: make gradle wrapper executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
- name: build
run: ./gradlew build
- name: capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- name: Build with Gradle
run: |
chmod +x gradlew
./gradlew build
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: build/libs/
path: ${{ github.workspace }}/build/libs
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish Release

on:
workflow_dispatch:
release:
types:
- published

permissions:
contents: write

jobs:
Build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 17
- name: Cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties', 'build.gradle') }}
- uses: gradle/actions/wrapper-validation@v3
- run: |
chmod +x gradlew
./gradlew build publishMod --stacktrace -Porg.gradle.parallel.threads=4
env:
CURSEFORGE_TOKEN: ${{ secrets.CURSEFORGE_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
MODRINTH_TOKEN: ${{ secrets.MODRINTH_TOKEN }}
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
### Change
- port to neoforge
31 changes: 26 additions & 5 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
plugins {
id "dev.architectury.loom" version "1.7-SNAPSHOT"
id "com.hypherionmc.modutils.modpublisher" version "2.+"
}

sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

archivesBaseName = project.archives_base_name
base.archivesName = project.archives_base_name
version = project.mod_version
group = project.maven_group

Expand Down Expand Up @@ -37,11 +35,34 @@ tasks.withType(JavaCompile).configureEach {
}

java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17

toolchain.languageVersion = JavaLanguageVersion.of(17)

withSourcesJar()
}

jar {
from("LICENSE") {
rename { "${it}_${project.archivesBaseName}"}
rename { "${it}_${base.getArchivesName()}"}
}
}

publisher {
apiKeys {
modrinth System.getenv("MODRINTH_TOKEN")
curseforge System.getenv("CURSEFORGE_TOKEN")
}

setCurseID("${project.curseforge_id}")
setModrinthID("${project.modrinth_id}")
setVersionType("alpha")
setChangelog(file("CHANGELOG.md").getText("UTF-8"))
setVersion("${project.version}")
setDisplayName("${project.version}")
setGameVersions("1.20.4")
setLoaders("neoforge")
setArtifact(remapJar)
addAdditionalFile(sourcesJar)
}
9 changes: 6 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ minecraft_version=1.20.4
yarn_mappings=1.20.4+build.3
neoforge_version=20.4.237

mod_version = 0.0.1+1.20.4
maven_group = io.github.foundationgames
archives_base_name = animatica
mod_version = 0.1.0+1.20.4
maven_group = org.thinkingstudio
archives_base_name = AnimaticaFoxified

curseforge_id=1103129
modrinth_id=nrSnNUz4

1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ pluginManagement {
maven { url "https://maven.fabricmc.net/" }
maven { url "https://maven.architectury.dev/" }
maven { url "https://maven.neoforged.net/releases/" }
maven { url "https://maven.firstdark.dev/releases/" }
gradlePluginPortal()
}
}

0 comments on commit 860e2dd

Please sign in to comment.