Skip to content

Commit be49092

Browse files
authored
Initial commit
0 parents  commit be49092

17 files changed

+3772
-0
lines changed

.github/workflows/DEPLOY.yml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: DEPLOY
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
forced_version:
10+
description: 'FORCED_VERSION to use'
11+
required: true
12+
type: string
13+
14+
#permissions:
15+
# contents: write
16+
# discussions: write
17+
18+
env:
19+
CI: true
20+
FORCED_VERSION: ${{ inputs.forced_version || github.ref }}
21+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGKEY }}
22+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.ORG_GRADLE_PROJECT_SIGNINGPASSWORD }}
23+
SONATYPE_USERNAME: ${{ secrets.SONATYPEUSERNAME }}
24+
SONATYPE_PASSWORD: ${{ secrets.SONATYPEPASSWORD }}
25+
JAVA_VERSION: 17
26+
JAVA_DISTRIBUTION: zulu
27+
28+
jobs:
29+
##start:
30+
## runs-on: ubuntu-latest
31+
## outputs:
32+
## stagedRepositoryId: ${{ steps.releaseStep.outputs.stagedRepositoryId }}
33+
## steps:
34+
## - { name: Checkout, uses: actions/checkout@v3 }
35+
## - { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
36+
## - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
37+
## - { id: releaseStep, name: Start Maven Central Staging Repository, run: ./gradlew --no-configuration-cache startReleasingMavenCentral }
38+
39+
publish:
40+
strategy:
41+
fail-fast: false
42+
matrix:
43+
include:
44+
- { os: ubuntu-latest, publishTask: "publishLinuxX64PublicationToMavenLocal publishLinuxArm64PublicationToMavenLocal" }
45+
- { os: ubuntu-latest, publishTask: "publishMingwX64PublicationToMavenLocal" }
46+
- { os: ubuntu-latest, publishTask: "publishAndroidDebugPublicationToMavenLocal publishAndroidReleasePublicationToMavenLocal" }
47+
- { os: ubuntu-latest, publishTask: "publishKotlinMultiplatformPublicationToMavenLocal publishJvmPublicationToMavenLocal" }
48+
- { os: ubuntu-latest, publishTask: "publishJsPublicationToMavenLocal publishWasmJsPublicationToMavenLocal" }
49+
- { os: macos-latest, publishTask: "publishMacosX64PublicationToMavenLocal publishMacosArm64PublicationToMavenLocal" }
50+
- { os: macos-latest, publishTask: "publishTvosArm64PublicationToMavenLocal publishTvosSimulatorArm64PublicationToMavenLocal publishTvosX64PublicationToMavenLocal" }
51+
- { os: macos-latest, publishTask: "publishIosArm64PublicationToMavenLocal publishIosSimulatorArm64PublicationToMavenLocal publishIosX64PublicationToMavenLocal" }
52+
- { os: macos-latest, publishTask: "publishWatchosArm64PublicationToMavenLocal publishWatchosArm32PublicationToMavenLocal publishWatchosDeviceArm64PublicationToMavenLocal publishWatchosSimulatorArm64PublicationToMavenLocal" }
53+
timeout-minutes: 300
54+
runs-on: ${{ matrix.os }}
55+
##needs: [start]
56+
##env: { stagedRepositoryId: "${{ needs.start.outputs.stagedRepositoryId }}" }
57+
steps:
58+
##- { name: Print stagedRepositoryId=$stagedRepositoryId, run: "echo 'stagedRepositoryId: $stagedRepositoryId'" }
59+
- name: Replace MavenLocal with MavenLocal
60+
id: replace
61+
run: |
62+
publishTaskLocal=$(echo "${{ matrix.publishTask }}" | tr -d '\n')
63+
publishTaskRepository=$(echo "${{ matrix.publishTask }}" | sed 's/MavenLocal/MavenRepository/g' | tr -d '\n')
64+
echo "publishTaskLocal=${publishTaskLocal}" >> $GITHUB_ENV
65+
echo "publishTaskRepository=${publishTaskRepository}" >> $GITHUB_ENV
66+
- { name: Print publishTaskLocal, run: "echo 'publishTaskLocal: ${{ env.publishTaskLocal }}'" }
67+
- { name: Print publishTaskRepository, run: "echo 'publishTaskRepository: ${{ env.publishTaskRepository }}'" }
68+
- { name: Checkout, uses: actions/checkout@v3 }
69+
- { name: Use Node.js 20.x, uses: actions/setup-node@v3, with: { node-version: 20.x } }
70+
- { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
71+
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
72+
- { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
73+
- { name: Publish Publications To Maven Local, run: "./gradlew --no-configuration-cache --parallel ${{ env.publishTaskLocal }}" }
74+
- { name: Start Maven Central Staging Repository, run: ./gradlew --no-configuration-cache startReleasingMavenCentral }
75+
- { name: Publish Publications To Maven Repository, run: "./gradlew --no-configuration-cache --parallel --max-workers=8 ${{ env.publishTaskRepository }}" }
76+
- { name: Release to Maven Central, run: ./gradlew --no-configuration-cache releaseMavenCentral }
77+
78+
##finalize:
79+
## runs-on: ubuntu-latest
80+
## needs: [start, publish]
81+
## env: { stagedRepositoryId: "${{ needs.start.outputs.stagedRepositoryId }}" }
82+
## steps:
83+
## - { name: Checkout, uses: actions/checkout@v3 }
84+
## - { name: Use Node.js 20.x, uses: actions/setup-node@v3, with: { node-version: 20.x } }
85+
## - { name: Set up JDK, uses: actions/setup-java@v3, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
86+
## - { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
87+
## - { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
88+
## - { name: Release to Maven Central, run: ./gradlew --no-configuration-cache releaseMavenCentral }

.github/workflows/DOCS.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: DOCS
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
forced_version:
10+
description: 'FORCED_VERSION to use'
11+
required: true
12+
type: string
13+
14+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
15+
permissions:
16+
contents: read
17+
pages: write
18+
id-token: write
19+
20+
concurrency:
21+
group: "pages"
22+
cancel-in-progress: true
23+
24+
env:
25+
CI: true
26+
FORCED_VERSION: ${{ inputs.forced_version || github.ref }}
27+
JAVA_VERSION: 17
28+
JAVA_DISTRIBUTION: zulu
29+
30+
jobs:
31+
publish:
32+
timeout-minutes: 300
33+
runs-on: ubuntu-latest
34+
steps:
35+
- { name: Checkout, uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 } # https://github.com/actions/checkout/releases/tag/v4.1.7
36+
- { 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
37+
- { 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
38+
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
39+
- { name: Initialize Gradle, run: ./gradlew --no-configuration-cache }
40+
- { name: Build Documentation, run: ./gradlew --no-configuration-cache dokkaHtmlMultiModule }
41+
- { 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
42+
- { name: Deploy 🚀 to GitHub Pages, id: deployment, uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e} # https://github.com/actions/deploy-pages/releases/tag/v4.0.5

.github/workflows/TEST.yml

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: TEST
2+
# https://docs.github.com/en/actions/learn-github-actions/expressions
3+
4+
on:
5+
push:
6+
branches: [ main, 'release/**' ]
7+
pull_request:
8+
branches: [ main, 'release/**' ]
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
12+
cancel-in-progress: true
13+
14+
env:
15+
CI: true
16+
17+
JAVA_VERSION: 17
18+
JAVA_DISTRIBUTION: zulu
19+
20+
jobs:
21+
test:
22+
strategy:
23+
fail-fast: true # Once working, comment this
24+
matrix:
25+
include:
26+
- { outputKey: testWindows, os: windows-latest, testTask: mingwX64Test, enableKotlinNative: true }
27+
- { outputKey: testLinux, os: ubuntu-latest, testTask: linuxX64Test, buildTasks: publishLinuxArm64PublicationToMavenLocal, enableKotlinNative: true }
28+
- { outputKey: testMacos, os: macos-latest, testTask: macosX64Test, buildTasks: publishMacosArm64PublicationToMavenLocal, enableKotlinNative: true }
29+
- { outputKey: testIos, os: macos-latest, testTask: iosX64Test, enableKotlinNative: true }
30+
#- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsNodeTest jsBrowserTest" }
31+
- { outputKey: testJs, os: ubuntu-latest, testTask: "wasmBrowserTest", buildTasks: "jsBrowserTest jsDenoTest" }
32+
- { outputKey: testAndroid, os: ubuntu-latest, enableAndroid: true }
33+
- { outputKey: testJvmMacos, os: macos-latest, testTask: jvmTest }
34+
- { outputKey: testJvmLinux, os: ubuntu-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm, enableKotlinNative: true, enableSandbox: true, e2e: true }
35+
- { outputKey: testJvmWindows, os: windows-latest, testTask: jvmTest, precompileTask: compileTestKotlinJvm }
36+
#if: ${{ needs.changes.outputs[matrix.outputKey] == 'true' }}
37+
timeout-minutes: 30
38+
runs-on: ${{ matrix.os }}
39+
steps:
40+
- { uses: actions/checkout@v4 }
41+
- { name: Use Node.js 20.x, uses: actions/setup-node@v4, with: { node-version: 20.x } }
42+
- { name: Setup Deno, uses: denoland/setup-deno@v1, with: { deno-version: "1.44.4" } }
43+
- { 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" }
44+
- { name: Set up JDK, uses: actions/setup-java@v4, with: { distribution: "${{ env.JAVA_DISTRIBUTION }}", java-version: "${{ env.JAVA_VERSION }}" } }
45+
- { name: Prepare Gradle, uses: gradle/actions/setup-gradle@d9c87d481d55275bb5441eef3fe0e46805f9ef70 } # https://github.com/gradle/actions/releases/tag/v3.5.0
46+
- { name: Start gradle, run: ./gradlew }
47+
- { if: "${{ matrix.precompileTask }}", name: "Building ${{ matrix.precompileTask }} classes", run: "./gradlew --no-configuration-cache --stacktrace ${{ matrix.precompileTask }}" }
48+
- { if: "${{ matrix.testTask }}", name: "Run ${{ matrix.testTask }} tests", run: "./gradlew --no-configuration-cache ${{ matrix.testTask }}" }
49+
- { if: "${{ matrix.buildTasks }}", name: "Run ${{ matrix.buildTasks }}", run: "./gradlew --no-configuration-cache ${{ matrix.buildTasks }}" }
50+
- name: Enable KVM
51+
if: "${{ matrix.enableAndroid }}"
52+
run: |
53+
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
54+
sudo udevadm control --reload-rules
55+
sudo udevadm trigger --name-match=kvm
56+
- { name: "Run Android Tests", if: "${{ matrix.enableAndroid }}", uses: reactivecircus/android-emulator-runner@v2, with: { "api-level": 21, "script": "./gradlew --no-configuration-cache connectedCheck lintDebug" } }
57+
- { 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 } }
58+
- { if: "${{ matrix.e2e }}", name: Publish to maven local, run: ./gradlew --no-configuration-cache publishJvmLocal publishKotlinMultiplatformPublicationToMavenLocal }

.gitignore

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/.gradle
2+
/.kotlin
3+
/.idea
4+
/build
5+
/java_*.hprof
6+
/local.properties
7+
$catalog.json
8+
/stagedRepositoryId
9+
/*/build
10+
.DS_Store

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# korlibs-library-template

0 commit comments

Comments
 (0)