Skip to content

Commit

Permalink
Merge pull request #108 from onfido/release-upgrade
Browse files Browse the repository at this point in the history
Refresh onfido-java after onfido-openapi-spec update (df7167d)
  • Loading branch information
dvacca-onfido authored May 10, 2024
2 parents 783d076 + afd3a46 commit c306fa1
Show file tree
Hide file tree
Showing 17 changed files with 79 additions and 1,242 deletions.
39 changes: 0 additions & 39 deletions .github/workflows/maven-publish.yml

This file was deleted.

85 changes: 59 additions & 26 deletions .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,36 +7,69 @@ on:
push:
branches:
- master
- 'release/**'
- "release/**"
pull_request:
branches:
- master
- 'release/**'

- "release/**"
workflow_dispatch:
release:
types:
- published
jobs:
build:

integration-tests:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
- name: Install and run linter over tests
run: |
npm install google-java-format
npx google-java-format --set-exit-if-changed --glob=src/test/**/*.java > /dev/null
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip
- name: Run integration tests with Maven
run: mvn test
env:
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }}
ONFIDO_SAMPLE_APPLICANT_ID: ${{ secrets.ONFIDO_SAMPLE_APPLICANT_ID }}
ONFIDO_SAMPLE_VIDEO_ID_1: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_1 }}
ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }}
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }}
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }}

publish:
runs-on: ubuntu-latest
needs: integration-tests
if: github.event_name == 'release'
steps:
- uses: actions/checkout@v4
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: '11'
distribution: 'adopt'
- name: Install and run linter over tests
run: |
npm install google-java-format
npx google-java-format --set-exit-if-changed --glob=src/test/**/*.java > /dev/null
- name: Build with Maven
run: mvn -B package --file pom.xml -Dmaven.test.skip
- name: Run integration tests with Maven
run: mvn test
env:
ONFIDO_API_TOKEN: ${{ secrets.ONFIDO_API_TOKEN }}
ONFIDO_SAMPLE_APPLICANT_ID: ${{ secrets.ONFIDO_SAMPLE_APPLICANT_ID }}
ONFIDO_SAMPLE_VIDEO_ID_1: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_1 }}
ONFIDO_SAMPLE_VIDEO_ID_2: ${{ secrets.ONFIDO_SAMPLE_VIDEO_ID_2 }}
ONFIDO_SAMPLE_MOTION_ID_1: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_1 }}
ONFIDO_SAMPLE_MOTION_ID_2: ${{ secrets.ONFIDO_SAMPLE_MOTION_ID_2 }}
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: "11"
distribution: "adopt"
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- id: install-secret-key
name: Install gpg secret key
run: |
echo "$GPG_KEY" > key.asc
gpg --import --no-tty --batch --yes key.asc
shell: bash
env:
GPG_KEY: ${{ secrets.GPG_SECRET_KEY }}
- name: Publish package
run: |
export GPG_TTY=$(tty)
mvn clean deploy --settings .maven.xml -Dmaven.test.skip \
-Prelease -Dgpg.passphraseEnvName=GPG_PASSPHRASE
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
5 changes: 4 additions & 1 deletion .maven.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">

<servers>
<server>
<id>ossrh</id>
Expand All @@ -11,13 +12,15 @@

<profiles>
<profile>
<id>ossrh</id>
<id>release</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<gpg.executable>${env.GPG_EXECUTABLE}</gpg.executable>
<gpg.passphrase>${env.GPG_PASSPHRASE}</gpg.passphrase>
<altSnapshotDeploymentRepository>snapshots::default::https://s01.oss.sonatype.org/content/repositories/snapshots</altSnapshotDeploymentRepository>
<altDeploymentRepository>releases::default::https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/</altDeploymentRepository>
</properties>
</profile>
</profiles>
Expand Down
Empty file removed .openapi-generator-ignore
Empty file.
Loading

0 comments on commit c306fa1

Please sign in to comment.