From 2b73f5cae7edbac73467dc31f10079a047652c0e Mon Sep 17 00:00:00 2001 From: AJ Date: Sun, 1 Nov 2020 10:11:33 -0800 Subject: [PATCH] Add publishing workflows --- .../workflows/gradle-wrapper-validation.yml | 15 ++++++++ .github/workflows/publish.yml | 37 +++++++++++++++++++ mordant/build.gradle.kts | 3 +- 3 files changed, 53 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/gradle-wrapper-validation.yml create mode 100644 .github/workflows/publish.yml diff --git a/.github/workflows/gradle-wrapper-validation.yml b/.github/workflows/gradle-wrapper-validation.yml new file mode 100644 index 000000000..e6294258c --- /dev/null +++ b/.github/workflows/gradle-wrapper-validation.yml @@ -0,0 +1,15 @@ +name: "Validate Gradle Wrapper" +on: + push: + paths: + - 'gradle/**' + pull_request: + paths: + - 'gradle/**' +jobs: + validation: + name: "Validation" + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: gradle/wrapper-validation-action@v1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 000000000..a92d6fbac --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,37 @@ +name: Publish + +on: + push: + paths-ignore: + - '*.md' + branches: + - master + +jobs: + linux-tests: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: eskatos/gradle-command-action@v1 + with: + dependencies-cache-enabled: true + arguments: check --stacktrace + + deploy-linux: + needs: [ linux-tests ] + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Fetch git tags + run: git fetch origin +refs/tags/*:refs/tags/* + - name: Deploy to sonatype + uses: eskatos/gradle-command-action@v1 + with: + dependencies-cache-enabled: true + arguments: :mordant:publish -PinferVersion=true + +env: + GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=true -Dkotlin.incremental=false -Dorg.gradle.project.kotlin.incremental.multiplatform=false -Dorg.gradle.project.kotlin.native.disableCompilerDaemon=true -Dorg.gradle.jvmargs="-Xmx5g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8" + ORG_GRADLE_PROJECT_SONATYPE_USERNAME: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_USERNAME }} + ORG_GRADLE_PROJECT_SONATYPE_PASSWORD: ${{ secrets.ORG_GRADLE_PROJECT_SONATYPE_PASSWORD }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_signingKey }} diff --git a/mordant/build.gradle.kts b/mordant/build.gradle.kts index 3322770c3..f8bd0c036 100644 --- a/mordant/build.gradle.kts +++ b/mordant/build.gradle.kts @@ -59,7 +59,7 @@ val SONATYPE_PASSWORD: String? by project publishing { publications.withType().all { pom { - description.set("Text formatting for Kotlin command line applications") + description.set("Colorful multiplatform styling Kotlin for command-line applications") name.set("Mordant") url.set("https://github.com/ajalt/mordant") scm { @@ -105,7 +105,6 @@ signing { isRequired = !isSnapshot if (signingKey != null && !isSnapshot) { - @Suppress("UnstableApiUsage") useInMemoryPgpKeys(signingKey, "") sign(publishing.publications) }