Skip to content

Commit

Permalink
lazy eval of project properties.
Browse files Browse the repository at this point in the history
ability to release to gpp and ossrh separately
  • Loading branch information
kdabir committed Apr 14, 2021
1 parent 1f1e84e commit 5af9ffc
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 4 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/release-ossrh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Release to Maven Central

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: false


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'

- name: Publish to Maven Central
env:
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_SIGNING_PASSPHRASE: ${{ secrets.OSSRH_SIGNING_PASSPHRASE }}
OSSRH_SIGNING_SECRET_KEY: ${{ secrets.OSSRH_SIGNING_SECRET_KEY }}
run: ./gradlew -Pversion=${{ github.event.inputs.version }} runtime:publish codegen:publish cli:publish api:publish

29 changes: 29 additions & 0 deletions .github/workflows/release-plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release Plugin

on:
workflow_dispatch:
inputs:
version:
description: 'Version'
required: false


jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Set up JDK
uses: actions/setup-java@v2
with:
java-version: 11
distribution: 'zulu'

- name: Publish norm plugin to Gradle Plugin Portal
env:
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
run: |
./gradlew -Pversion=${{ github.event.inputs.version }} -Dgradle.publish.key=$GRADLE_PUBLISH_KEY -Dgradle.publish.secret=$GRADLE_PUBLISH_SECRET plugin:publishPlugins
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
# release:
# types: [ published ]

## TODO use the version to update gradle version
workflow_dispatch:
inputs:
version:
Expand All @@ -25,7 +24,7 @@ jobs:
distribution: 'zulu'

- name: Build with Gradle
run: ./gradlew build
run: ./gradlew -Pversion=${{ github.event.inputs.version }} build

- name: Publish to Maven Central
env:
Expand Down
9 changes: 7 additions & 2 deletions buildSrc/src/main/groovy/com.medly.norm-maven-publish.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,14 @@ publishing {
artifact sourcesJar
artifact dokkaJar

pom {
pom { pom ->
name = project.name
description = project.description

// set up lazy property
project.afterEvaluate {
pom.description = it.description
}

url.set("https://github.com/medly/norm")
licenses {
license {
Expand Down

0 comments on commit 5af9ffc

Please sign in to comment.