Merge ci & publish workflows

This commit is contained in:
Michael Bull 2021-01-30 17:00:12 +00:00
parent 6bce98aa2b
commit 3b75ebd6e4
2 changed files with 36 additions and 38 deletions

View File

@ -1,9 +1,9 @@
name: ci
on: [push, pull_request]
on: [ push, pull_request ]
jobs:
build:
check:
runs-on: ubuntu-latest
steps:
@ -28,3 +28,37 @@ jobs:
java-version: 1.8
- run: ./gradlew check
publish:
needs: check
if: github.ref == 'master' && github.event_name != 'pull_request' && needs.check.result == 'success'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.*') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('buildSrc/src/main/kotlin/Versions.kt') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}

View File

@ -1,36 +0,0 @@
name: publish
on: [ push ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.gradle/wrapper
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('gradle/wrapper/gradle-wrapper.*') }}
restore-keys: |
${{ runner.os }}-gradle-wrapper-
- uses: actions/cache@v1
with:
path: ~/.gradle/caches
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle.kts') }}-${{ hashFiles('buildSrc/src/main/kotlin/Versions.kt') }}
restore-keys: |
${{ runner.os }}-gradle-caches-
- uses: actions/setup-java@v1
with:
java-version: 1.8
- run: ./gradlew publish
env:
ORG_GRADLE_PROJECT_ossrhUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_ossrhPassword: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}