Skip to content

Commit

Permalink
Publish to my maven
Browse files Browse the repository at this point in the history
Signed-off-by: shedaniel <daniel@shedaniel.me>
  • Loading branch information
shedaniel committed Feb 6, 2021
1 parent 00331c1 commit dcc303a
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 71 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/gradle.yml
Expand Up @@ -11,11 +11,8 @@ jobs:
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Upload to Bintray & Curseforge
run: ./gradlew clean bintrayUpload curseforge
- name: Upload to Maven & Curseforge
run: ./gradlew clean publish curseforge --stacktrace
env:
BINTRAY_USER: shedaniel
OSS_TOKEN: shedaniel
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
OSS_PASS: ${{ secrets.OSS_PASS }}
MAVEN_PASS: ${{ secrets.MAVEN_PASS }}
CF_API_KEY: ${{ secrets.CF_API_KEY }}
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -20,6 +20,7 @@
.idea
*.ipr
*.iws
.vscode/

# Sekrit files
private.properties
Expand Down
10 changes: 8 additions & 2 deletions README.md
@@ -1,8 +1,14 @@
# Cloth API
## Maven
```groovy
modApi "me.shedaniel.cloth.api:cloth-api:${project.cloth_api_version}"
include "me.shedaniel.cloth.api:cloth-api:${project.cloth_api_version}"
repositories {
maven { url "https://maven.shedaniel.me/" }
}
dependencies {
modApi "me.shedaniel.cloth.api:cloth-api:${project.cloth_api_version}"
include "me.shedaniel.cloth.api:cloth-api:${project.cloth_api_version}"
}
```
## APIs
#### cloth-armor-api-v1
Expand Down
89 changes: 33 additions & 56 deletions build.gradle
Expand Up @@ -3,18 +3,18 @@ plugins {
id 'eclipse'
id 'idea'
id 'maven-publish'
id 'fabric-loom' version '0.4-SNAPSHOT' apply false
id 'forgified-fabric-loom' version '0.6.64' apply false
id 'net.minecrell.licenser' version '0.4.1'
id "org.ajoberstar.grgit" version "3.1.1"
id 'com.matthewprenger.cursegradle' version "1.4.0"
id 'maven'
id 'signing'
id 'com.jfrog.bintray' version '1.8.4'
}

import net.fabricmc.loom.task.RunClientTask

version = project.mod_version
def runNumber = (System.getenv("GITHUB_RUN_NUMBER") == null ? "9999" : System.getenv("GITHUB_RUN_NUMBER"))
version = rootProject.base_version + "." + runNumber

logger.lifecycle("Building cloth-api: " + version)
archivesBaseName = "cloth-api"

Expand All @@ -34,14 +34,13 @@ allprojects {
apply plugin: 'maven-publish'
apply plugin: 'maven'
apply plugin: 'signing'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'fabric-loom'
apply plugin: 'forgified-fabric-loom'
apply plugin: 'net.minecrell.licenser'

sourceCompatibility = targetCompatibility = 1.8

group = "me.shedaniel.cloth.api"

ext {
shouldGenerateData = false
}
Expand All @@ -63,8 +62,7 @@ allprojects {
}

repositories {
maven { url "https://dl.bintray.com/shedaniel/legacy-yarn-updated" }
mavenLocal()
maven { url "https://maven.shedaniel.me/" }
}

dependencies {
Expand Down Expand Up @@ -141,7 +139,7 @@ allprojects {

subprojects {
version = rootProject.version

dependencies {
testmodCompile sourceSets.main.output
datagenCompile sourceSets.main.output
Expand Down Expand Up @@ -169,32 +167,21 @@ subprojects {
}
}
}
}

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
publications = ["${archivesBaseName}_mavenJava"]
publish = true
pkg {
repo = "cloth"
name = archivesBaseName
userOrg = "shedaniel"
licenses = ["Unlicense"]
websiteUrl = 'https://github.com/shedaniel/cloth-api'
issueTrackerUrl = 'https://github.com/shedaniel/cloth-api/issues'
vcsUrl = 'https://github.com/shedaniel/cloth-api.git'
version {
gpg {
sign = true
repositories {
if (System.getenv("MAVEN_PASS") != null) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = System.getenv("MAVEN_PASS")
}
}
}
}
}
}

subprojects.each { bintrayUpload.dependsOn("${it.path}:bintrayUpload") }

task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {
afterEvaluate {
input = file("${project.buildDir}/libs/${archivesBaseName}-${version}-dev.jar")
Expand All @@ -203,27 +190,6 @@ task remapMavenJar(type: net.fabricmc.loom.task.RemapJarTask, dependsOn: jar) {
}
}

bintray {
user = project.hasProperty('bintrayUser') ? project.property('bintrayUser') : System.getenv('BINTRAY_USER')
key = project.hasProperty('bintrayApiKey') ? project.property('bintrayApiKey') : System.getenv('BINTRAY_KEY')
publications = ["mavenJava"]
publish = true
pkg {
repo = "cloth"
name = "cloth-api"
userOrg = "shedaniel"
licenses = ["Unlicense"]
websiteUrl = 'https://github.com/shedaniel/cloth-api'
issueTrackerUrl = 'https://github.com/shedaniel/cloth-api/issues'
vcsUrl = 'https://github.com/shedaniel/cloth-api.git'
version {
gpg {
sign = true
}
}
}
}

publishing {
publications {
mavenJava(MavenPublication) {
Expand All @@ -246,6 +212,18 @@ publishing {
}
}
}

repositories {
if (System.getenv("MAVEN_PASS") != null) {
maven {
url = "https://deploy.shedaniel.me/"
credentials {
username = "shedaniel"
password = System.getenv("MAVEN_PASS")
}
}
}
}
}

task licenseFormatAll
Expand All @@ -258,14 +236,13 @@ sourceSets {
}

dependencies {
afterEvaluate {
subprojects.each {
compile project(path: ":${it.name}", configuration: "dev")
include project("${it.name}:")
subprojects.each {
compile project(path: ":${it.name}", configuration: "dev")
include project("${it.name}:")

testmodCompile project("${it.name}:").sourceSets.testmod.output
}
testmodCompile project("${it.name}:").sourceSets.testmod.output
}

include "me.shedaniel.cloth:basic-math:${project.cloth_basic_math}"
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Expand Up @@ -4,5 +4,5 @@ minecraft_version=1.16.2
yarn_version=1.16.2+build.1+legacy.20w09a+build.8
fabric_loader_version=0.9.1+build.205
fabric_version=0.17.2+build.396-1.16
mod_version=1.4.9
base_version=1.5
cloth_basic_math=0.5.1
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Expand Up @@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.2-all.zip
8 changes: 3 additions & 5 deletions settings.gradle
@@ -1,10 +1,8 @@
pluginManagement {
repositories {
jcenter()
maven {
name = 'Fabric'
url = 'https://maven.fabricmc.net/'
}
maven { url "https://maven.shedaniel.me/" }
maven { url "https://maven.fabricmc.net/" }
maven { url "https://files.minecraftforge.net/maven/" }
gradlePluginPortal()
}
}
Expand Down

0 comments on commit dcc303a

Please sign in to comment.