-
-
Notifications
You must be signed in to change notification settings - Fork 4
49 lines (41 loc) · 1.55 KB
/
build_and_release_github.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
name: Build and deploy releases to GitHub
on:
push:
tags:
- '*'
jobs:
release:
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Import GPG key
run: |
echo "$GPG_SIGNING_KEY_PW" | gpg --batch --import --yes --passphrase-fd 0 <(echo -n "$GPG_SIGNING_KEY_B64" | base64 --decode)
env:
GPG_SIGNING_KEY_B64: ${{ secrets.GPG_PRIVATE_KEY_B64 }}
GPG_SIGNING_KEY_PW: ${{ secrets.GPG_PASSPHRASE }}
- name: Setup GPG key information
run: |
mkdir -p ~/.gradle ~/.gnupg
echo "signing.gnupg.homeDir=/home/runner/.gnupg" >> ~/.gradle/gradle.properties
echo "signing.gnupg.executable=gpg" >> ~/.gradle/gradle.properties
echo "signing.gnupg.keyName=ABC48776" >> ~/.gradle/gradle.properties
echo "signing.gnupg.passphrase=${GPG_SIGNING_KEY_PW}" >> ~/.gradle/gradle.properties
env:
GPG_SIGNING_KEY_PW: ${{ secrets.GPG_PASSPHRASE }}
- name: Build package
run: ./gradlew clean build
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_SIGNING_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
- name: Release package
run: ./gradlew githubRelease
env:
RELEASE_GRADLE_PLUGIN_TOKEN: ${{ secrets.RELEASE_GRADLE_PLUGIN_TOKEN }}