Skip to content

Commit

Permalink
Get ready for Github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeust committed Aug 7, 2020
1 parent 152614f commit f9b1e7d
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/publish-maven-central.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This is a basic workflow to help you get started with Actions

name: Publish to Maven Central

# Triggers the workflow on manually
on:
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Runs a single command using the runners shell
- name: Install gpg secret key
run: |
cat <(echo -e "${{ secrets.GPG_SECRET_KEY }}") | gpg --batch --import
gpg --export-secret-keys >~/.gnupg/secring.gpg
gpg --list-secret-keys --keyid-format LONG
- name: Publish release
env:
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
./gradlew -Psigning.secretKeyRingFile=.gnupg/secring.gpg -Psigning.password="" -P signing.keyId=${{ secrets.GPG_KEY_ID }} publish
# Next, go to https://oss.sonatype.org/index.html#stagingRepositories, select the repo, "Close" it and then
# "Release" it
8 changes: 4 additions & 4 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ sonarqube {
//

bintray {
user = project.findProperty("bintrayUser")?.toString()
key = project.findProperty("bintrayApiKey")?.toString()
user = project.findProperty("bintrayUser")?.toString() ?: System.getenv("BINTRAY_USER")
key = project.findProperty("bintrayApiKey")?.toString() ?: System.getenv("BINTRAY_API_KEY")
dryRun = false
publish = true

Expand Down Expand Up @@ -225,8 +225,8 @@ with(publishing) {
uri("https://oss.sonatype.org/content/repositories/snapshots/") else
uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.findProperty("sonatypeUser") as? String
password = project.findProperty("sonatypePassword") as? String
username = project.findProperty("sonatypeUser")?.toString() ?: System.getenv("SONATYPE_USER")
password = project.findProperty("sonatypePassword")?.toString() ?: System.getenv("SONATYPE_PASSWORD")
}
}
maven {
Expand Down

0 comments on commit f9b1e7d

Please sign in to comment.