Skip to content

Commit

Permalink
release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
max402 committed Jan 29, 2024
1 parent a1e0467 commit a65f427
Show file tree
Hide file tree
Showing 9 changed files with 148 additions and 59 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Actions on pull requests
on:
pull_request:
branches:
- develop
- master

jobs:
pull-request-job:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4

- name: Step 2 - Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Step 3 - Cache Docker images.
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}

- name: Step 4 - Build & Test
run: mvn clean verify -ntp

- name: Step 5 - Upload coverage unittests reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_ignore: '!*datasafe-business*'
flags: unittests
verbose: true

- name: Step 6 - Upload coverage e2e tests reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_include: '*datasafe-business*'
flags: e2e_tests
verbose: true
22 changes: 0 additions & 22 deletions .github/workflows/pull-requests.yml

This file was deleted.

53 changes: 53 additions & 0 deletions .github/workflows/push-develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Develop branch build
on:
push:
branches:
- develop

jobs:
develop-build-job:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4

- name: Step 2 - Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Step 3 - Cache Docker images.
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}

- name: Step 4 - Build & Test
run: mvn clean verify -ntp

- name: Step 5 - Deploy Snapshot
run: ./scripts/mvn_deploy.sh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_EXECUTABLE: gpg
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}

- name: Step 6 - Upload coverage unittests reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_ignore: '!*datasafe-business*'
flags: unittests
verbose: true

- name: Step 7 - Upload coverage e2e tests reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
gcov_include: '*datasafe-business*'
flags: e2e_tests
verbose: true
37 changes: 37 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Release to Maven Central
on:
push:
tags:
- v*

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Step 1 - Checkout repository code
uses: actions/checkout@v4

- name: Step 2 - Setup JDK
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
cache: 'maven'

- name: Step 3 - Cache Docker images.
uses: ScribeMD/[email protected]
with:
key: docker-${{ runner.os }}

- name: Step 4 - Maven deploy release
run: ./scripts/mvn_deploy.sh
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
GPG_EXECUTABLE: gpg
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
GPG_OWNERTRUST: ${{ secrets.GPG_OWNERTRUST }}

# - name: Step 4 - Push JavaDoc to GitHub Pages
# run: ./scripts/push-javadoc-to-gh-pages.sh
11 changes: 0 additions & 11 deletions .travis/codecov_bash.sh

This file was deleted.

8 changes: 0 additions & 8 deletions .travis/deploy.sh

This file was deleted.

24 changes: 6 additions & 18 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,14 @@
<src.dir>src/main/java</src.dir>
<test.src.dir>src/test/java</test.src.dir>

<!-- TODO: should be maven.multiModuleProjectDirectory but not using it because Intellij does not support it -->
<jacoco.reportPath>${basedir}/../../target/jacoco.exec</jacoco.reportPath>
<jacoco.e2e.reportPath>${basedir}/../target/jacoco-e2e.exec</jacoco.e2e.reportPath>
<jacoco.reportPath>${maven.multiModuleProjectDirectory}/target/jacoco.exec</jacoco.reportPath>
<jacoco.e2e.reportPath>${maven.multiModuleProjectDirectory}/target/jacoco-e2e.exec</jacoco.e2e.reportPath>

<graal.version>19.2.0</graal.version>
<maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<maven.dependency.plugin.version>3.6.0</maven.dependency.plugin.version>
<maven.dependency.plugin.version>3.6.1</maven.dependency.plugin.version>
<lombok.version>1.18.30</lombok.version>
<gson.version>2.8.9</gson.version>
<dagger.version>2.46.1</dagger.version>
Expand All @@ -96,7 +95,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<deploy.disabled>false</deploy.disabled>
<testcontainers.version>1.18.3</testcontainers.version>
<jacoco.version>0.8.10</jacoco.version>
<jacoco.version>0.8.11</jacoco.version>
<commons.io.version>2.5</commons.io.version>
<slf4j-simple.version>2.0.7</slf4j-simple.version>
<drools.version>9.44.0.Final</drools.version>
Expand Down Expand Up @@ -387,6 +386,7 @@
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<version>${maven.dependency.plugin.version}</version>
<executions>
Expand Down Expand Up @@ -519,6 +519,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
<configuration>
<annotationProcessorPaths>
<path>
Expand Down Expand Up @@ -586,8 +587,6 @@
<serverId>sonatype</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<autoReleaseAfterClose>true</autoReleaseAfterClose>
<keepStagingRepositoryOnFailure>true</keepStagingRepositoryOnFailure>
<stagingProgressTimeoutMinutes>30</stagingProgressTimeoutMinutes>
</configuration>
</plugin>
<plugin>
Expand All @@ -608,11 +607,6 @@
<artifactId>maven-gpg-plugin</artifactId>
<version>${maven-gpg-plugin.version}</version>
<configuration>
<keyname>[email protected]</keyname>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
<executions>
<execution>
Expand All @@ -621,12 +615,6 @@
<goals>
<goal>sign</goal>
</goals>
<configuration>
<gpgArguments>
<arg>--pinentry-mode</arg>
<arg>loopback</arg>
</gpgArguments>
</configuration>
</execution>
</executions>
</plugin>
Expand Down
8 changes: 8 additions & 0 deletions scripts/mvn_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash

set -e

echo "$GPG_SECRET_KEY" | base64 --decode | $GPG_EXECUTABLE --import --no-tty --batch --yes || true
echo "$GPG_OWNERTRUST" | base64 --decode | $GPG_EXECUTABLE --import-ownertrust --no-tty --batch --yes || true

mvn clean deploy -ntp --settings scripts/settings.xml gpg:sign -Prelease -DskipTests -U || exit 1
File renamed without changes.

0 comments on commit a65f427

Please sign in to comment.