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 7781cc0 commit d2b4c1f
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-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ jobs:
restore-keys: |
${{ runner.os }}-build-snapshot-
- 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 @@ -10,6 +10,9 @@ plugins {
// This dependency is only used to determine the state of the Git working tree so that build artifacts can be
// more easily identified. TODO: Lazily load GrGit via a service only when builds are performed.
id 'org.ajoberstar.grgit' version '5.2.0'

// For publishing
id 'maven-publish'
}

apply from: "${rootProject.projectDir}/gradle/fabric.gradle"
Expand Down Expand Up @@ -83,6 +86,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 @@ -120,3 +127,32 @@ def getVersionMetadata() {
// No tracking information could be found about the build
return "+unknown"
}

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 d2b4c1f

Please sign in to comment.