-
Notifications
You must be signed in to change notification settings - Fork 2
42 lines (35 loc) · 1.41 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
name: Release
on:
push:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'corretto'
cache: 'gradle'
- name: Check version
run: |
VERSION_TAG=${{ github.ref_name }}
VERSION_TAG=${VERSION_TAG#v}
PROJECT_VERSION=$(grep "^version=" gradle.properties | cut -d'=' -f2)
if [[ "$PROJECT_VERSION" == "${VERSION_TAG}-SNAPSHOT" ]]; then
echo "Version match: tag $VERSION_TAG matches project version $PROJECT_VERSION, proceeding with release"
else
echo "Version mismatch: tag $VERSION_TAG does not match project version $PROJECT_VERSION"
exit 1
fi
- name: Build
run: ./gradlew clean build --no-daemon --stacktrace
- name: Decrypt secring.gpg
run: openssl enc -aes-256-cbc -d -pbkdf2 -in secring.gpg.bin -out secring.gpg -pass pass:${{ secrets.privateKeyPassword }}
- name: Release
run: RELEASE=true OSSRH_USER=${{ secrets.OSSRH_USER }} OSSRH_PASSWORD=${{ secrets.OSSRH_PASSWORD }} ./gradlew publish -Psigning.secretKeyRingFile=$(pwd)/secring.gpg -Psigning.keyId=${{ secrets.signKeyId }} -Psigning.password=${{ secrets.signPassword }}