Skip to content
This repository has been archived by the owner on Feb 1, 2025. It is now read-only.

Commit

Permalink
Enable multiplatform + publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
Kantis committed Mar 19, 2024
1 parent 295ebe0 commit 0bd4fff
Show file tree
Hide file tree
Showing 15 changed files with 498 additions and 129 deletions.
69 changes: 40 additions & 29 deletions .github/workflows/PR.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,43 @@ on:
- '*.yml'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout the repo
uses: actions/checkout@v3

- name: Setup JDK
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: '8'

- name: Run tests
run: ./gradlew check

- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the build report
if: failure()
uses: actions/upload-artifact@master
with:
name: error-report
path: build-reports.zip

env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
test_linux:
if: ${{ github.repository == 'kotest/kotest-property-datetime' }}
strategy:
matrix:
target:
- jvmTest
- jsTest
- wasmJsTest
- linuxX64Test linuxArm64TestKlibrary
- androidNativeX86TestKlibrary androidNativeX64TestKlibrary androidNativeArm32TestKlibrary androidNativeArm64TestKlibrary
- :kotest-framework:kotest-framework-multiplatform-plugin-gradle:test
uses: ./.github/workflows/run-gradle.yml
with:
runs-on: ubuntu-latest
ref: ${{ inputs.ref }}
task: ${{ matrix.target }}

test_mac:
if: ${{ github.repository == 'kotest/kotest-property-datetime' }}
strategy:
fail-fast: true
matrix:
target:
- macosX64Test macosArm64Test
- iosX64Test iosSimulatorArm64Test iosArm64TestKlibrary
- tvosX64Test tvosArm64TestKlibrary tvosSimulatorArm64Test
- watchosArm32TestKlibrary watchosArm64TestKlibrary watchosX64Test watchosSimulatorArm64Test watchosDeviceArm64TestKlibrary
uses: ./.github/workflows/run-gradle.yml
with:
runs-on: macos-latest
ref: ${{ inputs.ref }}
task: ${{ matrix.target }}

test_windows:
if: ${{ github.repository == 'kotest/kotest-property-datetime' }}
uses: ./.github/workflows/run-gradle.yml
with:
runs-on: windows-latest
ref: ${{ inputs.ref }}
task: mingwX64Test
83 changes: 55 additions & 28 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,47 +3,74 @@ name: master
on:
push:
paths-ignore:
- 'doc/**'
- 'documentation/**'
- '*.md'
- '*.yml'
- '.github/workflows/**'
branches:
- master

permissions:
contents: read

jobs:
linux:
runs-on: ubuntu-latest
if: github.repository == 'kotest/kotest'
strategy:
fail-fast: false
matrix:
target:
- jvmTest publishJvmPublicationToDeployRepository publishKotlinMultiplatformPublicationToDeployRepository publishKotestBomPublicationToDeployRepository
- jsTest publishJsPublicationToDeployRepository
# - wasmJsTest publishWasmJsPublicationToDeployRepository
- linuxX64Test publishLinuxX64PublicationToDeployRepository
- linuxArm64TestKlibrary publishLinuxArm64PublicationToDeployRepository
- androidNativeX86TestKlibrary androidNativeX64TestKlibrary publishAndroidNativeX64PublicationToDeployRepository publishAndroidNativeX86PublicationToDeployRepository
- androidNativeArm32TestKlibrary androidNativeArm64TestKlibrary publishAndroidNativeArm32PublicationToDeployRepository publishAndroidNativeArm64PublicationToDeployRepository
steps:
- name: Checkout the repo
uses: actions/checkout@v3
- uses: kotest/kotest-action@master
with:
fetch-depth: 0
gradle-command: ${{ matrix.target }}
java-version: "17"

- name: Setup JDK
uses: actions/setup-java@v3
mac:
runs-on: macos-latest
if: github.repository == 'kotest/kotest'
strategy:
fail-fast: false
matrix:
target:
- macosX64Test publishMacosX64PublicationToDeployRepository
- macosArm64Test publishMacosArm64PublicationToDeployRepository
- iosX64Test publishIosX64PublicationToDeployRepository
- iosSimulatorArm64Test publishIosSimulatorArm64PublicationToDeployRepository
- iosArm64TestKlibrary publishIosArm64PublicationToDeployRepository
- tvosX64Test publishTvosX64PublicationToDeployRepository
- tvosArm64TestKlibrary publishTvosArm64PublicationToDeployRepository
- watchosArm32TestKlibrary publishWatchosArm32PublicationToDeployRepository
- watchosArm64TestKlibrary publishWatchosArm64PublicationToDeployRepository
- watchosX64Test publishWatchosX64PublicationToDeployRepository
- watchosSimulatorArm64Test publishWatchosSimulatorArm64PublicationToDeployRepository
- tvosSimulatorArm64Test publishTvosSimulatorArm64PublicationToDeployRepository
steps:
- uses: kotest/kotest-action@master
with:
distribution: "adopt"
java-version: '8'

- name: Run tests
run: ./gradlew check --scan
gradle-command: ${{ matrix.target }}
java-version: "17"

- name: publish snapshots
run: ./gradlew publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}

- name: Bundle the build report
if: failure()
run: find . -type d -name 'reports' | zip -@ -r build-reports.zip

- name: Upload the build report
if: failure()
uses: actions/upload-artifact@master
windows:
runs-on: windows-latest
if: github.repository == 'kotest/kotest'
steps:
- uses: kotest/kotest-action@master
with:
name: error-report
path: build-reports.zip
gradle-command: "mingwX64Test publishMingwX64PublicationToDeployRepository"
java-version: "17"

env:
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
61 changes: 0 additions & 61 deletions .github/workflows/release.yml

This file was deleted.

54 changes: 54 additions & 0 deletions .github/workflows/release_base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: release_base

on:
workflow_dispatch:
inputs:
version:
description: "The release version"
required: true
branch:
description: "The branch to release from"
required: true
default: 'master'

env:
RELEASE_VERSION: ${{ inputs.version }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxMetaspaceSize=756m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

permissions:
contents: read

jobs:
publish_base:
runs-on: ubuntu-latest
strategy:
max-parallel: 1
matrix:
target:
- publishKotlinMultiplatformPublicationToDeployRepository
- publishJvmPublicationToDeployRepository
- publishJsPublicationToDeployRepository
- publishKotestBomPublicationToDeployRepository
- publishLinuxX64PublicationToDeployRepository
- publishLinuxArm64PublicationToDeployRepository
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ inputs.branch }}

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- uses: gradle/actions/setup-gradle@v3

- name: publish
run: ./gradlew ${{ matrix.target }}
51 changes: 51 additions & 0 deletions .github/workflows/release_ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: release_ios

on:
workflow_dispatch:
inputs:
version:
description: "The release version"
required: true
branch:
description: "The branch to release from"
required: true
default: 'master'

env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxMetaspaceSize=756m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

permissions:
contents: read

jobs:
publish_ios:
runs-on: macos-latest
strategy:
max-parallel: 1
matrix:
target:
- "publishIosX64PublicationToDeployRepository"
- "publishIosSimulatorArm64PublicationToDeployRepository"
- "publishIosArm64PublicationToDeployRepository"
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- uses: gradle/actions/setup-gradle@v3

- name: publish
run: ./gradlew ${{ matrix.target }}
50 changes: 50 additions & 0 deletions .github/workflows/release_macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: release_macos

on:
workflow_dispatch:
inputs:
version:
description: "The release version"
required: true
branch:
description: "The branch to release from"
required: true
default: 'master'

env:
RELEASE_VERSION: ${{ github.event.inputs.version }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
GRADLE_OPTS: -Dorg.gradle.configureondemand=true -Dorg.gradle.parallel=false -Dkotlin.incremental=false -Dorg.gradle.jvmargs="-Xmx3g -XX:MaxMetaspaceSize=756m -XX:MaxPermSize=2048m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8"

permissions:
contents: read

jobs:
publish_mac:
runs-on: macos-latest
strategy:
max-parallel: 1
matrix:
target:
- "publishMacosX64PublicationToDeployRepository"
- "publishMacosArm64PublicationToDeployRepository"
steps:
- name: Checkout the repo
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.branch }}

- name: Setup JDK
uses: actions/setup-java@v4
with:
distribution: 'adopt'
java-version: '17'

- uses: gradle/actions/setup-gradle@v3

- name: publish
run: ./gradlew ${{ matrix.target }}
Loading

0 comments on commit 0bd4fff

Please sign in to comment.