-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (45 loc) · 1.45 KB
/
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
name: Release
on:
release:
types: [ created ]
jobs:
cleanup:
runs-on: ubuntu-latest
permissions: write-all
steps:
- name: 🗑 Delete deployment
uses: strumwolf/delete-deployment-environment@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
environment: Maven Central
onlyRemoveDeployments: true
release:
needs: cleanup
runs-on: ubuntu-latest
environment: Maven Central
permissions:
contents: read
packages: write
steps:
- name: ✅ Checkout Project
uses: actions/checkout@v4
- name: 📐 Setup Java
uses: actions/setup-java@v4
with:
distribution: corretto
java-version: 17
- name: 📐 Setup Gradle
uses: gradle/actions/setup-gradle@v3
- name: 👷 Gradle Build
run: |
chmod +x ./gradlew
./gradlew build
- name: 🚀 Deploy
run: ./gradlew publishAndReleaseToMavenCentral
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_SIGNING_KEY }}
# ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.MAVEN_SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_SIGNING_PASSWORD }}