|
1 | | -name: build |
| 1 | +name: build dist |
2 | 2 |
|
3 | 3 | on: |
4 | 4 | push: |
5 | 5 | pull_request: |
6 | | - workflow_call: |
7 | 6 |
|
8 | 7 | jobs: |
9 | 8 | linux-build: |
10 | 9 | name: build on linux |
11 | 10 | runs-on: ubuntu-24.04 |
12 | 11 | steps: |
13 | 12 | - name: checkout |
14 | | - uses: actions/checkout@v4 |
| 13 | + uses: actions/checkout@v1 |
15 | 14 | with: |
16 | 15 | submodules: recursive |
17 | 16 | - name: apt update |
|
22 | 21 | with: |
23 | 22 | java-version: 17 |
24 | 23 | distribution: temurin |
| 24 | + # ONLY FOR NEW RELEASE TAGS |
| 25 | + - name: setup gpg necessities |
| 26 | + if: startsWith(github.ref, 'refs/tags/') |
| 27 | + run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > $WORKSPACE/'$SIGNING_SECRET_KEY_RING_FILE'" |
| 28 | + env: |
| 29 | + WORKSPACE: ${{ github.workspace }} |
| 30 | + GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }} |
| 31 | + SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }} |
| 32 | + # ONLY FOR NEW RELEASE TAGS |
| 33 | + - name: rewrite publish-pom.gradle to require signing |
| 34 | + if: startsWith(github.ref, 'refs/tags/') |
| 35 | + run: | |
| 36 | + sed -i "s/signing {}/signing { sign(publishing.publications) }/" publish-pom.gradle |
25 | 37 | - name: cache AVD |
26 | 38 | uses: actions/cache@v4 |
27 | 39 | env: |
|
39 | 51 | - name: apt install |
40 | 52 | run: | |
41 | 53 | echo y | sudo apt-get install doxygen libxml2-dev libgrpc++-dev libgrpc-dev libprotobuf-dev protobuf-compiler protobuf-compiler-grpc graphviz cmake ninja-build |
| 54 | + # ONLY FOR NON-RELEASES |
42 | 55 | - name: build |
| 56 | + if: ${{ !startsWith(github.ref, 'refs/tags/') }} |
43 | 57 | run: ./gradlew build dokkaHtml publishToMavenLocal |
| 58 | + # ONLY FOR NEW RELEASE TAGS |
| 59 | + - name: publish |
| 60 | + if: startsWith(github.ref, 'refs/tags/') |
| 61 | + run: ./gradlew --warning-mode all publish dokkaHtml |
| 62 | + env: |
| 63 | + OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} |
| 64 | + OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} |
| 65 | + SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }} |
| 66 | + SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} |
| 67 | + SIGNING_SECRET_KEY_RING_FILE: ${{ format('{0}/{1}', github.workspace, secrets.SIGNING_SECRET_KEY_RING_FILE) }} |
44 | 68 | - name: run instrumented tests (disabled) |
45 | 69 | if: false |
46 | 70 | # > Gradle was not able to complete device setup for: dev30_google_x86_Pixel_5 |
|
57 | 81 | path: | |
58 | 82 | ./*/build/outputs/aar/*.aar |
59 | 83 | samples/*/build/outputs/apk/debug/*.apk |
| 84 | + # Create release, only for release tags |
| 85 | + - name: Create Release |
| 86 | + uses: ncipollo/release-action@v1 |
| 87 | + if: success() && startsWith(github.ref, 'refs/tags/') |
| 88 | + with: |
| 89 | + artifacts: ./*/build/outputs/aar/*.aar,samples/*/build/outputs/apk/debug/*.apk |
| 90 | + # Update API reference, only for release tags |
| 91 | + - name: deploy to GitHub Pages |
| 92 | + if: ${{ success() && startsWith(github.ref, 'refs/tags/') }} |
| 93 | + uses: JamesIves/github-pages-deploy-action@v4 |
| 94 | + with: |
| 95 | + branch: gh-pages |
| 96 | + folder: androidaudioplugin/build/dokka/html |
60 | 97 |
|
61 | 98 | osx-build: |
62 | 99 | name: build on osx |
|
67 | 104 | with: |
68 | 105 | submodules: recursive |
69 | 106 | - name: set up JDK 17 |
70 | | - uses: actions/setup-java@v4 |
| 107 | + uses: actions/setup-java@v3 |
71 | 108 | with: |
72 | 109 | java-version: 17 |
73 | 110 | distribution: temurin |
|
0 commit comments