-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a github action to automatize the publication of the Sonatype nexus staging repository. The action will trigger when a release or draft of a release is published, or a pre-release is changed to a release. Note: a manual interaction is still required to release the package from the staging repository to the public one. This step is deliberately left to an admin user because is not possible to remove a packet published by mistake. Signed-off-by: Francesco Vaiani <francesco.vaiani@secomind.com> Signed-off-by: Antonio Gisondi <antonio.gisondi@secomind.com>
- Loading branch information
1 parent
294e039
commit cc2677e
Showing
3 changed files
with
59 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Sonatype publication with Gradle | ||
|
||
on: | ||
release: | ||
types: [released] | ||
|
||
jobs: | ||
sonatype-publish: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
#Run JDK configuration | ||
- name: Set up JDK 8 | ||
uses: actions/setup-java@v1 | ||
with: | ||
java-version: 8 | ||
|
||
#Gradle cache configuration | ||
- name: Cache Gradle packages | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
restore-keys: ${{ runner.os }}-gradle | ||
|
||
#Authorizing gradlew files | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
|
||
#Build project | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
|
||
#Publish project | ||
- name: Publish DeviceSDK | ||
run: | | ||
./gradlew DeviceSDK:publish | ||
./gradlew DeviceSDKAndroid:publish | ||
./gradlew DeviceSDKGeneric:publish | ||
env: | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
SONATYPE_STAGING_PROFILE_ID: ${{ secrets.SONATYPE_STAGING_PROFILE_ID }} | ||
SIGNING_KEY: ${{ secrets.SIGNING_KEY }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters