Skip to content

Commit ad3e651

Browse files
committed
migrate to sonatype upload as new publisher target.
1 parent 5d3cd09 commit ad3e651

File tree

12 files changed

+103
-48
lines changed

12 files changed

+103
-48
lines changed
Lines changed: 4 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
name: build dist
1+
name: build
22

33
on:
44
push:
55
pull_request:
6+
workflow_call:
67

78
jobs:
89
linux-build:
910
name: build on linux
1011
runs-on: ubuntu-24.04
1112
steps:
1213
- name: checkout
13-
uses: actions/checkout@v1
14+
uses: actions/checkout@v4
1415
with:
1516
submodules: recursive
1617
- name: apt update
@@ -21,19 +22,6 @@ jobs:
2122
with:
2223
java-version: 17
2324
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
3725
- name: cache AVD
3826
uses: actions/cache@v4
3927
env:
@@ -55,16 +43,6 @@ jobs:
5543
- name: build
5644
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
5745
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) }}
6846
- name: run instrumented tests (disabled)
6947
if: false
7048
# > Gradle was not able to complete device setup for: dev30_google_x86_Pixel_5
@@ -81,19 +59,6 @@ jobs:
8159
path: |
8260
./*/build/outputs/aar/*.aar
8361
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
9762
9863
osx-build:
9964
name: build on osx
@@ -104,7 +69,7 @@ jobs:
10469
with:
10570
submodules: recursive
10671
- name: set up JDK 17
107-
uses: actions/setup-java@v3
72+
uses: actions/setup-java@v4
10873
with:
10974
java-version: 17
11075
distribution: temurin

.github/workflows/deploy.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: deploy to Maven Central
2+
3+
on: workflow_dispatch
4+
5+
permissions:
6+
contents: read
7+
8+
jobs:
9+
build:
10+
uses: ./.github/workflows/build.yml
11+
deploy:
12+
needs: build
13+
runs-on: ubuntu-24.04
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v4
17+
with:
18+
submodules: recursive
19+
- name: set up JDK 17
20+
uses: actions/setup-java@v4
21+
with:
22+
java-version: 17
23+
distribution: temurin
24+
- name: setup gpg necessities
25+
run: sudo bash -c "echo '$GPG_KEY_CONTENTS' | base64 -d > $WORKSPACE/'$SIGNING_SECRET_KEY_RING_FILE'"
26+
env:
27+
WORKSPACE: ${{ github.workspace }}
28+
GPG_KEY_CONTENTS: ${{ secrets.GPG_KEY_CONTENTS }}
29+
SIGNING_SECRET_KEY_RING_FILE: ${{ secrets.SIGNING_SECRET_KEY_RING_FILE }}
30+
- name: rewrite publish-pom.gradle to require signing
31+
run: |
32+
sed -i "s/signing {}/signing { sign(publishing.publications) }/" publish-pom.gradle
33+
- name: publish
34+
run: ./gradlew --warning-mode=all dokkaHtml sonatypeCentralUpload
35+
env:
36+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
37+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
38+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
39+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
40+
SIGNING_SECRET_KEY_RING_FILE: ${{ format('{0}/{1}', github.workspace, secrets.SIGNING_SECRET_KEY_RING_FILE) }}
41+
- name: upload artifact
42+
if: false #success()
43+
uses: actions/upload-artifact@v4
44+
with:
45+
name: aap-core-apps-and-libs
46+
path: |
47+
./*/build/outputs/aar/*.aar
48+
samples/*/build/outputs/apk/debug/*.apk
49+
# Create release
50+
- name: Create Release
51+
uses: ncipollo/release-action@v1
52+
if: success() && startsWith(github.ref, 'refs/tags/')
53+
with:
54+
artifacts: ./*/build/outputs/aar/*.aar,samples/*/build/outputs/apk/debug/*.apk
55+
# Update API reference
56+
- name: deploy to GitHub Pages
57+
if: success() && startsWith(github.ref, 'refs/tags/')
58+
uses: JamesIves/github-pages-deploy-action@v4
59+
with:
60+
branch: gh-pages
61+
folder: androidaudioplugin/build/dokka/html

androidaudioplugin-manager/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id ("org.jetbrains.dokka")
55
id ("maven-publish")
66
id ("signing")
7+
id("cl.franciscosolis.sonatype-central-upload")
78
}
89

910
apply { from ("../common.gradle") }

androidaudioplugin-midi-device-service/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id ("org.jetbrains.dokka")
55
id ("maven-publish")
66
id ("signing")
7+
id("cl.franciscosolis.sonatype-central-upload")
78
}
89

910
apply { from ("../common.gradle") }

androidaudioplugin-testing/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id ("org.jetbrains.dokka")
55
id ("maven-publish")
66
id ("signing")
7+
id("cl.franciscosolis.sonatype-central-upload")
78
}
89

910
apply { from ("../common.gradle") }

androidaudioplugin-ui-compose-app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
alias(libs.plugins.dokka)
66
id ("maven-publish")
77
id ("signing")
8+
id("cl.franciscosolis.sonatype-central-upload")
89
}
910

1011
apply { from ("../common.gradle") }

androidaudioplugin-ui-compose/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
alias(libs.plugins.dokka)
66
id ("maven-publish")
77
id ("signing")
8+
id("cl.franciscosolis.sonatype-central-upload")
89
}
910

1011
apply { from ("../common.gradle") }

androidaudioplugin-ui-web/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
id ("org.jetbrains.dokka")
55
id ("maven-publish")
66
id ("signing")
7+
id("cl.franciscosolis.sonatype-central-upload")
78
}
89

910
apply { from ("../common.gradle") }

androidaudioplugin/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ plugins {
44
alias(libs.plugins.dokka)
55
id ("maven-publish")
66
id ("signing")
7+
id("cl.franciscosolis.sonatype-central-upload")
78
}
89

910
apply { from ("../common.gradle") }

build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ plugins {
55
alias(libs.plugins.kotlin.android) apply false
66
alias(libs.plugins.compose.compiler) apply false
77
alias(libs.plugins.dokka) apply false
8+
id("cl.franciscosolis.sonatype-central-upload") version ("1.0.3") apply false
89
}
910

1011
buildscript {

0 commit comments

Comments
 (0)