Skip to content

Commit 2e79f57

Browse files
committed
Create workflow to publish new releases to Maven Central
1 parent c89c31d commit 2e79f57

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
publish:
9+
name: Release build and publish
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Check out code
13+
uses: actions/checkout@v2
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v2
16+
with:
17+
distribution: adopt
18+
java-version: 11
19+
- name: Release build
20+
run: ./gradlew assemble --scan
21+
- name: Source jar and dokka
22+
run: ./gradlew androidSourcesJar javadocJar --scan
23+
- name: Publish to MavenCentral
24+
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository --scan
25+
env:
26+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
27+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
28+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
29+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
30+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
31+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

0 commit comments

Comments
 (0)