-
Notifications
You must be signed in to change notification settings - Fork 3
81 lines (75 loc) · 2.53 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
name: Release
on:
push:
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:
cleanup-runs:
runs-on: ubuntu-latest
steps:
- uses: rokroskar/[email protected]
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
if: "!startsWith(github.ref, 'refs/tags/') && github.ref != 'refs/heads/main'"
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK 11
uses: actions/setup-java@v1
with:
java-version: 11
- name: Set tag version
id: get_ver
run: |
echo "::set-output name=release_tag::${GITHUB_REF##*/}"
- name: Create release ${{ steps.get_ver.outputs.release_tag }}
uses: actions/create-release@v1
id: create_release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
body_path: RELEASE_CHANGELOG.md
publish-libraries:
needs: release
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=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
VERSION=$(echo $VERSION | sed -e 's/^v//')
echo version::${VERSION}
./gradlew publishToSonatype \
closeAndReleaseSonatypeStagingRepository \
-Pversion=${VERSION} \
-PartifactVersion=${VERSION} \
-Psigning.keyId=B7D30ABE \
-Psigning.password="$GPG_PASSWORD" \
-Psigning.secretKeyRingFile=$GITHUB_WORKSPACE/release.gpg \
--info