Skip to content

Commit c01f66b

Browse files
committed
added publish to maven central on release gh action
1 parent 187d553 commit c01f66b

File tree

4 files changed

+94
-4
lines changed

4 files changed

+94
-4
lines changed

.github/workflows/publish_dev_version.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,14 @@ jobs:
6868
- name: Deploy to GH Packages with Gradle
6969
env:
7070
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
run: ./gradlew -Pspark=${{ matrix.spark }} -Pscala=${{ matrix.scala }} -PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.8' && matrix.spark == '3.2.0') }} clean publishMavenPublicationToGitHubPackagesRepository --scan
71+
run: >
72+
./gradlew
73+
-Pspark=${{ matrix.spark }}
74+
-Pscala=${{ matrix.scala }}
75+
-PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.8' && matrix.spark == '3.2.0') }}
76+
clean
77+
publishMavenPublicationToGitHubPackagesRepository
78+
--scan
7279
7380
7481
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
name: Deploy release version to Maven Central
2+
3+
on:
4+
release:
5+
types: [created]
6+
7+
jobs:
8+
build-and-deploy-mvn-central:
9+
strategy:
10+
matrix:
11+
scala: [ "2.12.15", "2.13.8" ]
12+
spark: [ "3.3.0", "3.2.1", "3.2.0", "3.1.3", "3.1.2", "3.1.1", "3.1.0", "3.0.3", "3.0.2", "3.0.1", "3.0.0" ]
13+
exclude:
14+
- scala: "2.13.8"
15+
spark: "3.1.3"
16+
- scala: "2.13.8"
17+
spark: "3.1.2"
18+
- scala: "2.13.8"
19+
spark: "3.1.1"
20+
- scala: "2.13.8"
21+
spark: "3.1.0"
22+
- scala: "2.13.8"
23+
spark: "3.0.3"
24+
- scala: "2.13.8"
25+
spark: "3.0.2"
26+
- scala: "2.13.8"
27+
spark: "3.0.1"
28+
- scala: "2.13.8"
29+
spark: "3.0.0"
30+
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
33+
packages: write
34+
35+
steps:
36+
- uses: actions/checkout@v3
37+
38+
- name: Set up JDK 11
39+
uses: actions/setup-java@v3
40+
with:
41+
distribution: adopt
42+
java-version: 11
43+
check-latest: true
44+
45+
- name: Cache Gradle packages
46+
uses: actions/cache@v3
47+
with:
48+
path: |
49+
~/.gradle/caches
50+
~/.gradle/wrapper
51+
~/.gradle/jdks
52+
key: ${{ runner.os }}-gradle-spark-${{ matrix.spark }}-${{ matrix.scala }}
53+
restore-keys: |
54+
${{ runner.os }}-gradle-
55+
56+
- name: Validate Gradle wrapper
57+
uses: gradle/wrapper-validation-action@v1
58+
59+
- name: Setup Gradle
60+
uses: gradle/gradle-build-action@v2
61+
62+
- name: Set Swap Space
63+
uses: pierotofy/set-swap-space@master
64+
with:
65+
swap-size-gb: 10
66+
67+
- name: Deploy to Maven Central with Gradle
68+
env:
69+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
70+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_TOKEN }}
71+
run: >
72+
./gradlew
73+
-Pspark=${{ matrix.spark }}
74+
-Pscala=${{ matrix.scala }}
75+
-PskipScalaTuplesInKotlin=${{ !(matrix.spark == '3.0.0' || matrix.scala == '2.13.8' && matrix.spark == '3.2.0') }}
76+
clean
77+
publishMavenPublicationToMavenCentralRepository
78+
--scan
79+
80+
81+

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ allprojects {
102102
}
103103

104104
scm {
105-
connection.set("scm:git:https://github.com/JetBrains/kotlin-spark-api.git")
106-
url.set("https://github.com/JetBrains/kotlin-spark-api")
105+
connection.set("scm:git:https://github.com/Kotlin/kotlin-spark-api.git")
106+
url.set("https://github.com/Kotlin/kotlin-spark-api")
107107
tag.set("HEAD")
108108
}
109109
}

examples/src/main/kotlin/org/jetbrains/kotlinx/spark/examples/UDFs.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ private fun strongTypingInDatasets() = withSpark {
197197
// | D| 14|
198198
// +----+------------+
199199

200+
201+
200202
// As you can see, the resulting dataset type is Tuple2<String, Int>
201-
// This is possible since we know what types go in and our of the replaceMissingAge udf.
203+
// This is possible since we know what types go in and out of the replaceMissingAge udf.
202204
// We can thus provide TypedColumns instead of normal ones which the select function takes
203205
// advantage of!
204206

0 commit comments

Comments
 (0)