42 lines
1.3 KiB
YAML
42 lines
1.3 KiB
YAML
name: Build & Release
|
|
on:
|
|
push:
|
|
tags:
|
|
- '[0-9]+.[0-9]+.[0-9]+'
|
|
|
|
env:
|
|
ORG_GRADLE_PROJECT_BUILD_VERSION: ${{ gitea.ref_name }}
|
|
ORG_GRADLE_PROJECT_DEVSOAP_GPG_KEY: ${{ secrets.GPG_DEVSOAP_PRIVATE_KEY }}
|
|
ORG_GRADLE_PROJECT_DEVSOAP_GPG_PASSWORD: ${{ secrets.GPG_DEVSOAP_PASSPHRASE }}
|
|
ORG_GRADLE_PROJECT_SONATYPE_TOKEN: ${{ secrets.SONATYPE_TOKEN }}
|
|
RUNNER_TOOL_CACHE: /toolcache
|
|
|
|
jobs:
|
|
release-library:
|
|
runs-on: node20
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ssh-key: ${{ secrets.SSH_JOHN_PRIVATE_KEY }}
|
|
- name: Configure Java project
|
|
uses: actions/setup-java@v4
|
|
with:
|
|
distribution: 'temurin'
|
|
java-version: '21'
|
|
cache: 'gradle'
|
|
- name: Cache Java dependencies
|
|
uses: actions/cache@v4
|
|
env:
|
|
cache-name: cache-java-dependencies
|
|
with:
|
|
path: ~/.gradle
|
|
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/build.gradle') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-build-${{ env.cache-name }}-
|
|
${{ runner.os }}-build-
|
|
${{ runner.os }}-
|
|
- name: Run tests
|
|
run: ./gradlew --info --stacktrace test
|
|
- name: Upload to Maven Central
|
|
run: ./gradlew publishToMavenCentral |