Skip to content

Commit af2dac3

Browse files
committed
Merge branch 'master' of https://github.com/XeroAPI/Xero-Java into fix/replace-byte-by-binary
2 parents b209452 + 7883f7f commit af2dac3

File tree

4 files changed

+231
-23
lines changed

4 files changed

+231
-23
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
name: slack-alert-action
2+
description: "Action to send slack payload to public-sdk-events channel"
3+
4+
inputs:
5+
heading_text:
6+
required: true
7+
description: "Heading of the slack payload"
8+
alert_type:
9+
required: true
10+
description: "type of the slack alert"
11+
job_status:
12+
required: true
13+
description: "status of the job"
14+
XERO_SLACK_WEBHOOK_URL:
15+
required: true
16+
description: "webhook url for channel - public-sdk-events"
17+
job_url:
18+
required: true
19+
description: "job run id link"
20+
button_type:
21+
required: true
22+
description: "color for the check logs button"
23+
package_version:
24+
required: true
25+
description: "released package version"
26+
repo_link:
27+
required: true
28+
description: "link of the repo"
29+
30+
31+
runs:
32+
using: "composite"
33+
34+
steps:
35+
36+
- name: Send slack notification
37+
id: slack
38+
uses: slackapi/[email protected]
39+
env:
40+
SLACK_WEBHOOK_URL: ${{inputs.XERO_SLACK_WEBHOOK_URL}}
41+
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK
42+
with:
43+
payload: |
44+
{
45+
"blocks": [
46+
{
47+
"type": "rich_text",
48+
"elements": [
49+
{
50+
"type": "rich_text_section",
51+
"elements": [
52+
{
53+
"type": "text",
54+
"text": "${{inputs.heading_text}} ",
55+
"style": {
56+
"bold": true
57+
}
58+
},
59+
{
60+
"type": "emoji",
61+
"name": "${{inputs.alert_type}}"
62+
}
63+
]
64+
}
65+
]
66+
},
67+
{
68+
"type": "divider"
69+
},
70+
{
71+
"type": "section",
72+
"fields": [
73+
{
74+
"type": "mrkdwn",
75+
"text": "*Repository:* \n ${{inputs.repo_link}}"
76+
},
77+
{
78+
"type": "mrkdwn",
79+
"text": "*Status:*\n ${{inputs.job_status}}"
80+
},
81+
{
82+
"type": "mrkdwn",
83+
"text": "*Package Version:*\n ${{inputs.package_version}}"
84+
}
85+
]
86+
},
87+
{
88+
"type": "actions",
89+
"elements": [
90+
{
91+
"type": "button",
92+
"text": {
93+
"type": "plain_text",
94+
"text": "Check the logs",
95+
"emoji": true
96+
},
97+
"style": "${{inputs.button_type}}",
98+
"url": "${{inputs.job_url}}"
99+
}
100+
]
101+
}
102+
]
103+
}

.github/workflows/build-lint-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,7 @@ jobs:
3030
- name: Build and test post generation
3131
run: |
3232
export GPG_TTY=$(tty)
33-
mvn clean verify -DskipTests=true -Dgpg.passphrase=${{ secrets.GPG_PASSPHRASE }}
33+
mvn clean verify -DskipTests=true
34+
env:
35+
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
3436
working-directory: Xero-Java

.github/workflows/publish.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [published]
5+
6+
jobs:
7+
publish:
8+
runs-on: ubuntu-latest
9+
10+
outputs:
11+
release_number: ${{steps.get_latest_release_number.outputs.release_tag}}
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
steps:
17+
- name: Checkout Xero-Java repo
18+
uses: actions/checkout@v4
19+
with:
20+
repository: XeroAPI/Xero-Java
21+
path: Xero-Java
22+
23+
- name: Set up JDK environment
24+
uses: actions/setup-java@v4
25+
with:
26+
distribution: 'temurin'
27+
java-version: '11'
28+
cache: maven
29+
server-id: ossrh
30+
server-username: MAVEN_USERNAME
31+
server-password: MAVEN_PASSWORD
32+
gpg-passphrase: GPG_PASSPHRASE
33+
34+
- name: Fetch Latest release number
35+
id: get_latest_release_number
36+
run: |
37+
latest_version=$(gh release view --json tagName --jq '.tagName')
38+
echo "Latest release version is - $latest_version"
39+
echo "::set-output name=release_tag::$latest_version"
40+
working-directory: Xero-Java
41+
env:
42+
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
43+
44+
- name: Import GPG Key
45+
run: |
46+
echo "${{ secrets.GPG_PRIVATE_KEY }}" | gpg --batch --import
47+
env:
48+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY}}
49+
50+
- name: Publish to Maven
51+
run: |
52+
export GPG_TTY=$(tty)
53+
mvn clean deploy -DskipTests=true
54+
env:
55+
MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }}
56+
MAVEN_PASSWORD: ${{ secrets.MAVEN_TOKEN }}
57+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
58+
working-directory: Xero-Java
59+
60+
notify-slack-on-success:
61+
runs-on: ubuntu-latest
62+
needs: publish
63+
if: success()
64+
steps:
65+
- name: Checkout Xero-Java repo
66+
uses: actions/checkout@v4
67+
with:
68+
repository: XeroAPI/Xero-Java
69+
path: Xero-Java
70+
71+
- name: Send slack notification on success
72+
uses: ./Xero-Java/.github/actions/notify-slack
73+
with:
74+
heading_text: "Publish job has succeeded !"
75+
alert_type: "thumbsup"
76+
job_status: "Success"
77+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
78+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
79+
button_type: "primary"
80+
package_version: ${{needs.publish.outputs.release_number}}
81+
repo_link: ${{github.server_url}}/${{github.repository}}
82+
83+
notify-slack-on-failure:
84+
runs-on: ubuntu-latest
85+
needs: publish
86+
if: failure()
87+
steps:
88+
- name: Checkout Xero-Java repo
89+
uses: actions/checkout@v4
90+
with:
91+
repository: XeroAPI/Xero-Java
92+
path: Xero-Java
93+
94+
- name: Send slack notification on failure
95+
uses: ./Xero-Java/.github/actions/notify-slack
96+
with:
97+
heading_text: "Publish job has failed !"
98+
alert_type: "alert"
99+
job_status: "Failed"
100+
XERO_SLACK_WEBHOOK_URL: ${{secrets.XERO_SLACK_WEBHOOK_URL}}
101+
job_url: "https://github.com/${{github.repository}}/actions/runs/${{github.run_id}}"
102+
button_type: "danger"
103+
package_version: ${{needs.publish.outputs.release_number}}
104+
repo_link: ${{github.server_url}}/${{github.repository}}

pom.xml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>com.auth0</groupId>
4343
<artifactId>java-jwt</artifactId>
44-
<version>3.19.4</version>
44+
<version>4.4.0</version>
4545
</dependency>
4646
<dependency>
4747
<groupId>com.auth0</groupId>
@@ -68,17 +68,17 @@
6868
<dependency>
6969
<groupId>commons-io</groupId>
7070
<artifactId>commons-io</artifactId>
71-
<version>2.7</version>
71+
<version>2.17.0</version>
7272
</dependency>
7373
<dependency>
7474
<groupId>jakarta.servlet</groupId>
7575
<artifactId>jakarta.servlet-api</artifactId>
76-
<version>6.0.0</version>
76+
<version>6.1.0</version>
7777
</dependency>
7878
<dependency>
7979
<groupId>org.mockito</groupId>
8080
<artifactId>mockito-core</artifactId>
81-
<version>5.10.0</version>
81+
<version>5.14.1</version>
8282
<scope>test</scope>
8383
</dependency>
8484

@@ -92,7 +92,7 @@
9292
<dependency>
9393
<groupId>org.slf4j</groupId>
9494
<artifactId>slf4j-api</artifactId>
95-
<version>1.7.30</version>
95+
<version>2.0.16</version>
9696
</dependency>
9797

9898
<!-- JSON processing: jackson -->
@@ -159,7 +159,7 @@
159159
<plugins>
160160
<plugin>
161161
<artifactId>maven-deploy-plugin</artifactId>
162-
<version>2.8.2</version>
162+
<version>3.1.3</version>
163163
</plugin>
164164
<plugin>
165165
<groupId>org.apache.maven.plugins</groupId>
@@ -173,7 +173,7 @@
173173
<plugin>
174174
<groupId>org.apache.maven.plugins</groupId>
175175
<artifactId>maven-source-plugin</artifactId>
176-
<version>3.0.1</version>
176+
<version>3.3.1</version>
177177
<executions>
178178
<execution>
179179
<id>attach-sources</id>
@@ -203,17 +203,17 @@
203203
<plugin>
204204
<groupId>org.apache.maven.plugins</groupId>
205205
<artifactId>maven-pmd-plugin</artifactId>
206-
<version>3.8</version>
206+
<version>3.25.0</version>
207207
</plugin>
208208
<plugin>
209209
<groupId>org.codehaus.mojo</groupId>
210210
<artifactId>findbugs-maven-plugin</artifactId>
211-
<version>3.0.4</version>
211+
<version>3.0.5</version>
212212
</plugin>
213213
<plugin>
214214
<groupId>org.apache.maven.plugins</groupId>
215215
<artifactId>maven-war-plugin</artifactId>
216-
<version>3.1.0</version>
216+
<version>3.4.0</version>
217217
<configuration>
218218
<webXml>example/src/main/webapp/WEB-INF/web.xml</webXml>
219219
<webResources>
@@ -232,7 +232,7 @@
232232
<plugin>
233233
<groupId>org.apache.maven.plugins</groupId>
234234
<artifactId>maven-javadoc-plugin</artifactId>
235-
<version>3.3.2</version>
235+
<version>3.10.1</version>
236236
<configuration>
237237
<source>8</source>
238238
</configuration>
@@ -248,7 +248,7 @@
248248
<plugin>
249249
<groupId>org.apache.maven.plugins</groupId>
250250
<artifactId>maven-gpg-plugin</artifactId>
251-
<version>1.6</version>
251+
<version>3.2.7</version>
252252
<executions>
253253
<execution>
254254
<id>sign-artifacts</id>
@@ -261,15 +261,14 @@
261261
<arg>--pinentry-mode</arg>
262262
<arg>loopback</arg>
263263
</gpgArguments>
264-
<passphraseServerId>gpg.passphrase</passphraseServerId>
265264
</configuration>
266265
</execution>
267266
</executions>
268267
</plugin>
269268
<plugin>
270269
<groupId>org.sonatype.plugins</groupId>
271270
<artifactId>nexus-staging-maven-plugin</artifactId>
272-
<version>1.6.13</version>
271+
<version>1.7.0</version>
273272
<extensions>true</extensions>
274273
<configuration>
275274
<serverId>ossrh</serverId>
@@ -280,7 +279,7 @@
280279
<plugin>
281280
<groupId>org.apache.maven.plugins</groupId>
282281
<artifactId>maven-surefire-plugin</artifactId>
283-
<version>3.0.0-M4</version>
282+
<version>3.5.0</version>
284283
<configuration>
285284
<argLine>-Duser.timezone=GMT-08:00</argLine>
286285
</configuration>
@@ -292,12 +291,12 @@
292291
<plugin>
293292
<groupId>org.apache.maven.plugins</groupId>
294293
<artifactId>maven-pmd-plugin</artifactId>
295-
<version>3.8</version>
294+
<version>3.25.0</version>
296295
</plugin>
297296
<plugin>
298297
<groupId>org.codehaus.mojo</groupId>
299298
<artifactId>findbugs-maven-plugin</artifactId>
300-
<version>3.0.4</version>
299+
<version>3.0.5</version>
301300
<configuration>
302301
<!-- Enables analysis which takes more memory but finds more bugs. If
303302
you run out of memory, changes the value of the effort element to 'low'. -->
@@ -316,12 +315,12 @@
316315
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
317316
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
318317
<java.version>11</java.version>
319-
<swagger-annotations-version>1.6.3</swagger-annotations-version>
320-
<google-api-client-version>2.3.0</google-api-client-version>
318+
<swagger-annotations-version>1.6.14</swagger-annotations-version>
319+
<google-api-client-version>2.7.0</google-api-client-version>
321320
<jersey-common-version>2.25.1</jersey-common-version>
322-
<jackson-version>2.16.1</jackson-version>
323-
<jackson-databind-version>2.16.1</jackson-databind-version>
324-
<jackson-threetenbp-version>2.12.5</jackson-threetenbp-version>
321+
<jackson-version>2.18.0</jackson-version>
322+
<jackson-databind-version>2.18.0</jackson-databind-version>
323+
<jackson-threetenbp-version>2.15.2</jackson-threetenbp-version>
325324
<junit-version>4.13.2</junit-version>
326325
<org-apache-httpcomponents>4.5.3</org-apache-httpcomponents>
327326
<jersey-version>3.1.5</jersey-version>

0 commit comments

Comments
 (0)