-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configuring GitHub package Maven repos.
- Loading branch information
1 parent
629a1f9
commit 3b5f838
Showing
4 changed files
with
135 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,127 @@ | ||
on: | ||
push: | ||
branches: | ||
- release/** | ||
- develop | ||
- feature/** | ||
pull_request: | ||
types: [opened, synchronize, reopened] | ||
branches: | ||
- release/** | ||
- develop | ||
- feature/** | ||
merge_group: | ||
workflow_dispatch: | ||
name: Build and Test | ||
env: | ||
BUILD_SNAPSHOT: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && | ||
(github.ref_name == 'develop' || startsWith(github.ref_name, 'release/')) }} | ||
MAVEN_VERSION: 3.9.8 | ||
JAVA_DISTRO: temurin | ||
JAVA_VERSION_FILE: .java-version | ||
jobs: | ||
build-code: | ||
name: Code | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
# security-events: write | ||
|
||
steps: | ||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | ||
with: | ||
submodules: recursive | ||
filter: tree:0 | ||
# ------------------------- | ||
# Java Environment Setup | ||
# ------------------------- | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 | ||
with: | ||
maven-version: ${{ env.MAVEN_VERSION }} | ||
- name: Set up JDK 11 (build only) | ||
if: ${{ !((github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'develop') }} | ||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 | ||
with: | ||
java-version-file: ${{ env.JAVA_VERSION_FILE }} | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
cache: 'maven' | ||
- name: Set up JDK 11 (deploy) | ||
if: (github.event_name == 'push' || github.event_name == 'workflow_dispatch') && github.ref_name == 'develop' | ||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 | ||
with: | ||
java-version-file: ${{ env.JAVA_VERSION_FILE }} | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
cache: 'maven' | ||
server-id: ossrh # Value of the distributionManagement/repository/id field of the pom.xml | ||
server-username: MAVEN_USERNAME # env variable for username in deploy | ||
server-password: MAVEN_CENTRAL_TOKEN # env variable for token in deploy | ||
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} # Value of the GPG private key to import | ||
gpg-passphrase: MAVEN_GPG_PASSPHRASE # env variable for GPG private key passphrase | ||
# - uses: s4u/maven-settings-action@7802f6aec16c9098b4798ad1f1d8ac75198194bd | ||
# with: | ||
# servers: | | ||
# [{ | ||
# "id": "github", | ||
# "configuration": { | ||
# "username": "GITHUB_ACTOR", | ||
# "password": "GITHUB_TOKEN" | ||
# } | ||
# }] | ||
# - name: Initialize CodeQL | ||
# if: github.event_name == 'push' | ||
# uses: github/codeql-action/init@3ab4101902695724f9365a384f86c1074d94e18c | ||
# with: | ||
# languages: java | ||
# ------------------------- | ||
# Maven Build | ||
# ------------------------- | ||
- id: build-test-deploy | ||
name: Build, Test and DEPLOY SNAPSHOT Code | ||
if: ${{ env.BUILD_SNAPSHOT == 'true' }} | ||
run: | | ||
mvn -B -e -Prelease -Pgpg deploy site -Dmaven.deploy.skip=releases | ||
env: | ||
MAVEN_USERNAME: ${{ secrets.OSSRH_USER }} | ||
MAVEN_CENTRAL_TOKEN: ${{ secrets.OSSRH_TOKEN }} | ||
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
- name: Build and Test Code / Website | ||
if: ${{ steps.build-test-deploy.outcome == 'skipped' }} | ||
run: | | ||
mvn -B -e -Prelease install | ||
# - name: Perform CodeQL Analysis | ||
# if: github.event_name == 'push' | ||
# uses: github/codeql-action/analyze@3ab4101902695724f9365a384f86c1074d94e18c | ||
# with: | ||
# upload: ${{ github.ref_name == 'develop' && 'always' || 'never' }} | ||
build-website: | ||
name: Website | ||
runs-on: ubuntu-20.04 | ||
permissions: | ||
actions: read | ||
contents: read | ||
steps: | ||
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 | ||
with: | ||
submodules: recursive | ||
filter: tree:0 | ||
# ------------------------- | ||
# Java Environment Setup | ||
# ------------------------- | ||
- name: Set up Maven | ||
uses: stCarolas/setup-maven@d6af6abeda15e98926a57b5aa970a96bb37f97d1 | ||
with: | ||
maven-version: ${{ env.MAVEN_VERSION }} | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 | ||
with: | ||
java-version-file: ${{ env.JAVA_VERSION_FILE }} | ||
distribution: ${{ env.JAVA_DISTRO }} | ||
cache: 'maven' | ||
# ------------------------- | ||
# Maven Build | ||
# ------------------------- | ||
- name: Build and Test Website | ||
run: | | ||
mvn -B -e -Prelease install site site:stage -Dmaven.test.skip=true |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters