-
Notifications
You must be signed in to change notification settings - Fork 24
65 lines (61 loc) · 1.8 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
name: Create release to Maven Central
on:
push:
tags:
- 'v*'
env:
PGP_SEC: ${{ secrets.PGP_SEC }}
PGP_PASSWORD: ${{ secrets.PGP_PASSWORD }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
jobs:
release:
name: Build release
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ macos-latest ]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
# release workflow should have access to all tags
fetch-depth: 0
- name: Set up JDK 8
uses: actions/setup-java@v4
with:
java-version: 8
distribution: zulu
- name: Status git before
run: git status
- uses: burrunan/gradle-cache-action@v1
with:
gradle-version: wrapper
# Until https://github.com/burrunan/gradle-cache-action/issues/42 is addressed, gradle should be run as a separate step
- name: gradle release from tag
# if workflow is triggered after push of a tag, deploy full release
if: ${{ startsWith(github.ref, 'refs/tags/') }}
run: ./gradlew
--console=rich
-Prelease
-PgprUser=${{ github.actor }}
-PgprKey=${{ secrets.GITHUB_TOKEN }}
publishToSonatype
- name: Status git after
if: ${{ always() }}
run: git status
github_release:
needs: release
name: Create Github Release
runs-on: ubuntu-latest
steps:
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false