Skip to content

Commit 84d1940

Browse files
authored
Merge pull request #31 from Staffbase/github-actions
Added Github workflow
2 parents 193abc3 + b150243 commit 84d1940

5 files changed

Lines changed: 72 additions & 11 deletions

File tree

.github/workflows/ci.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# This workflow will build a Java project with Maven
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven
3+
4+
name: Continuous Integration
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
12+
jobs:
13+
build-test:
14+
runs-on: ubuntu-20.04
15+
name: Java ${{ matrix.java }} Test
16+
strategy:
17+
matrix:
18+
# test against latest update of each major Java version, as well as specific updates of LTS versions:
19+
java: [ 8, 10, 11, 12, 13, 14]
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Set up JDK ${{ matrix.java }}
24+
uses: actions/setup-java@v1
25+
with:
26+
java-version: ${{ matrix.java }}
27+
28+
- name: Build with Maven
29+
run: mvn -B package --file pom.xml
30+
31+
- name: Run UI tests
32+
run: make test
33+
34+
continuous-delivery:
35+
if: github.ref == 'refs/heads/dev' || github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/')
36+
needs: build-test
37+
runs-on: ubuntu-20.04
38+
39+
steps:
40+
- name: Check out Git repository
41+
uses: actions/checkout@v2
42+
43+
- name: Install Java and Maven
44+
uses: actions/setup-java@v1
45+
with:
46+
java-version: 1.8
47+
48+
- name: Release Maven package
49+
uses: samuelmeuli/action-maven-publish@v1
50+
with:
51+
gpg_private_key: ${{ secrets.gpg_private_key }}
52+
gpg_passphrase: ${{ secrets.gpg_passphrase }}
53+
nexus_username: ${{ secrets.nexus_username }}
54+
nexus_password: ${{ secrets.nexus_password }}

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![Build Status](https://github.com/Staffbase/plugins-sdk-java/workflows/Continuous%20Integration/badge.svg)](https://github.com/Staffbase/plugins-sdk-java/actions)
2+
13
# Plugin SDK for Java
24

35
If you are developing your own plugin for your Staffbase app we describe the authentication flow of a plugin at https://developers.staffbase.com/guide/customplugin-overview/. While this documentation just covers the conceptual ideas of the interface of plugins though – the so called Plugin SSO – we want to provide a library to help you develop your first plugin for Staffbase even faster. This SDK provides the basic functionality to parse and verify a provided token for Java.

pom.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,9 @@
158158
<groupId>org.apache.maven.plugins</groupId>
159159
<artifactId>maven-javadoc-plugin</artifactId>
160160
<version>3.2.0</version>
161+
<configuration>
162+
<source>8</source>
163+
</configuration>
161164
<executions>
162165
<execution>
163166
<id>attach-javadocs</id>
@@ -193,6 +196,7 @@
193196
<plugin>
194197
<groupId>org.apache.maven.plugins</groupId>
195198
<artifactId>maven-compiler-plugin</artifactId>
199+
<version>3.8.1</version>
196200
<configuration>
197201
<source>8</source>
198202
<target>8</target>

src/main/java/com/staffbase/plugins/sdk/sso/SSOData.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,10 +304,22 @@ public SSOData(final JwtClaims jwtClaims) throws MalformedClaimException {
304304
* Getters
305305
**********************************************/
306306

307+
/**
308+
* Get the branch identifier of the installation
309+
*
310+
* @see #branchID
311+
* @return the id to know which branch an installation belongs to
312+
*/
307313
public String getBranchID() {
308314
return this.branchID;
309315
}
310316

317+
/**
318+
* Get the name of the branch an installation belongs to
319+
*
320+
* @see #branchSlug
321+
* @return the name of the branch an installation belongs to
322+
*/
311323
public String getBranchSlug() {
312324
return this.branchSlug;
313325
}

0 commit comments

Comments
 (0)