Skip to content
Merged

H #2

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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.1.0
1.1.1
11 changes: 9 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

version = project.mod_version
group = project.maven_group
group = 'io.github.diamondstar_mods' // <-- update this to match your GitHub org/user

base {
archivesName = project.archives_base_name
Expand Down Expand Up @@ -75,6 +75,13 @@ publishing {
}
}
repositories {
// Add publishing targets here if needed
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${System.getenv('GITHUB_REPOSITORY')}")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
Comment on lines 77 to 86
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suggestion: Using environment variables for credentials is standard, but consider error handling for missing values.

Consider adding checks to ensure USERNAME, TOKEN, and GITHUB_REPOSITORY are set, and provide clear error messages if they are missing.

Suggested change
repositories {
// Add publishing targets here if needed
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${System.getenv('GITHUB_REPOSITORY')}")
credentials {
username = System.getenv("USERNAME")
password = System.getenv("TOKEN")
}
}
}
repositories {
// Check for required environment variables
def githubRepo = System.getenv('GITHUB_REPOSITORY')
def githubUsername = System.getenv('USERNAME')
def githubToken = System.getenv('TOKEN')
if (!githubRepo) {
throw new GradleException("Missing required environment variable: GITHUB_REPOSITORY")
}
if (!githubUsername) {
throw new GradleException("Missing required environment variable: USERNAME")
}
if (!githubToken) {
throw new GradleException("Missing required environment variable: TOKEN")
}
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/${githubRepo}")
credentials {
username = githubUsername
password = githubToken
}
}
}

}
Loading