-
Notifications
You must be signed in to change notification settings - Fork 253
70 lines (61 loc) · 2.08 KB
/
ci.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
name: CI
on:
push:
branches: [ master ]
pull_request:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
jdk:
- 17
steps:
- uses: actions/checkout@v4
- name: Import snapshot GPG key
run: |
echo "$GPG_SIGNING_KEY_PW" | gpg --batch --import --yes --passphrase-fd 0 <(echo -n "$GPG_SIGNING_KEY" | base64 --decode)
mkdir -p ~/.gradle
echo -n "signing.gnupg.passphrase=${GPG_SIGNING_KEY_PW}" >> ~/.gradle/gradle.properties
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
GPG_SIGNING_KEY_PW: ${{ secrets.GPG_SIGNING_KEY_PW }}
if: >-
github.repository == 'KeepSafe/dexcount-gradle-plugin' && github.ref == 'refs/heads/master'
- name: Import random GPG key
run: |
gpg --batch --gen-key <(cat <<EOF
Key-Type: 1
Key-Length: 2048
Key-Usage: sign
Passphrase: foobar
Name-Real: Dexcount Developers
Name-Email: [email protected]
Expire-Date: seconds=1200
%commit
EOF
)
mkdir -p ~/.gradle
echo -n "signing.gnupg.passphrase=foobar" >> ~/.gradle/gradle.properties
if: >-
github.repository != 'KeepSafe/dexcount-gradle-plugin' ||
github.ref != 'refs/heads/master'
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v3
with:
java-version: ${{ matrix.jdk }}
distribution: 'zulu'
- name: Cache Gradle
uses: gradle/gradle-build-action@v2
- name: Build and test
run: ./gradlew check
- name: Deploy snapshot
run: ./gradlew uploadSnapshot
if: >-
github.event_name == 'push' &&
github.repository == 'KeepSafe/dexcount-gradle-plugin' &&
github.ref == 'refs/heads/master'
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_NEXUS_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_NEXUS_PASSWORD }}