Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAPI-871 switch to token for publishing to OSSRH #124

Merged
merged 3 commits into from
Jul 12, 2024
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
105 changes: 39 additions & 66 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,70 +1,43 @@
name: gocardless/gocardless-pro-java/build
on: push
name: build & test

on:
push:
branches: [master]
pull_request:
types: [opened, reopened, synchronize]

jobs:
test_library_jdk8:
runs-on: ubuntu-latest
container:
image: openjdk:8
steps:
- uses: actions/checkout@v2
- name: Test
run: |-
export TERM=${TERM:-dumb}
./install_crypto_deps.sh
./gradlew test
- name: Save test results
run: |-
mkdir -p ~/junit
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
if: always()
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
test_library_jdk9:
runs-on: ubuntu-latest
container:
image: openjdk:9
steps:
- uses: actions/checkout@v2
- name: Test
run: |-
export TERM=${TERM:-dumb}
./install_crypto_deps.sh
./gradlew test
- name: Save test results
run: |-
mkdir -p ~/junit
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
if: always()
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
test_library_jdk11:
test:
runs-on: ubuntu-latest
container:
image: openjdk:11
strategy:
fail-fast: false
matrix:
jdk-version: [ 8, 9, 11 ]
steps:
- uses: actions/checkout@v2
- name: Test
run: |-
export TERM=${TERM:-dumb}
./install_crypto_deps.sh
./gradlew test
- name: Save test results
run: |-
mkdir -p ~/junit
find . -type f -regex "$OUT_DIR/build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
if: always()
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/upload-artifact@v2
with:
path: "~/junit"
- uses: actions/checkout@v4
- uses: actions/setup-java@v2
with:
java-version: "${{ matrix.jdk-version }}"
distribution: adopt
- name: Verify java installed properly
run: java -version
- name: Grant execute permission for gradlew
run: chmod +x gradlew
# test
- name: Test
run: |-
export TERM=${TERM:-dumb}
./gradlew test
# test build
- name: Build with Gradle
run: ./gradlew build
- name: Save test results
if: always()
run: |-
mkdir -p ~/junit
find . -type f -regex "./build/test-results/test/.*xml" -exec cp {} ~/junit/ \;
- uses: actions/upload-artifact@v4
if: always()
with:
name: test_library_jdk${{ matrix.jdk-version }}_junit
path: "~/junit"
4 changes: 2 additions & 2 deletions .github/workflows/maven-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ jobs:
- name: Publish package
run: ./gradlew publishToSonatype closeAndReleaseStagingRepository -Psigning.keyId=${{secrets.SIGNING_KEY_ID}} -Psigning.password=${{secrets.SIGNING_KEY_PASSWORD}} -Psigning.secretKeyRingFile=$(echo ~/.gradle/secring.gpg) -Dorg.gradle.internal.http.socketTimeout=300000 --stacktrace
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
MAVEN_USERNAME: ${{ secrets.OSSRH_ACCESS_TOKEN_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_ACCESS_TOKEN_PASSWORD }}
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ out/
##############################
## Visual Studio Code
##############################
.vscode/
.vscode/

tmp-push-files-checkout/
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ With Maven:
<dependency>
<groupId>com.gocardless</groupId>
<artifactId>gocardless-pro</artifactId>
<version>5.25.0</version>
<version>5.26.0</version>
</dependency>
```

With Gradle:

```
implementation 'com.gocardless:gocardless-pro:5.25.0'
implementation 'com.gocardless:gocardless-pro:5.26.0'
```

## Initializing the client
Expand Down
13 changes: 12 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ buildscript {
repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}

dependencies {
Expand All @@ -20,12 +25,18 @@ plugins {
sourceCompatibility = 1.8
targetCompatibility = 1.8
group = 'com.gocardless'
version = '5.25.0'
version = '5.26.0'

apply plugin: 'ch.raffael.pegdown-doclet'

repositories {
mavenCentral()
maven { url 'https://plugins.gradle.org/m2/' }
jcenter()
google()
maven {
url 'https://maven.google.com'
}
}

dependencies {
Expand Down
1 change: 1 addition & 0 deletions gradlew
100755 → 100644
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/usr/bin/env sh
set -x

##############################################################################
##
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/com/gocardless/resources/Subscription.java
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ private Subscription() {
private Map<String, Object> metadata;
private Month month;
private String name;
private Boolean parentPlanPaused;
private String paymentReference;
private Boolean retryIfPossible;
private String startDate;
Expand Down Expand Up @@ -186,6 +187,13 @@ public String getName() {
return name;
}

/**
* Whether the parent plan of this subscription is paused.
*/
public Boolean getParentPlanPaused() {
return parentPlanPaused;
}

/**
* An optional payment reference. This will be set as the reference on each payment created and
* will appear on your customer's bank statement. See the documentation for the [create payment
Expand Down
14 changes: 12 additions & 2 deletions src/main/java/com/gocardless/services/LogoService.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ public LogoService(HttpClient httpClient) {
/**
* Creates a new logo associated with a creditor. If a creditor already has a logo, this will
* update the existing logo linked to the creditor.
*
* We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For
* more guidance on how to upload logos that will look great across your customer payment page
* and notification emails see
* [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo).
*/
public LogoCreateForCreditorRequest createForCreditor() {
return new LogoCreateForCreditorRequest(httpClient);
Expand All @@ -33,6 +38,11 @@ public LogoCreateForCreditorRequest createForCreditor() {
*
* Creates a new logo associated with a creditor. If a creditor already has a logo, this will
* update the existing logo linked to the creditor.
*
* We support JPG and PNG formats. Your logo will be scaled to a maximum of 300px by 40px. For
* more guidance on how to upload logos that will look great across your customer payment page
* and notification emails see
* [here](https://developer.gocardless.com/gc-embed/setting-up-branding#tips_for_uploading_your_logo).
*/
public static final class LogoCreateForCreditorRequest extends PostRequest<Logo> {
private String image;
Expand All @@ -52,7 +62,7 @@ public LogoCreateForCreditorRequest withLinks(Links links) {
}

/**
* ID of the creditor the payer theme belongs to
* ID of the creditor the logo belongs to
*/
public LogoCreateForCreditorRequest withLinksCreditor(String creditor) {
if (links == null) {
Expand Down Expand Up @@ -95,7 +105,7 @@ public static class Links {
private String creditor;

/**
* ID of the creditor the payer theme belongs to
* ID of the creditor the logo belongs to
*/
public Links withCreditor(String creditor) {
this.creditor = creditor;
Expand Down
Loading
Loading