forked from pgreze/android-reactions
-
Notifications
You must be signed in to change notification settings - Fork 0
56 lines (53 loc) · 2.08 KB
/
deploy.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
# https://help.github.com/en/actions/language-and-framework-guides/building-and-testing-java-with-gradle
# https://help.github.com/en/actions/language-and-framework-guides/publishing-java-packages-with-gradle
name: Publish
on:
push:
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
publish:
runs-on: ubuntu-latest
steps:
# setup
- uses: actions/checkout@v2
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
# Cache
- name: Cache Gradle wrapper
uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/*') }}
restore-keys: ${{ runner.os }}-gradle-${{ hashFiles('gradle/wrapper/*') }}
- name: Cache Gradle packages
uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
restore-keys: ${{ runner.os }}-gradle
# Publish
- name: Publish to Maven Central
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
SIGNING_SECRET_KEY_RING_CONTENT: ${{ secrets.SIGNING_SECRET_KEY_RING_CONTENT }}
run: |
export SIGNING_SECRET_KEY_RING_FILE=secret-key.gpg
echo $SIGNING_SECRET_KEY_RING_CONTENT | base64 -di > $SIGNING_SECRET_KEY_RING_FILE
./gradlew assembleRelease
./gradlew --max-workers 1 publishMavenPublicationToSonatypeRepository closeAndReleaseRepository
# Documentation
- name: Generate Dokka
run: ./gradlew library:dokka
- name: Publish Dokka
uses: netlify/actions/cli@master
with:
args: deploy --dir=library/build/dokka/android-reactions --prod
env:
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}