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
69 changes: 0 additions & 69 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

5 changes: 2 additions & 3 deletions .github/workflows/main.yml → .github/workflows/maven.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This is a basic workflow to help you get started with Actions

name: CI
name: Publish to Maven Repository.

# Controls when the action will run.
on: [workflow_dispatch]
Expand All @@ -25,6 +25,5 @@ jobs:
- name: Publish package
run: gradle publish --no-daemon
env:
MAVEN_USER: ${{ secrets.MAVEN_USER }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
MAVEN_PASSWORD: ${{ secrets.REDLANCE_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
159 changes: 159 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,159 @@
name: Publish on Modrinth & CurseForge

on:
workflow_dispatch:
secrets:
CURSEFORGE_TOKEN:
required: true
MODRINTH_TOKEN:
required: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Branch
uses: actions/checkout@v3

- name: Get Artifact Id
uses: actions/github-script@v5
env:
branch: ${{ github.head_ref || github.ref_name }}
id: artifact_id
with:
result-encoding: string
script: |
// use env branch replace / with _
return process.env.branch.replace(/\//g, '_')

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: 21

- name: Grant Execute Permission
run: chmod +x gradlew

- name: Build
run: |
./gradlew build

- name: Upload To Artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ steps.artifact_id.outputs.result }}
path: |
./dist/**/*
./fabric/build/libs
./neoforge/build/libs
./gradle.properties

deploy:
runs-on: ubuntu-latest
needs:
- build
steps:
- name: Checkout Branch
uses: actions/checkout@v3

- name: Get Artifact Id
uses: actions/github-script@v5
env:
branch: ${{ github.head_ref || github.ref_name }}
id: artifact_id
with:
result-encoding: string
script: |
// use env branch replace / with _
return process.env.branch.replace(/\//g, '_')

- name: Download Artifacts
uses: actions/download-artifact@v4
with:
name: ${{ steps.artifact_id.outputs.result }}

- name: Load Gradle Properties
uses: christian-draeger/read-properties@1.1.1
id: gradle_properties
with:
path: './gradle.properties'
properties: 'java_version minecraft_version mod_version'

- name: Check For Fabric Jar
uses: actions/github-script@v5
id: fabric_release
with:
result-encoding: string
script: |
const fs = require("fs")
return fs.readdirSync("./fabric/build/libs")[0] || false;

- name: Check For Forge Jar
uses: actions/github-script@v5
id: forge_release
with:
result-encoding: string
script: |
const fs = require("fs")
return fs.readdirSync("./neoforge/build/libs")[0] || false;

- name: Run Publish Fabric
if: ${{ steps.fabric_release.outputs.result != 'false' }}
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: OI3FlFon
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: false
modrinth-unfeature-mode: any

curseforge-id: 1302303
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

name: ${{ steps.gradle_properties.outputs.mod_version }}+${{ steps.gradle_properties.outputs.minecraft_version }}-Fabric
version: ${{ steps.gradle_properties.outputs.mod_version }}

files: |
./fabric/build/libs/!(*-@(dev|sources|javadoc|all|dev-shadow)).jar
./fabric/build/libs/*-@(dev|sources|javadoc|all|dev-shadow).jar
version-type: release

loaders: fabric
game-versions: ${{ steps.gradle_properties.outputs.minecraft_version }}

changelog-file: CHANGELOG.md

java: ${{ steps.gradle_properties.outputs.java_version }}
retry-attempts: 5
retry-delay: 60000
fail-mode: skip

- name: Run Publish Forge
if: ${{ steps.forge_release.outputs.result != 'false' }}
uses: Kir-Antipov/mc-publish@v3.3
with:
modrinth-id: OI3FlFon
modrinth-token: ${{ secrets.MODRINTH_TOKEN }}
modrinth-featured: false
modrinth-unfeature-mode: any

curseforge-id: 1302303
curseforge-token: ${{ secrets.CURSEFORGE_TOKEN }}

name: ${{ steps.gradle_properties.outputs.mod_version }}+${{ steps.gradle_properties.outputs.minecraft_version }}-NeoForge
version: ${{ steps.gradle_properties.outputs.mod_version }}

files: |
./neoforge/build/libs/!(*-@(dev|sources|javadoc|all|dev-shadow)).jar
./neoforge/build/libs/*-@(dev|sources|javadoc|all|dev-shadow).jar
version-type: release

loaders: neoforge
game-versions: ${{ steps.gradle_properties.outputs.minecraft_version }}

changelog-file: CHANGELOG.md

java: ${{ steps.gradle_properties.outputs.java_version }}
retry-attempts: 5
retry-delay: 60000
fail-mode: skip
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ classes/
.metadata
.vscode
.settings
*.launch
*.launch
.DS_Store
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
RELEASE!
78 changes: 40 additions & 38 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
id "com.github.johnrengelman.shadow" version "8.1.1" apply false
id "com.gradleup.shadow" version "8.3.8" apply false
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.9-SNAPSHOT" apply false
id "dev.architectury.loom" version "1.10-SNAPSHOT" apply false
}

architectury {
Expand All @@ -15,30 +15,12 @@ subprojects {
silentMojangMappingsLicense()
}

repositories {
maven {
name = "Modrinth"
url = "https://api.modrinth.com/maven"
content {
includeGroup "maven.modrinth"
}
}
maven {
name "zigythebirdMods"
url "https://maven.zigythebird.com/mods"
}
maven {
name = 'GeckoLib'
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
content {
includeGroup("software.bernie.geckolib")
}
}
}

dependencies {
minecraft "com.mojang:minecraft:${rootProject.minecraft_version}"
mappings loom.officialMojangMappings()
mappings loom.layered() {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-1.21.6:${rootProject.parchment_version}@zip")
}
}
}

Expand All @@ -47,12 +29,26 @@ allprojects {
apply plugin: "architectury-plugin"
apply plugin: "maven-publish"

archivesBaseName = rootProject.archives_base_name
version = rootProject.mod_version
base.archivesName = rootProject.archives_base_name
version = "${rootProject.mod_version}+mc${rootProject.minecraft_version}"
group = rootProject.maven_group

repositories {
maven { url "https://maven.neoforged.net/releases" }
// Fix issue with lwjgl-freetype not being found on macOS
maven {
url = "https://libraries.minecraft.net"
content {
includeModule("org.lwjgl", "lwjgl-freetype")
}
}
maven {
name = "NeoForged"
url = "https://maven.neoforged.net/releases"
}
maven {
name = "RedlanceMinecraft"
url = "https://repo.redlance.org/public"
}
mavenLocal()
}

Expand All @@ -61,19 +57,25 @@ allprojects {
options.release.set 21
}

jar {
if (!rootProject.version.toString().contains("dev") && !project.gradle.startParameter.taskNames.contains("runClient"))
processResources.exclude('assets/bendable_cuboids/player_animations/*')
}

java {
withSourcesJar()
}
}

project.ext.keys = new Properties()
ext.ENV = System.getenv()
ext.keysExists = ENV.MAVEN_PASS != null
if (keysExists) {
project.ext.keys.kosmx_maven = ENV.MAVEN_PASS
project.ext.keys.maven_user = ENV.MAVEN_USER
} else {
project.ext.keys.kosmx_maven = "V2h5IGRpZCB5b3UgZGVjb2RlIGl0PyAg"
project.ext.keys.maven_user = "username"
publishing {
repositories {
maven {
name = "RedlanceMinecraft"
url = "https://repo.redlance.org/public"
credentials {
username = "dima_dencep"
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}
}

Loading