-
Notifications
You must be signed in to change notification settings - Fork 13
71 lines (62 loc) · 2.5 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
name: Release
on:
workflow_dispatch:
inputs:
versionname:
description: 'Version Name'
required: true
default: ''
changes:
description: 'Release notes'
required: true
default: ''
jobs:
release:
name: Release
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'zulu'
java-version: 17
- name: Setup gradle
uses: gradle/gradle-build-action@v2
- name: Install gpg secret key
run: cat <(echo -e "${{ secrets.PUBLISH_SIGNING_KEY_LITERAL }}") | gpg --batch --import
- name: List gpg secret keys
run: gpg --list-secret-keys --keyid-format LONG
- name: Export gpg secret key
run: sudo gpg --export-secret-keys --pinentry-mode loopback --passphrase=${{ secrets.PUBLISH_SIGNING_KEY_PASSWORD }} ${{ secrets.PUBLISH_SIGNING_KEY_ID }} > ${{ secrets.PUBLISH_SIGNING_KEY_LOCATION }}
- name: Update Version Name
run: ./gradlew updateVersion -PversionName=${{ github.event.inputs.versionname }}
- name: Publish Release
env:
PUBLISH_GITHUB_USER: ${{ secrets.PUBLISH_GITHUB_USER }}
PUBLISH_GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
PUBLISH_SONATYPE_USER: ${{ secrets.PUBLISH_SONATYPE_USER }}
PUBLISH_SONATYPE_PASSWORD: ${{ secrets.PUBLISH_SONATYPE_PASSWORD }}
PUBLISH_SIGNING_KEY_ID: ${{ secrets.PUBLISH_SIGNING_KEY_ID }}
PUBLISH_SIGNING_KEY_PASSWORD: ${{ secrets.PUBLISH_SIGNING_KEY_PASSWORD }}
PUBLISH_SIGNING_KEY_LOCATION: ${{ secrets.PUBLISH_SIGNING_KEY_LOCATION }}
run: ./gradlew publishAllPublicationsToSonatypeRepository --no-parallel # publishAllPublicationsToGitHubPackagesRepository
- name: Update Repo
uses: EndBug/add-and-commit@v5
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
with:
add: "./version.properties"
message: ${{ format('Released {0}', github.event.inputs.versionname) }}
push: true
- name: Create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.PUBLISH_GITHUB_TOKEN }}
with:
tag_name: ${{ github.event.inputs.versionname }}
release_name: Release ${{ github.event.inputs.versionname }}
body: ${{ github.event.inputs.changes }}
draft: false
prerelease: false