-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (74 loc) · 2.93 KB
/
actions.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
72
73
74
75
76
77
78
79
80
name: build dist
on:
push:
pull_request:
jobs:
linux-build:
name: build on macos-14
runs-on: macos-14
steps:
- name: checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: set up JDK 17
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 17
# Only for release tags
- name: setup gpg necessities
if: startsWith(github.ref, 'refs/tags/')
run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > $WORKSPACE/'$SIGNING_SECRET_KEY_RING_FILE'"
env:
WORKSPACE: ${{ github.workspace }}
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
- name: rewrite build.gradle.kts to require signing
if: startsWith(github.ref, 'refs/tags/')
run: |
sed -i "" "s/signing {}/signing { sign(publishing.publications) }/" compose-audio-controls/build.gradle.kts
sed -i "" "s/signing {}/signing { sign(publishing.publications) }/" compose-audio-controls-midi/build.gradle.kts
# build or publish, depending on whether it is for release tags or not
- name: build (ONLY FOR NON-RELEASES)
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
run: ./gradlew --warning-mode all build
- name: publish (ONLY FOR NEW RELEASE TAGS)
if: startsWith(github.ref, 'refs/tags/')
run: ./gradlew --warning-mode all publish dokkaHtml
env:
GITHUB_TOKEN: ${{ secrets.MAVEN_PAT }}
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_FILE: ${{ format('{0}/{1}', github.workspace, secrets.SIGNING_SECRET_KEY_RING_FILE) }}
- name: upload build failure logs
if: failure()
uses: actions/upload-artifact@v3
with:
name: test-failure-logs
path: |
compose-audio-controls/build/reports/
compose-audio-controls/*.log
compose-audio-controls-midi/build/reports/
compose-audio-controls-midi/*.log
- name: upload artifact
if: success()
uses: actions/upload-artifact@v3
with:
name: library-artifacts
path: |
compose-audio-controls/build/libs/*.jar
compose-audio-controls/build/outputs/aar/*.aar
compose-audio-controls-midi/build/libs/*.jar
compose-audio-controls-midi/build/outputs/aar/*.aar
app/build/outputs/apk/debug/*.apk
# Update API reference
# FIXME: we should probably publish compose-audio-controls-midi API too
- name: deploy to GitHub Pages
if: ${{ success() && startsWith(github.ref, 'refs/tags/') }}
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: compose-audio-controls/build/dokka/html