-
Notifications
You must be signed in to change notification settings - Fork 1
39 lines (38 loc) · 1.49 KB
/
build-release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Build and publish artifact
on:
release:
types: [published]
env:
NEW_VERSION: ${{ github.event.release.tag_name }}
jobs:
build_and_release:
runs-on: ubuntu-latest
steps:
- name: Setup java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/cache@v4
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('build.gradle.kts') }}
restore-keys: |
${{ runner.os }}-gradle-cache-
- uses: actions/cache@v4
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- name: build artifact
run: ./gradlew -Pversion=${{ env.NEW_VERSION }} clean build
- name: upload artifact to maven central portal
run: ./gradlew -Pversion=${{ env.NEW_VERSION }} publishToMavenCentral --no-configuration-cache
env:
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.JRELEASER_GPG_SECRET_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.JRELEASER_GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.JRELEASER_MAVENCENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.JRELEASER_MAVENCENTRAL_PASSWORD }}