diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml deleted file mode 100644 index c5c8b5a..0000000 --- a/.github/workflows/build.yaml +++ /dev/null @@ -1,54 +0,0 @@ -name: Build - -on: - pull_request: - branches: [ "master" ] - workflow_call: - -permissions: - contents: read - -jobs: - build: - strategy: - matrix: - include: - - os: ubuntu-latest - tasks: build - - - os: macos-latest - tasks: > - iosX64Test - macosX64Test - tvosX64Test - watchosX64Test - - - os: windows-latest - tasks: mingwX64Test - - runs-on: ${{ matrix.os }} - - steps: - - name: Checkout Project - uses: actions/checkout@v4 - - - name: Validate Gradle Wrapper - uses: gradle/wrapper-validation-action@v2 - - - uses: actions/cache@v4 - with: - path: | - ~/.konan - key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} - - - name: Setup JDK - uses: actions/setup-java@v4 - with: - distribution: temurin - java-version: 8 - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@v3 - - - name: Build with Gradle Wrapper - run: ./gradlew ${{ matrix.tasks }} diff --git a/.github/workflows/deploy.yaml b/.github/workflows/ci.yaml similarity index 70% rename from .github/workflows/deploy.yaml rename to .github/workflows/ci.yaml index 1609da5..5ff859f 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/ci.yaml @@ -1,19 +1,62 @@ -name: Deploy +name: CI on: push: branches: [ "master" ] + pull_request: + branches: [ "master" ] permissions: contents: read jobs: build: - uses: ./.github/workflows/build.yaml + strategy: + matrix: + include: + - os: ubuntu-latest + tasks: build - deploy: + - os: macos-latest + tasks: > + iosX64Test + macosX64Test + tvosX64Test + watchosX64Test + + - os: windows-latest + tasks: mingwX64Test + + runs-on: ${{ matrix.os }} + + steps: + - name: Checkout Project + uses: actions/checkout@v4 + + - name: Validate Gradle Wrapper + uses: gradle/wrapper-validation-action@v2 + + - uses: actions/cache@v4 + with: + path: | + ~/.konan + key: ${{ runner.os }}-${{ hashFiles('**/.lock') }} + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + distribution: temurin + java-version: 8 + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + + - name: Build with Gradle Wrapper + run: ./gradlew ${{ matrix.tasks }} + + publish: needs: build - if: needs.build.result == 'success' + if: github.ref == 'refs/heads/master' && github.event_name == 'push' && needs.build.result == 'success' strategy: matrix: diff --git a/README.md b/README.md index 650b2eb..1cb9002 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # kotlin-result [![Maven Central](https://img.shields.io/maven-central/v/com.michael-bull.kotlin-result/kotlin-result.svg)](https://search.maven.org/search?q=g:com.michael-bull.kotlin-result) -[![Build](https://github.com/michaelbull/kotlin-result/actions/workflows/build.yaml/badge.svg)](https://github.com/michaelbull/kotlin-result/actions/workflows/build.yaml) +[![CI](https://github.com/michaelbull/kotlin-result/actions/workflows/ci.yaml/badge.svg)](https://github.com/michaelbull/kotlin-result/actions/workflows/ci.yaml) [![License](https://img.shields.io/github/license/michaelbull/kotlin-result.svg)](https://github.com/michaelbull/kotlin-result/blob/master/LICENSE) ![badge][badge-android] diff --git a/buildSrc/src/main/kotlin/publish-conventions.gradle.kts b/buildSrc/src/main/kotlin/publish-conventions.gradle.kts index c9090de..06f380c 100644 --- a/buildSrc/src/main/kotlin/publish-conventions.gradle.kts +++ b/buildSrc/src/main/kotlin/publish-conventions.gradle.kts @@ -175,13 +175,13 @@ publishing { } issueManagement { - system.set("GitHub") + system.set("GitHub Issues") url.set("https://github.com/michaelbull/kotlin-result/issues") } ciManagement { - system.set("GitHub") - url.set("https://github.com/michaelbull/kotlin-result/actions/workflows/build.yaml") + system.set("GitHub Actions") + url.set("https://github.com/michaelbull/kotlin-result/actions") } } }