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
91 changes: 91 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
name: Java SDK CI

on:
workflow_dispatch:
push:
branches:
- master
- support/SDK-V3
- feature/**
- bugfix/**
- dependabot/**

jobs:
build:
# Compile the project using the predefined JDK versions in the strategy section
runs-on: ubuntu-latest
name: Build - JDK ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
java-version: [ 8 ]

steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}

- name: Build and Test JDK ${{ matrix.java-version }}
# --batch-mode Run in non-interactive (batch) mode (disables output color)
# --update-snapshots Forces a check for missing releases and updated snapshots on remote repositories
run: mvn --batch-mode --update-snapshots compile

test:
# Perform the unit and integration tests using the predefined JDK versions in the strategy section
needs: [build]
runs-on: ubuntu-latest
name: Test - JDK ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
java-version: [ 8, 9, 10, 11, 12, 13, 14, 15, 16 ,17, 18 ]

steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
architecture: x64
java-version: ${{ matrix.java-version }}

- name: Run the Maven test phase JDK ${{ matrix.java-version }}
# --batch-mode Run in non-interactive (batch) mode (disables output color)
# --update-snapshots Forces a check for missing releases and updated snapshots on remote repositories
run: mvn --batch-mode --update-snapshots test

code-coverage:
needs: [ test ]
runs-on: ubuntu-latest

name: Report code coverage - JDK ${{ matrix.java-version }}

strategy:
fail-fast: false
matrix:
java-version: [ 8 ]
steps:
- uses: actions/checkout@v3

- name: Setup JDK ${{ matrix.java-version }}
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: ${{ matrix.java-version }}

- name: "Report: Coverage via coveralls.io"
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_TOKEN }}
run: |
mvn clean \
cobertura:cobertura \
coveralls:report \
--no-transfer-progress \
-D repoToken=$COVERALLS_REPO_TOKEN
76 changes: 76 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: Deploy to Maven Central

on:
workflow_dispatch:
release:
types: [created]

jobs:
deploy:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Import GPG Key
run: |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG || echo "No secret keys found"
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Extract GPG Key ID
run: |
KEY_ID=$(gpg --list-secret-keys --with-colons | awk -F: '/^sec:/ { print $5 }')
echo "GPG_KEY_ID=$KEY_ID" >> $GITHUB_ENV
shell: bash

- name: Debug GPG Key Import
run: |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG || echo "No secret keys found"
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Set Default GPG Key
run: |
echo "default-key ${{ env.GPG_KEY_ID }}" >> ~/.gnupg/gpg.conf
echo "use-agent" >> ~/.gnupg/gpg.conf
echo "pinentry-mode loopback" >> ~/.gnupg/gpg.conf
echo "allow-loopback-pinentry" >> ~/.gnupg/gpg-agent.conf
echo RELOADAGENT | gpg-connect-agent

- name: Set GPG_TTY
run: echo "GPG_TTY=$(tty)" >> $GITHUB_ENV

- name: Debug GPG Key Import
run: |
echo "$GPG_PRIVATE_KEY" | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG || echo "No secret keys found"
env:
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}

- name: Set up Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
server-id: central
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
gpg-passphrase: GPG_PASSPHRASE

- name: Build and Deploy
# run: mvn -P release --batch-mode deploy -DskipTests
run: |
mvn clean -P release deploy -DskipTests -Psign-artifacts \
-Dgpg.passphrase="$GPG_PASSPHRASE" \
-Dgpg.keyname="$GPG_KEY_ID"
env:
GPG_TTY: $(tty)
MAVEN_USERNAME: ${{ secrets.CENTRAL_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.CENTRAL_PASSWORD }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
Loading