-
Notifications
You must be signed in to change notification settings - Fork 3
56 lines (52 loc) · 1.87 KB
/
publish.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
53
54
55
56
name: Publish
on:
push:
branches: [ main ]
tags:
- "v[0-9]+.[0-9]+.[0-9]+" # Push events to matching v*, i.e. v1.0, v20.15.10
- "v[0-9]+.[0-9]+.[0-9]+-rc*" # Push events to matching v*, i.e. v1.0-rc1, v20.15.10-rc5
jobs:
publish-libraries:
runs-on: ubuntu-latest
name: Publishing Explorer Libraries
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Java Setup
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: 11
server-id: github
- name: GPG Setup
env:
GPG_KEY: ${{ secrets.OSSRH_GPG_SECRET_KEY }}
run: |
export GPG_TTY=$(tty)
echo -n "$GPG_KEY" | base64 --decode | gpg --batch --import
gpg --list-secret-keys --keyid-format LONG
echo -n "$GPG_KEY" | base64 --decode > $GITHUB_WORKSPACE/release.gpg
- name: Build and Publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
GPG_PASSWORD: ${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }}
run: |
VERSION=noop
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
elif [[ $GITHUB_REF == refs/heads/* ]]; then
VERSION=$(echo ${GITHUB_REF#refs/heads/} | sed -r 's#/+#-#g')
echo ::set-output name=branch::${VERSION}
if [ "${{ github.event.repository.default_branch }}" = "$VERSION" ]; then
VERSION=latest
fi
fi
echo version::${VERSION}
./gradlew publish \
-Pversion=${VERSION} \
-PartifactVersion=${VERSION} \
-Psigning.keyId=B7D30ABE \
-Psigning.password="$GPG_PASSWORD" \
-Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
--info