70 lines
2.2 KiB
YAML
70 lines
2.2 KiB
YAML
# This workflow uses actions that are not certified by GitHub.
|
|
# They are provided by a third-party and are governed by
|
|
# separate terms of service, privacy policy, and support
|
|
# documentation.
|
|
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
|
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle
|
|
|
|
name: on-merge
|
|
|
|
on:
|
|
push:
|
|
branches: [ master, main, beta/new_java_build ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2
|
|
- name: Set up JDK 17
|
|
uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12
|
|
with:
|
|
java-version: '17'
|
|
distribution: 'temurin'
|
|
cache: maven
|
|
server-id: ossrh
|
|
server-username: ${{ secrets.OSSRH_USERNAME }}
|
|
server-password: ${{ secrets.OSSRH_PASSWORD }}
|
|
|
|
- name: Cache local Maven repository
|
|
uses: actions/cache@36f1e144e1c8edb0a652766b484448563d8baf46
|
|
with:
|
|
path: ~/.m2/repository
|
|
key: ${{ runner.os }}-17-maven-${{ hashFiles('**/pom.xml') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-17-maven-
|
|
|
|
- name: Configure GPG Key
|
|
run: |
|
|
echo -n "$GPG_SIGNING_KEY" | base64 --decode | gpg --import
|
|
env:
|
|
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
|
|
|
|
- name: Build with Maven
|
|
run: mvn --batch-mode --update-snapshots verify
|
|
|
|
- name: Upload coverage to Codecov
|
|
uses: codecov/codecov-action@v5.3.1
|
|
with:
|
|
token: ${{ secrets.CODECOV_TOKEN }} # not required for public repos
|
|
flags: unittests # optional
|
|
name: coverage # optional
|
|
fail_ci_if_error: true # optional (default = false)
|
|
verbose: true # optional (default = false)
|
|
|
|
# Add -SNAPSHOT before deploy
|
|
- name: Add SNAPSHOT
|
|
run: mvn versions:set -DnewVersion='${project.version}-SNAPSHOT'
|
|
|
|
- name: Deploy
|
|
run: |
|
|
mvn --batch-mode \
|
|
--settings release/m2-settings.xml clean deploy
|
|
env:
|
|
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
|
|
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
|