Skip to content
Draft
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
49 changes: 49 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,55 @@ imcjava supports multiple IMC versions.

Use `./gradlew generate` to create the bindings.

# Publishing

## Test Locally

Use `./gradlew publishToMavenLocal` to test locally.

## Publish to GitHub Packages

To publish to GitHub Packages Maven repository:

```bash
export GITHUB_ACTOR=your-github-username
export GITHUB_TOKEN=your-github-token
./gradlew publish
```

Or publish only to GitHub Packages:

```bash
./gradlew publishAllPublicationsToGitHubPackagesRepository
```

Alternatively, you can set credentials in `~/.gradle/gradle.properties`:

```properties
gpr.user=your-github-username
gpr.key=your-github-token
```

## Using the Package

To use the published package in your project, add the following to your `build.gradle`:

```groovy
repositories {
maven {
url = uri("https://maven.pkg.github.com/oceanscan/imcjava")
credentials {
username = project.findProperty("gpr.user") ?: System.getenv("GITHUB_ACTOR")
password = project.findProperty("gpr.key") ?: System.getenv("GITHUB_TOKEN")
}
}
}

dependencies {
implementation 'pt.lsts:imcjava:5.5.5-unify'
}
```

## Legacy Publishing

`mvn_update.sh` to publish the current build to omst's maven repository.
19 changes: 15 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,25 @@ publishing {
publications {
mavenJava(MavenPublication) {
from components.java
groupId = 'pt.lsts'
artifactId = 'imcjava'
version = project.version
}
}
}

publishing {

repositories {
maven {
url "file://" + System.getProperty("user.home") + "/maven"
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/oceanscan/imcjava")
credentials {
username = System.getenv("GITHUB_ACTOR") ?: project.findProperty("gpr.user")
password = System.getenv("GITHUB_TOKEN") ?: project.findProperty("gpr.key")
}
}
// Keep local publishing for testing
maven {
name = "Local"
url = "file://" + System.getProperty("user.home") + "/maven"
}
}
}
Expand Down