-
Notifications
You must be signed in to change notification settings - Fork 25
46 lines (44 loc) · 1.48 KB
/
manual_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: Manual Release Java library
on:
workflow_dispatch:
inputs:
release-tag:
description: 'Tag for the release'
required: true
jobs:
build_and_publish:
name: Build jar library
runs-on: ubuntu-latest
steps:
- name: Checkout ref from inputs
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.release-tag }}
- name: Check if specified ref is a tag
run: |
REF=${{ github.event.inputs.release-tag }}
if git show-ref --verify --quiet "refs/tags/$REF"; then
echo "Ref $REF is a tag."
else
echo "Ref $REF is not a tag."
exit 1
fi
VERSION=${REF:1}
echo "VERSION=$VERSION" >> $GITHUB_ENV
- name: Set up JDK 11
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin
- name: Build with Gradle
run: gradle build -x test
env:
VERSION: ${{ env.VERSION }}
- name: Publish package
run: gradle -x test clean build sign publish publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
VERSION: ${{ env.VERSION }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.PASSPHRASE }}
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_TOKEN }}