Skip to content
Merged
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 .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: ./gradlew test

- name: Publish package
run: ./gradlew publish
run: ./gradlew publishToSonatype closeStagingRepositories
env:
PGP_SIGNING_KEY: ${{ secrets.PGP_SIGNING_KEY }}
PGP_SIGNING_PASSWORD: ${{ secrets.PGP_SIGNING_PASSWORD }}
Expand Down
25 changes: 13 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ apply plugin: 'io.github.goooler.shadow'
apply plugin: 'com.github.ben-manes.versions'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
apply plugin: 'io.github.gradle-nexus.publish-plugin'

group 'co.omise'
version '5.2.0'
Expand All @@ -31,6 +32,7 @@ buildscript {
classpath "io.github.goooler.shadow:shadow-gradle-plugin:8.1.8"
classpath 'com.github.ben-manes:gradle-versions-plugin:0.42.0'
classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:5.1.0.4882")
classpath "io.github.gradle-nexus:publish-plugin:2.0.0"
}
}

Expand Down Expand Up @@ -111,18 +113,6 @@ publishing {
}
}
}

repositories {
maven {
def releasesRepoUrl = 'https://oss.sonatype.org/service/local/staging/deploy/maven2/'
def snapshotsRepoUrl = 'https://oss.sonatype.org/content/repositories/snapshots'
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}
}

signing {
Expand All @@ -133,6 +123,17 @@ signing {
sign publishing.publications.release
}

nexusPublishing {
repositories {
sonatype {
nexusUrl = uri("https://ossrh-staging-api.central.sonatype.com/service/local/")
snapshotRepositoryUrl = uri("https://central.sonatype.com/repository/maven-snapshots/")
username = System.getenv("SONATYPE_USERNAME")
password = System.getenv("SONATYPE_PASSWORD")
}
}
}

/**
* {@link Package#getImplementationVersion()} on IDE will alway return `null`
* because this method read data from `META-INF/MANIFEST.MF` that contain in `.jar`.
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/co/omise/requests/TokenRequestTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public void testCreate() throws IOException, OmiseException {
.card(new Card.Create()
.name("JOHN DOE")
.number("4242424242424242")
.expiration(YearMonth.now().plusYears(1))
.expiration(YearMonth.of(2026, 3))
.securityCode("123")
.city("Bangkok")
.postalCode("10240")
Expand Down