-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (45 loc) · 1.71 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
name: Publish release
on:
push:
tags:
- "*"
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: 17
- name: Check version not snapshot
run: |
PROJECT_VERSION=$(./gradlew -q printVersion | tail -n 1)
echo "Project version is $PROJECT_VERSION"
if [[ "$PROJECT_VERSION" == *"SNAPSHOT" ]]; then exit 1; fi
- name: Decrypt large secret
run: |
chmod +x ./.github/workflows/decrypt_secret.sh
./.github/workflows/decrypt_secret.sh
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Build
run: ./gradlew build
- name: Publish
run: ./gradlew publish -PossrhUrl="$PUBLISH_RELEASE_REPO_URL" -PossrhUsername="$PUBLISH_REPO_USERNAME" -PossrhPassword="$PUBLISH_REPO_PASSWORD" -Psigning.keyId="$GPG_KEY_ID" -Psigning.password="$GPG_PASSPHRASE" -Psigning.secretKeyRingFile="$SIGN_FILE_PATH"
env:
PUBLISH_RELEASE_REPO_URL: https://oss.sonatype.org/service/local/staging/deploy/maven2/
PUBLISH_REPO_USERNAME: ${{ secrets.SONATYPE_OSS_USERNAME }}
PUBLISH_REPO_PASSWORD: ${{ secrets.SONATYPE_OSS_PASSWORD }}
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SIGN_FILE_PATH: .github/workflows/project.gpg
- name: Create Github release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: true