Skip to content

Commit be98c06

Browse files
authored
publish to sonatype (#10)
1 parent cf8b24e commit be98c06

File tree

13 files changed

+35
-31
lines changed

13 files changed

+35
-31
lines changed

.github/workflows/cicd.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
uses: lokkju/[email protected]
1414
with:
1515
commands: + package
16+
- name: copy and rename package for python tests
17+
run: |
18+
cp target/scala-2.11/*.jar python/mse.jar
1619
- name: set up python3
1720
uses: actions/setup-python@v1
1821
with:
@@ -31,9 +34,12 @@ jobs:
3134
runs-on: ubuntu-latest
3235
steps:
3336
- uses: actions/checkout@v1
34-
- name: sbt deploy
35-
uses: lokkju/[email protected]
36-
with:
37-
commands: + publish
37+
- uses: olafurpg/setup-scala@v2
38+
- uses: olafurpg/setup-gpg@v2
39+
- name: publish to sonatype
40+
run: csbt ci-release
3841
env:
39-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
43+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
44+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
45+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ project/target
44
target/
55
/python/venv/
66
/mse.iml
7+
/python/mse.jar

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spark-shell --jars mse_2.11-0.1.4.jar
5555
To bring in to scope the (implicit) Column methods, use:
5656

5757
```scala
58-
import com.mse.column.methods._
58+
import com.github.fqaiser94.mse.methods._
5959
```
6060

6161
You can now use these methods to manipulate fields in a top-level StructType column:
@@ -279,8 +279,8 @@ spark-shell --jars mse_2.11-0.1.4.jar --packages "za.co.absa:spark-hofs_2.11:0.4
279279
```scala
280280
import org.apache.spark.sql._
281281
import org.apache.spark.sql.types._
282-
import com.mse.column.methods._
283282
import za.co.absa.spark.hofs._
283+
import com.github.fqaiser94.mse.methods._
284284

285285
// Generate some example data
286286
val arrayOfStructs = spark.createDataFrame(sc.parallelize(

build.sbt

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
name := "mse"
22

3-
version := "0.1.5"
4-
53
scalaVersion := "2.12.10"
64

75
crossScalaVersions := Seq("2.11.12", "2.12.10")
@@ -17,11 +15,10 @@ libraryDependencies ++= Seq(
1715
"org.scalacheck" %% "scalacheck" % "1.14.1" % Test
1816
)
1917

20-
licenses := Seq("Apache License 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
21-
2218
parallelExecution in Test := false
2319

24-
ThisBuild / githubOwner := "fqaiser94"
25-
ThisBuild / githubRepository := "mse"
26-
ThisBuild / githubUser := sys.env.getOrElse("GITHUB_USER", "")
27-
ThisBuild / githubTokenSource := Some(TokenSource.Environment("GITHUB_TOKEN"))
20+
inThisBuild(List(
21+
organization := "com.github.fqaiser94",
22+
homepage := Some(url("https://github.com/fqaiser94/mse")),
23+
licenses := Seq("Apache License 2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0.html"))
24+
))

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.2.1")
1+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.0")

python/mse/methods.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def __withField(self: Column, fieldName: str, fieldValue: Column):
88
If schema contains multiple fields with fieldName, they will all be replaced with fieldValue.
99
"""
1010
sc = SparkContext._active_spark_context
11-
_columnWithCustomMethods = sc._jvm.com.mse.column.methods.ColumnWithCustomMethods(self._jc)
11+
_columnWithCustomMethods = sc._jvm.com.github.fqaiser94.mse.methods.ColumnWithCustomMethods(self._jc)
1212
_column = _columnWithCustomMethods.withField(fieldName, fieldValue._jc)
1313
return Column(_column)
1414

@@ -20,7 +20,7 @@ def __dropFields(self: Column, *fieldNames: str):
2020
If schema contains multiple fields matching any one of the given fieldNames, they will all be dropped.
2121
"""
2222
sc = SparkContext._active_spark_context
23-
_columnWithCustomMethods = sc._jvm.com.mse.column.methods.ColumnWithCustomMethods(self._jc)
23+
_columnWithCustomMethods = sc._jvm.com.github.fqaiser94.mse.methods.ColumnWithCustomMethods(self._jc)
2424
_fieldNames = sc._jvm.PythonUtils.toSeq(fieldNames)
2525
_column = _columnWithCustomMethods.dropFields(_fieldNames)
2626
return Column(_column)
@@ -33,7 +33,7 @@ def __withFieldRenamed(self: Column, existingFieldName: str, newFieldName: str):
3333
If schema contains multiple fields with existingFieldName, they will all be renamed to newFieldName.
3434
"""
3535
sc = SparkContext._active_spark_context
36-
_columnWithCustomMethods = sc._jvm.com.mse.column.methods.ColumnWithCustomMethods(self._jc)
36+
_columnWithCustomMethods = sc._jvm.com.github.fqaiser94.mse.methods.ColumnWithCustomMethods(self._jc)
3737
_column = _columnWithCustomMethods.withFieldRenamed(existingFieldName, newFieldName)
3838
return Column(_column)
3939

@@ -52,6 +52,6 @@ def add_struct_field(nestedStruct: str, fieldName: str, fieldValue: Column):
5252
:return: a copy the top-level struct column (a) with field added/replaced.
5353
"""
5454
sc = SparkContext._active_spark_context
55-
_add_struct_field = sc._jvm.com.mse.column.methods.add_struct_field
55+
_add_struct_field = sc._jvm.com.github.fqaiser94.mse.methods.add_struct_field
5656
_column = _add_struct_field(nestedStruct, fieldName, fieldValue._jc)
5757
return Column(_column)

python/testing/ReusedPySparkTestCase.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def conf(cls):
2828
Override this in subclasses to supply a more specific conf
2929
"""
3030

31-
return SparkConf().set("spark.driver.extraClassPath", "./../target/scala-2.11/mse_2.11-0.1.5.jar")
31+
return SparkConf().set("spark.driver.extraClassPath", "./mse.jar")
3232

3333
@classmethod
3434
def setUpClass(cls):

src/main/scala/com/mse/column/methods.scala renamed to src/main/scala/com/github/fqaiser94/mse/methods.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mse.column
1+
package com.github.fqaiser94.mse
22

33
import org.apache.spark.sql.{Column, ColumnName}
44
import org.apache.spark.sql.catalyst.analysis.UnresolvedAttribute

src/test/scala/com/mse/column/QueryTester.scala renamed to src/test/scala/com/github/fqaiser94/mse/QueryTester.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.mse.column
1+
package com.github.fqaiser94.mse
22

33
import org.apache.spark.sql.test.SharedSparkSession
44
import org.apache.spark.sql.types.StructType

src/test/scala/com/mse/column/add_struct_fieldTest.scala renamed to src/test/scala/com/github/fqaiser94/mse/add_struct_fieldTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
package com.mse.column
1+
package com.github.fqaiser94.mse
22

3-
import com.mse.column.methods._
3+
import methods._
44
import org.apache.spark.sql.functions._
55
import org.apache.spark.sql.test.SharedSparkSession
66
import org.apache.spark.sql.types._

0 commit comments

Comments
 (0)