Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
soywiz authored Jul 26, 2024
0 parents commit c15907f
Show file tree
Hide file tree
Showing 17 changed files with 3,772 additions and 0 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/DEPLOY.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: DEPLOY

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
forced_version:
description: 'FORCED_VERSION to use'
required: true
type: string

#permissions:
# contents: write
# discussions: write

env:
CI: true
FORCED_VERSION: ${{ inputs.forced_version || github.ref }}
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPEUSERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPEPASSWORD }}
JAVA_VERSION: 17
JAVA_DISTRIBUTION: zulu

jobs:
##start:
## runs-on: ubuntu-latest
## outputs:
## stagedRepositoryId: ${{ steps.releaseStep.outputs.stagedRepositoryId }}
## steps:
## - { name: Checkout, uses: actions/checkout@v3 }
## - { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
## - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
## - { id: releaseStep, name: Start Maven Central Staging Repository, run: ./gradlew --no-configuration-cache startReleasingMavenCentral }

publish:
strategy:
fail-fast: false
matrix:
include:
- { os: ubuntu-latest, publishTask: "publishLinuxX64PublicationToMavenLocal publishLinuxArm64PublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishMingwX64PublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishAndroidDebugPublicationToMavenLocal publishAndroidReleasePublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishKotlinMultiplatformPublicationToMavenLocal publishJvmPublicationToMavenLocal" }
- { os: ubuntu-latest, publishTask: "publishJsPublicationToMavenLocal publishWasmJsPublicationToMavenLocal" }
- { os: macos-latest, publishTask: "publishMacosX64PublicationToMavenLocal publishMacosArm64PublicationToMavenLocal" }
- { os: macos-latest, publishTask: "publishTvosArm64PublicationToMavenLocal publishTvosSimulatorArm64PublicationToMavenLocal publishTvosX64PublicationToMavenLocal" }
- { os: macos-latest, publishTask: "publishIosArm64PublicationToMavenLocal publishIosSimulatorArm64PublicationToMavenLocal publishIosX64PublicationToMavenLocal" }
- { os: macos-latest, publishTask: "publishWatchosArm64PublicationToMavenLocal publishWatchosArm32PublicationToMavenLocal publishWatchosDeviceArm64PublicationToMavenLocal publishWatchosSimulatorArm64PublicationToMavenLocal" }
timeout-minutes: 300
runs-on: ${{ matrix.os }}
##needs: [start]
##env: { stagedRepositoryId: "${{ needs.start.outputs.stagedRepositoryId }}" }
steps:
##- { name: Print stagedRepositoryId=$stagedRepositoryId, run: "echo 'stagedRepositoryId: $stagedRepositoryId'" }
- name: Replace MavenLocal with MavenLocal
id: replace
run: |
publishTaskLocal=$(echo "${{ matrix.publishTask }}" | tr -d '\n')
publishTaskRepository=$(echo "${{ matrix.publishTask }}" | sed 's/MavenLocal/MavenRepository/g' | tr -d '\n')
echo "publishTaskLocal=${publishTaskLocal}" >> $GITHUB_ENV
echo "publishTaskRepository=${publishTaskRepository}" >> $GITHUB_ENV
- { name: Print publishTaskLocal, run: "echo 'publishTaskLocal: ${{ env.publishTaskLocal }}'" }
- { name: Print publishTaskRepository, run: "echo 'publishTaskRepository: ${{ env.publishTaskRepository }}'" }
- { name: Checkout, uses: actions/checkout@v3 }
- { name: Use Node.js 20.x, uses: actions/setup-node@v3, with: { node-version: 20.x } }
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
- { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
- { name: Publish Publications To Maven Local, run: "./gradlew --no-configuration-cache --parallel ${{ env.publishTaskLocal }}" }
- { name: Start Maven Central Staging Repository, run: ./gradlew --no-configuration-cache startReleasingMavenCentral }
- { name: Publish Publications To Maven Repository, run: "./gradlew --no-configuration-cache --parallel --max-workers=8 ${{ env.publishTaskRepository }}" }
- { name: Release to Maven Central, run: ./gradlew --no-configuration-cache releaseMavenCentral }

##finalize:
## runs-on: ubuntu-latest
## needs: [start, publish]
## env: { stagedRepositoryId: "${{ needs.start.outputs.stagedRepositoryId }}" }
## steps:
## - { name: Checkout, uses: actions/checkout@v3 }
## - { name: Use Node.js 20.x, uses: actions/setup-node@v3, with: { node-version: 20.x } }
## - { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
## - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
## - { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
## - { name: Release to Maven Central, run: ./gradlew --no-configuration-cache releaseMavenCentral }
42 changes: 42 additions & 0 deletions .github/workflows/DOCS.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: DOCS

on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
forced_version:
description: 'FORCED_VERSION to use'
required: true
type: string

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: true

env:
CI: true
FORCED_VERSION: ${{ inputs.forced_version || github.ref }}
JAVA_VERSION: 17
JAVA_DISTRIBUTION: zulu

jobs:
publish:
timeout-minutes: 300
runs-on: ubuntu-latest
steps:
- { name: Checkout, uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 } # https://github.com/actions/checkout/releases/tag/v4.1.7
- { name: Set up JDK, uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } } # https://github.com/actions/setup-java/releases/tag/v4.2.1
- { name: Use Node.js 20.x, uses: actions/setup-node@1e60f620b9541d16bece96c5465dc8ee9832be0b, with: { node-version: 20.x } } # https://github.com/actions/setup-node/releases/tag/v4.0.3
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
- { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
- { name: Build Documentation, run: ./gradlew --no-configuration-cache dokkaHtmlMultiModule }
- { name: Upload artifact, uses: actions/upload-pages-artifact@56afc609e74202658d3ffba0e8f6dda462b719fa, with: { path: 'build/dokka/htmlMultiModule' } } # https://github.com/actions/upload-pages-artifact/releases/tag/v3.0.1
- { name: Deploy 🚀 to GitHub Pages, id: deployment, uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e} # https://github.com/actions/deploy-pages/releases/tag/v4.0.5
58 changes: 58 additions & 0 deletions .github/workflows/TEST.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: TEST
# https://docs.github.com/en/actions/learn-github-actions/expressions

on:
push:
branches: [ main, 'release/**' ]
pull_request:
branches: [ main, 'release/**' ]

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
CI: true

JAVA_VERSION: 17
JAVA_DISTRIBUTION: zulu

jobs:
test:
strategy:
fail-fast: true # Once working, comment this
matrix:
include:
- { outputKey: testWindows, os: windows-latest, testTask: mingwX64Test, enableKotlinNative: true }
- { outputKey: testLinux, os: ubuntu-latest, testTask: linuxX64Test, buildTasks: publishLinuxArm64PublicationToMavenLocal, enableKotlinNative: true }
- { outputKey: testMacos, os: macos-latest, testTask: macosX64Test, buildTasks: publishMacosArm64PublicationToMavenLocal, enableKotlinNative: true }
- { outputKey: testIos, os: macos-latest, testTask: iosX64Test, enableKotlinNative: true }
#- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsNodeTest jsBrowserTest" }
- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsBrowserTest jsDenoTest" }
- { outputKey: testAndroid, os: ubuntu-latest, enableAndroid: true }
- { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest }
- { outputKey: testJvmLinux, os: ubuntu-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm, enableKotlinNative: true, enableSandbox: true, e2e: true }
- { outputKey: testJvmWindows, os: windows-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm }
#if: ${{ needs.changes.outputs[matrix.outputKey] == 'true' }}
timeout-minutes: 30
runs-on: ${{ matrix.os }}
steps:
- { uses: actions/checkout@v4 }
- { name: Use Node.js 20.x, uses: actions/setup-node@v4, with: { node-version: 20.x } }
- { name: Setup Deno, uses: denoland/setup-deno@v1, with: { deno-version: "1.44.4" } }
- { name: Replace gradle wrapper, run: "sed 's/-all/-bin/g' gradle/wrapper/gradle-wrapper.properties > gradle/wrapper/gradle-wrapper.properties.bak; cp gradle/wrapper/gradle-wrapper.properties.bak gradle/wrapper/gradle-wrapper.properties" }
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
- { name: Start gradle, run: ./gradlew }
- { if: "${{ matrix.precompileTask }}", name: "Building ${{ matrix.precompileTask }} classes", run: "./gradlew --no-configuration-cache --stacktrace ${{ matrix.precompileTask }}" }
- { if: "${{ matrix.testTask }}", name: "Run ${{ matrix.testTask }} tests", run: "./gradlew --no-configuration-cache ${{ matrix.testTask }}" }
- { if: "${{ matrix.buildTasks }}", name: "Run ${{ matrix.buildTasks }}", run: "./gradlew --no-configuration-cache ${{ matrix.buildTasks }}" }
- name: Enable KVM
if: "${{ matrix.enableAndroid }}"
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
- { name: "Run Android Tests", if: "${{ matrix.enableAndroid }}", uses: reactivecircus/android-emulator-runner@v2, with: { "api-level": 21, "script": "./gradlew --no-configuration-cache connectedCheck lintDebug" } }
- { name: Archive Test Results, if: failure(), uses: actions/upload-artifact@v4, with: { name: "test-results-${{ matrix.outputKey }}", retention-days: 21, path: "**/build/reports", if-no-files-found: ignore } }
- { if: "${{ matrix.e2e }}", name: Publish to maven local, run: ./gradlew --no-configuration-cache publishJvmLocal publishKotlinMultiplatformPublicationToMavenLocal }
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/.gradle
/.kotlin
/.idea
/build
/java_*.hprof
/local.properties
$catalog.json
/stagedRepositoryId
/*/build
.DS_Store
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# korlibs-library-template
Loading

0 comments on commit c15907f

Please sign in to comment.