Skip to content
This repository was archived by the owner on Dec 30, 2022. It is now read-only.

Commit f7bfb1d

Browse files
committed
Make ready for first alpha
- Added icon - Added Modrinth publish workflow
1 parent 5b7bc00 commit f7bfb1d

5 files changed

Lines changed: 70 additions & 62 deletions

File tree

.github/workflows/publish.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Publish to Modrinth
2+
on:
3+
push:
4+
branches:
5+
- master
6+
7+
jobs:
8+
build:
9+
strategy:
10+
matrix:
11+
java: [
12+
16
13+
]
14+
os: [ ubuntu-latest ]
15+
runs-on: ${{ matrix.os }}
16+
steps:
17+
- name: checkout repository
18+
uses: actions/checkout@v2
19+
- name: validate gradle wrapper
20+
uses: gradle/wrapper-validation-action@v1
21+
- name: setup jdk ${{ matrix.java }}
22+
uses: actions/setup-java@v1
23+
with:
24+
java-version: ${{ matrix.java }}
25+
- name: make gradle wrapper executable
26+
run: chmod +x ./gradlew
27+
- name: build
28+
run: ./gradlew build
29+
- name: Publish artifacts to Modrinth
30+
run: ./gradlew publishModrinth

build.gradle

Lines changed: 37 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
//file:noinspection GroovyAssignabilityCheck
22
//file:noinspection GroovyAccessibility
33
plugins {
4-
id "fabric-loom" version "0.9-SNAPSHOT"
5-
id "maven-publish"
4+
id "fabric-loom" version "0.9-SNAPSHOT"
5+
id "com.modrinth.minotaur" version "1.2.1"
66
}
77

88
sourceCompatibility = JavaVersion.VERSION_16
@@ -13,83 +13,60 @@ version = project.mod_version
1313
group = project.maven_group
1414

1515
repositories {
16-
maven {
17-
name = "TerraformersMC"
18-
url = "https://maven.terraformersmc.com/releases/"
19-
}
16+
maven {
17+
name = "TerraformersMC"
18+
url = "https://maven.terraformersmc.com/releases/"
19+
}
2020
}
2121

2222
dependencies {
23-
minecraft "com.mojang:minecraft:${project.minecraft_version}"
24-
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
25-
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
23+
minecraft "com.mojang:minecraft:${project.minecraft_version}"
24+
mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2"
25+
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"
2626

27-
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
27+
modImplementation "com.terraformersmc:modmenu:${project.modmenu_version}"
2828
}
2929

3030
processResources {
31-
inputs.property "version", project.version
32-
inputs.property "modmenu_version", project.modmenu_version
31+
inputs.property "version", project.version
32+
inputs.property "modmenu_version", project.modmenu_version
3333

34-
filesMatching("fabric.mod.json") {
35-
expand project.properties
36-
}
34+
filesMatching("fabric.mod.json") {
35+
expand project.properties
36+
}
3737
}
3838

3939
tasks.withType(JavaCompile).configureEach {
40-
it.options.encoding = "UTF-8"
41-
// Minecraft 1.17 (21w19a) upwards uses Java 16.
42-
it.options.release = 16
40+
it.options.encoding = "UTF-8"
41+
// Minecraft 1.17 (21w19a) upwards uses Java 16.
42+
it.options.release = 16
4343
}
4444

4545
java {
46-
withSourcesJar()
46+
withSourcesJar()
4747
}
4848

4949
jar {
50-
from("LICENSE") {
51-
rename { "${it}_${project.archivesBaseName}"}
52-
}
50+
from("LICENSE") {
51+
rename { "${it}_${project.archivesBaseName}" }
52+
}
5353
}
5454

55-
/*
56-
* Copyright 2021 DeathsGun
57-
*
58-
* Licensed under the Apache License, Version 2.0 (the "License");
59-
* you may not use this file except in compliance with the License.
60-
* You may obtain a copy of the License at
61-
*
62-
* http://www.apache.org/licenses/LICENSE-2.0
63-
*
64-
* Unless required by applicable law or agreed to in writing, software
65-
* distributed under the License is distributed on an "AS IS" BASIS,
66-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
67-
* See the License for the specific language governing permissions and
68-
* limitations under the License.
69-
*/
55+
import com.modrinth.minotaur.TaskModrinthUpload
56+
import com.modrinth.minotaur.request.VersionType
57+
import com.modrinth.minotaur.request.Dependency
7058

71-
// configure the maven publication
72-
publishing {
73-
publications {
74-
mavenJava(MavenPublication) {
75-
artifact(remapJar) {
76-
builtBy remapJar
77-
}
78-
artifact(sourcesJar) {
79-
builtBy remapSourcesJar
80-
}
81-
}
82-
}
59+
task publishModrinth(type: TaskModrinthUpload) {
60+
onlyIf {
61+
System.getenv("MODRINTH")
62+
}
8363

84-
repositories {
85-
mavenLocal()
86-
maven {
87-
url = "http://vault:8081/repository/maven-snapshots/"
88-
allowInsecureProtocol true
89-
credentials {
90-
username "buildtool"
91-
password project.hasProperty("buildtools_pw") ? project.buildtools_pw : ""
92-
}
93-
}
94-
}
64+
token = System.getenv("MODRINTH")
65+
projectId = '6kq7BzRK'
66+
versionNumber = version
67+
uploadFile = remapJar
68+
versionType = VersionType.ALPHA
69+
addGameVersion(project.minecraft_version)
70+
addLoader('fabric')
71+
addDependency("E4QBMVtO", Dependency.DependencyType.REQUIRED)
9572
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ minecraft_version=1.17.1
2222
yarn_mappings=1.17.1+build.39
2323
loader_version=0.11.6
2424
# Mod Properties
25-
mod_version=1.0.0-SNAPSHOT
25+
mod_version=1.0.0-alpha
2626
maven_group=xyz.deathsgun
2727
archives_base_name=modmanager
2828
# Dependencies
321 Bytes
Loading

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
"DeathsGun"
99
],
1010
"contact": {
11-
"homepage": "https://github.com/DeathsGun/ModManager",
11+
"homepage": "https://modrinth.com/mod/modmanager",
1212
"sources": "https://github.com/DeathsGun/ModManager",
1313
"issues": "https://github.com/DeathsGun/ModManager/issues"
1414
},
15+
"icon": "assets/modmanager/icon.png",
1516
"license": "APL-2.0",
1617
"environment": "client",
1718
"entrypoints": {

0 commit comments

Comments
 (0)