kotlin-result/.github/workflows/ci.yaml
2021-03-29 18:41:20 +01:00

88 lines
2.6 KiB
YAML

name: ci
on: [ push, pull_request ]
jobs:
check:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-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 linuxX64Test
if: matrix.os == 'ubuntu-latest'
- run: ./gradlew mingwX64Test
if: matrix.os == 'windows-latest'
- run: ./gradlew check
if: matrix.os == 'macos-latest'
publish:
needs: check
if: github.ref == 'refs/heads/master' && github.event_name == 'push' && needs.check.result == 'success'
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, macos-latest, windows-latest ]
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 }}
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 publishLinuxX64PublicationToMavenRepository
if: matrix.os == 'ubuntu-latest'
- run: ./gradlew publishMingwX64PublicationToMavenRepository
if: matrix.os == 'windows-latest'
- run: ./gradlew publish
if: matrix.os == 'macos-latest'