Skip to content

Commit 4248269

Browse files
committed
adds publish workflow
1 parent 5f99e2c commit 4248269

File tree

3 files changed

+47
-0
lines changed

3 files changed

+47
-0
lines changed

.github/workflows/publish.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
# Run this workflow when a new GitHub release is created
6+
types: [released]
7+
8+
jobs:
9+
publish:
10+
name: Release build and publish
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Check out code
14+
uses: actions/checkout@v2
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v2
17+
with:
18+
distribution: adopt
19+
java-version: 11
20+
21+
# Builds the release artifacts of the library
22+
- name: Release build
23+
run: ./gradlew :kprogresshud:assembleRelease
24+
25+
# Generates other artifacts (javadocJar is optional) TODO: javadocJar
26+
- name: Source jar and dokka
27+
run: ./gradlew androidSourcesJar
28+
29+
# Runs upload, and then closes & releases the repository
30+
- name: Publish to MavenCentral
31+
run: ./gradlew publishReleasePublicationToSonatypeRepository --max-workers 1 closeAndReleaseSonatypeStagingRepository
32+
env:
33+
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
34+
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
35+
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
36+
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
37+
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
38+
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }}

gradlew

100644100755
File mode changed.

local/publish-guide.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
From:
2+
https://proandroiddev.com/publishing-android-libraries-to-mavencentral-in-2021-8ac9975c3e52
3+
4+
./gradlew kprogresshud:publishReleasePublicationToSonatypeRepository
5+
./gradlew closeAndReleaseSonatypeStagingRepository
6+
7+
Sonatype Dashboard: https://issues.sonatype.org
8+
Nexus Repository Manager: https://s01.oss.sonatype.org/
9+
Deployment Guide: https://central.sonatype.org/publish/publish-guide/#deployment

0 commit comments

Comments
 (0)