Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
anidotnet committed Jan 6, 2024
2 parents d981831 + 87793b1 commit 3bc6918
Show file tree
Hide file tree
Showing 17 changed files with 407 additions and 124 deletions.
37 changes: 3 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,6 @@ jobs:
java: ['11', '17']
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

name: Build with Java ${{ matrix.java }} in Ubuntu
steps:
Expand All @@ -40,36 +36,9 @@ jobs:
java-package: jdk
architecture: x64
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Prepare PGP Keys
if: github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/release'
run: openssl aes-256-cbc -pass pass:$PGP_KEY_PASSWORD -in ./.ci/secring.gpg.enc -out $GITHUB_WORKSPACE/secring.gpg -d -md md5
env:
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

- name: Build with Maven
run: mvn -B -ff -ntp clean install

- name: Deploy Snapshot
if: github.ref == 'refs/heads/develop' && matrix.java == '11'
run: mvn -B -ff -ntp deploy -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

- name: Deploy Release
if: github.ref == 'refs/heads/release' && matrix.java == '11'
run: mvn -B -ff -ntp release:clean release:prepare release:perform -DskipTests
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
run: mvn -B -ff -ntp clean install -Dgpg.skip=true

- name: Publish Code Coverage
if: github.ref == 'refs/heads/main' && matrix.java == '11'
Expand Down Expand Up @@ -100,7 +69,7 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn -B -ff -ntp clean install
run: mvn -B -ff -ntp clean install -Dgpg.skip=true

build_windows:
runs-on: windows-latest
Expand All @@ -123,4 +92,4 @@ jobs:
cache: 'maven'

- name: Build with Maven
run: mvn -B -ff -ntp clean install
run: mvn -B -ff -ntp clean install --% -Dgpg.skip=true
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release

on:
workflow_run:
workflows:
- Build
branches:
- release
types:
- completed

jobs:
release:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Release
runs-on: ubuntu-latest
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

steps:
- uses: actions/checkout@v4
- uses: fregante/setup-git-user@v2
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
java-package: jdk
architecture: x64
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Prepare PGP Keys
run: |
openssl aes-256-cbc -pass pass:"$PGP_KEY_PASSWORD" -in "$GITHUB_WORKSPACE"/.ci/secring.gpg.enc -out "$GITHUB_WORKSPACE"/secring.gpg -d -md md5
mkdir -p "$HOME"/.gnupg
cp "$GITHUB_WORKSPACE"/secring.gpg "$HOME"/.gnupg/secring.gpg
echo "allow-loopback-pinentry" >> "$HOME"/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >> "$HOME"/.gnupg/gpg.conf
gpgconf --reload gpg-agent
shell: bash
env:
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

- name: Deploy Release
run: mvn -B -ff -ntp deploy -DskipTests -Dgpg.passphrase="$PGP_KEY_PASSWORD"
shell: bash
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
57 changes: 57 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Snapshot

on:
workflow_run:
workflows:
- Build
branches:
- develop
types:
- completed

jobs:
snapshot:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
name: Snapshot
runs-on: ubuntu-latest
env:
JAVA_OPTS: "-XX:+TieredCompilation -XX:TieredStopAtLevel=1"
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_ID: ${{ secrets.PGP_KEY_ID }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

steps:
- uses: actions/checkout@v4
- uses: fregante/setup-git-user@v2
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: 'zulu'
java-package: jdk
architecture: x64
cache: 'maven'
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD

- name: Prepare PGP Keys
run: |
openssl aes-256-cbc -pass pass:"$PGP_KEY_PASSWORD" -in "$GITHUB_WORKSPACE"/.ci/secring.gpg.enc -out "$GITHUB_WORKSPACE"/secring.gpg -d -md md5
mkdir -p "$HOME"/.gnupg
cp "$GITHUB_WORKSPACE"/secring.gpg "$HOME"/.gnupg/secring.gpg
echo "allow-loopback-pinentry" >> "$HOME"/.gnupg/gpg-agent.conf
echo "pinentry-mode loopback" >> "$HOME"/.gnupg/gpg.conf
gpgconf --reload gpg-agent
shell: bash
env:
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}

- name: Deploy Snapshot
run: mvn -B -ff -ntp deploy -DskipTests -Dgpg.passphrase="$PGP_KEY_PASSWORD"
shell: bash
env:
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }}
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
PGP_KEY_PASSWORD: ${{ secrets.PGP_KEY_PASSWORD }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -452,4 +452,5 @@ test.log
/build
!no2-old.db
.diffblue
infer-out
infer-out
secring.gpg
Loading

0 comments on commit 3bc6918

Please sign in to comment.