Skip to content

Commit

Permalink
Merge pull request #7 from marytts/publish-to-maven-central
Browse files Browse the repository at this point in the history
Publish to Maven Central
  • Loading branch information
psibre authored Jan 7, 2022
2 parents d9d3811 + 7c87f68 commit 8a7f322
Show file tree
Hide file tree
Showing 4 changed files with 72 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ jobs:
- name: Build with Gradle
run: ./gradlew build

- name: Publish with Gradle
- name: Publish to GitHub Packages with Gradle
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: ./gradlew publish
run: ./gradlew publishAllPublicationsToGitHubPackagesRepository

- name: Cleanup Gradle cache
run: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ emotionml-checker-java Changelog
[Unreleased]
------------

[v1.2.1] (2022-01-07)
-------------------

### Changes

- Upgraded Gradle to v7.3.3
- Upgraded test dependencies
- Released to Maven Central

[v1.2] (2021-12-22)
-------------------
Expand All @@ -28,6 +32,7 @@ Release published to Bintray, indexed in JCenter
Initial release

[Unreleased]: https://github.com/marytts/emotionml-checker-java
[v1.2.1]: https://github.com/marytts/emotionml-checker-java/releases/tag/v1.2.1
[v1.2]: https://github.com/marytts/emotionml-checker-java/releases/tag/v1.2
[v1.1]: https://github.com/marytts/emotionml-checker-java/releases/tag/v1.1
[v1.0]: https://github.com/marytts/emotionml-checker-java/releases/tag/emotionml-checker-java-1.0
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,43 @@ A generic implementation of EmotionML checks, in Java.
Dependency resolution
---------------------

### Releases

As of v1.2.1, release artifacts for this component is available via Maven Central.

#### Gradle

Add this to your `build.gradle`:

```gradle
repositories {
mavenCentral()
}
dependencies {
implementation group: 'de.dfki.mary', name: 'emotionml-checker-java', version: '1.2.1'
}
```

#### Maven

Add this to your `pom.xml`:

```xml
<dependency>
<groupId>de.dfki.mary</groupId>
<artifactId>emotionml-checker-java</artifactId>
<version>1.2.1</version>
</dependency>
```

### Snapshots

Snapshot releases are hosted via GitHub Packages.

Ensure you have a valid GitHub personal access token with `read:packages` scope.

### Gradle
#### Gradle

Configure your GitHub usename and token as Gradle properties `GitHubPackagesUsername` and `GitHubPackagesPassword`, respectively.

Expand All @@ -33,11 +67,11 @@ repositories {
}
dependencies {
implementation group: 'de.dfki.mary', name: 'emotionml-checker-java', version: '1.2'
implementation group: 'de.dfki.mary', name: 'emotionml-checker-java', version: '1.3-SNAPSHOT'
}
```

### Maven
#### Maven

Configure your Maven `settings.xml` to [authenticate to GitHub Packages](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry).

Expand All @@ -47,7 +81,7 @@ Then, add this to your `pom.xml`:
<dependency>
<groupId>de.dfki.mary</groupId>
<artifactId>emotionml-checker-java</artifactId>
<version>1.2</version>
<version>1.3-SNAPSHOT</version>
</dependency>
```

Expand Down
28 changes: 27 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@ plugins {
id 'java-library'
id 'application'
id 'maven-publish'
id 'signing'
}

group 'de.dfki.mary'
version '1.3-SNAPSHOT'
description 'A generic implementation of EmotionML checks, in Java'

ext.isReleaseVersion = !version.endsWith("SNAPSHOT")

repositories {
mavenCentral()
}
Expand Down Expand Up @@ -47,17 +50,28 @@ publishing {
pom {
name = project.name
description = project.description
def projectUrl = 'https://github.com/marytts/emotionml-checker-java'
url = projectUrl
licenses {
license {
name = 'Creative Commons Zero v1.0 Universal'
url = 'https://spdx.org/licenses/CC0-1.0.html'
url = 'https://creativecommons.org/publicdomain/zero/1.0/'
}
}
developers {
developer {
id = 'marc1s'
name = 'Marc Schröder'
}
developer {
id = 'psibre'
name = 'Ingmar Steiner'
}
}
scm {
connection = "scm:git:${projectUrl}.git"
developerConnection = 'scm:git:ssh://github.com:marytts/emotionml-checker-java.git'
url = "$projectUrl/tree/master"
}
}
}
Expand All @@ -71,5 +85,17 @@ publishing {
password = System.env.GITHUB_TOKEN
}
}
if (isReleaseVersion) {
maven {
name = 'OSSRH'
url = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
credentials(PasswordCredentials)
}
}
}
}

signing {
required { isReleaseVersion }
sign publishing.publications.mavenJava
}

0 comments on commit 8a7f322

Please sign in to comment.