forked from mysticfall/kotlin-react-test
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add workflow for publishing artifacts
- Loading branch information
1 parent
1cafb03
commit 7d11b03
Showing
2 changed files
with
49 additions
and
3 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,46 @@ | ||
name: Publish Package to OSS Sonatype Repository | ||
on: | ||
push: | ||
branches: [ main ] | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
steps: | ||
- name: Install Dependencies | ||
run: sudo apt update && sudo apt install -y gnupg2 | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'adopt' | ||
|
||
- name: Validate Gradle Wrapper | ||
uses: gradle/wrapper-validation-action@e6e38bacfdf1a337459f332974bb2327a31aaf4b | ||
|
||
- name: Perform Tests | ||
run: gradle check | ||
|
||
- name: Import GPG Key | ||
id: import_gpg | ||
uses: crazy-max/ghaction-import-gpg@v4 | ||
with: | ||
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }} | ||
passphrase: ${{ secrets.GPG_PASSPHRASE }} | ||
|
||
- name: Publish Package | ||
run: | | ||
gradle publish \ | ||
-PossrhUsername=${{ secrets.OSSRH_USERNAME }} \ | ||
-PossrhPassword=${{ secrets.OSSRH_TOKEN }} \ | ||
-Psigning.gnupg.keyName=${{ secrets.OSSRH_GPG_KEY }} \ | ||
-Psigning.gnupg.passphrase=${{ secrets.OSSRH_GPG_SECRET_KEY_PASSWORD }} |
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