-
Notifications
You must be signed in to change notification settings - Fork 517
52 lines (45 loc) · 1.83 KB
/
publish-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
40
41
42
43
44
45
46
47
48
49
50
51
52
name: Publish Release
on:
push:
tags:
- '*.*.*'
jobs:
publish-release:
name: Publish Release
runs-on: ubuntu-latest
if: github.repository == 'kizitonwose/Calendar'
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches/
~/.gradle/wrapper/
key: cache-gradle-${{ hashFiles('**/*.gradle', '**/gradle-wrapper.properties') }}
restore-keys: cache-gradle-
- name: Setup Java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 17
- name: Retrieve Version
run: |
echo "VERSION_NAME=$(cat gradle.properties | grep -w "VERSION_NAME" | cut -d'=' -f2)" >> $GITHUB_ENV
- name: Deploy Release to Maven
run: ./gradlew publish
# if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SONATYPE_NEXUS_SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SONATYPE_NEXUS_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SONATYPE_NEXUS_SIGNING_KEY_PASSWORD }}
# => MANUALLY RELEASE VIA SONATYPE UI FOR NOW <=
# - name: Publish Release to Maven
# run: ./gradlew closeAndReleaseRepository
# if: "!endsWith(env.VERSION_NAME, '-SNAPSHOT')"
# env:
# ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
# ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}