Skip to content

Commit

Permalink
new: Add FlashyReese's maven repository
Browse files Browse the repository at this point in the history
  • Loading branch information
FlashyReese committed Jan 27, 2024
1 parent 1bc2ff3 commit 733306d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/build-commit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
restore-keys: |
${{ runner.os }}-build-commit-
- name: Build artifacts
run: ./gradlew build
run: ./gradlew build publishMavenJavaPublicationToFlashyReeseSnapshotsRepository
env:
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }}
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
Expand Down
36 changes: 36 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ plugins {
// is not reachable for some reason, and it makes builds much more reproducible. Observation also shows that it
// really helps to improve startup times on slow connections.
id 'fabric-loom' version '1.4.1'

// For publishing
id 'maven-publish'
}

apply from: "${rootProject.projectDir}/gradle/fabric.gradle"
Expand Down Expand Up @@ -79,6 +82,10 @@ jar {
manifest.attributes["Main-Class"] = "${project.main_class}"
}

java {
withSourcesJar()
}

dependencies {
//to change the versions see the gradle.properties file
minecraft "com.mojang:minecraft:${project.minecraft_version}"
Expand Down Expand Up @@ -126,4 +133,33 @@ def createVersionString() {
}

return builder.toString()
}

publishing {
publications {
mavenJava(MavenPublication) {
from components.java
}
}

// select the repositories you want to publish to
repositories {
// uncomment to publish to the local maven
maven {
name = "FlashyReeseReleases"
url = "https://maven.flashyreese.me/releases"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
maven {
name = "FlashyReeseSnapshots"
url = "https://maven.flashyreese.me/snapshots"
credentials {
username = System.getenv("MAVEN_USERNAME")
password = System.getenv("MAVEN_PASSWORD")
}
}
}
}

0 comments on commit 733306d

Please sign in to comment.