Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Package organization #95

Merged
merged 17 commits into from
Apr 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 0 additions & 33 deletions .github/workflows/publish-container.yml

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
name: Test and publish artifact
name: Test artifact
on:
push:
branches: [ main ]
pull_request:

jobs:
test-and-publish-artifact:
test-artifact:
runs-on: ubuntu-latest
env:
GHPR_TOKEN: ${{ secrets.GHPR_TOKEN }}
Expand Down Expand Up @@ -33,10 +33,3 @@ jobs:
./codecov -t ${{ secrets.CODECOV_TOKEN }}
- name: Formatting of code and Scaladocs
run: sbt scalafmtSbtCheck doc

# Publish only if it is on the main branch
- if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' && github.repository == 'Qbeast-io/qbeast-spark' }}
name: Publish artifact
run: |
QBEAST_SPARK_VERSION="nightly-$(git rev-parse --short ${GITHUB_SHA})"
sbt "set qbeastSparkNodep/version := \"${QBEAST_SPARK_VERSION}\"" qbeastSparkNodep/publish
13 changes: 0 additions & 13 deletions Dockerfile

This file was deleted.

92 changes: 43 additions & 49 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@ import Dependencies._
import xerial.sbt.Sonatype._

lazy val qbeastCore = (project in file("core"))
.settings(name := "qbeast-core", libraryDependencies ++= Seq(apacheCommons % Test))
.settings(
name := "qbeast-core",
version := "0.1.0",
osopardo1 marked this conversation as resolved.
Show resolved Hide resolved
libraryDependencies ++= Seq(apacheCommons % Test))

val qbeast_spark_version = "0.2.0"

// Projects
lazy val qbeastSpark = (project in file("."))
Expand Down Expand Up @@ -32,16 +37,7 @@ qbeastSpark / Compile / doc / scalacOptions ++= Seq(
"-doc-footer",
"Copyright 2022 Qbeast - Docs for version " + qbeast_spark_version + " of qbeast-spark")

lazy val qbeastSparkNodep = (project in file("nodep"))
.settings(name := "qbeast-spark-nodep", Compile / packageBin := (qbeastSpark / assembly).value)

// As root project has publish / skip := true, we need to create a wrapper project to publish on
// sonatype and Maven Central, which has "qbeast-spark" as name.
lazy val qbeastSparkMaven = (project in file("maven"))
.settings(name := "qbeast-spark", Compile / packageBin := (qbeastSpark / assembly).value)

// Common metadata
val qbeast_spark_version = "0.2.0"
ThisBuild / version := qbeast_spark_version
ThisBuild / organization := "io.qbeast"
ThisBuild / organizationName := "Qbeast Analytics, S.L."
Expand Down Expand Up @@ -84,73 +80,71 @@ ThisBuild / javacOptions ++= Seq(

// this setting remove warning when using the sbt console
lazy val noWarningInConsole = Seq(
scalacOptions in (Compile, console) ~= {
Compile / console / scalacOptions ~= {
_.filterNot(
Set("-Ywarn-unused-import", "-Ywarn-unused:imports", "-Xlint", "-Xfatal-warnings"))
},
scalacOptions in (Test, console) := (scalacOptions in (Compile, console)).value)
Test / console / scalacOptions := (Compile / console / scalacOptions).value)

// Dependency repositories
ThisBuild / resolvers ++= Seq(Resolver.mavenLocal, Resolver.mavenCentral)

// Publication repository (for nightly releases on GitHub)
ThisBuild / publishTo := Some(
"Qbeast Spark" at "https://maven.pkg.github.com/Qbeast-io/qbeast-spark")

// Repository for maven (Tagged releases on Maven Central using Sonatype)
qbeastSparkMaven / publishTo := sonatypePublishToBundle.value
qbeastSparkMaven / sonatypeCredentialHost := "s01.oss.sonatype.org"

// GitHub Package Registry credentials
ThisBuild / credentials += Credentials(
"GitHub Package Registry",
"maven.pkg.github.com",
sys.env.getOrElse(
// Any user will work if you're using a TOKEN as password
"GHPR_USERNAME",
"GHPR_USERNAME required to fetch or publish from/to GH Package Registry"),
sys.env.getOrElse(
"GHPR_TOKEN",
"GHPR_TOKEN required to fetch or publish from/to GitHub Package Registry"))
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
ThisBuild / sonatypeRepository := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value) nexus + "content/repositories/snapshots"
else nexus + "service/local"
}
ThisBuild / publishTo := {
val nexus = "https://s01.oss.sonatype.org/"
if (isSnapshot.value) {
Some("snapshots" at nexus + "content/repositories/snapshots")
} else sonatypePublishToBundle.value
}

// Sonatype settings
qbeastSparkMaven / publishMavenStyle := true
qbeastSparkMaven / sonatypeProfileName := "io.qbeast"
qbeastSparkMaven / sonatypeProjectHosting := Some(
ThisBuild / publishMavenStyle := true
ThisBuild / sonatypeProfileName := "io.qbeast"
ThisBuild / sonatypeProjectHosting := Some(
osopardo1 marked this conversation as resolved.
Show resolved Hide resolved
GitHubHosting(user = "Qbeast-io", repository = "qbeast-spark", email = "info@qbeast.io"))
qbeastSparkMaven / licenses := Seq(
"APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt"))
qbeastSparkMaven / homepage := Some(url("https://qbeast.io/"))
qbeastSparkMaven / scmInfo := Some(
ThisBuild / licenses := Seq("APL2" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt"))
ThisBuild / homepage := Some(url("https://qbeast.io/"))
ThisBuild / scmInfo := Some(
ScmInfo(
url("https://github.com/Qbeast-io/qbeast-spark"),
"scm:git@github.com:Qbeast-io/qbeast-spark.git"))
qbeastSparkMaven / pomExtra :=
ThisBuild / pomExtra :=
<developers>
<developer>
<id>osopardo1</id>
<name>Paola Pardo</name>
<url>https://github.com/osopardo1</url>
</developer>
<developer>
<id>eavilaes</id>
<name>Eric Avila</name>
<url>https://github.com/eavilaes</url>
<id>alexeiakimov</id>
<name>Alexey Akimov</name>
<url>https://github.com/alexeiakimov</url>
</developer>
<developer>
<id>cugni</id>
<name>Cesare Cugnasco</name>
<url>https://github.com/cugni</url>
</developer>
<developer>
<id>eavilaes</id>
<name>Eric Avila</name>
<url>https://github.com/eavilaes</url>
</developer>
<developer>
<id>Jiaweihu08</id>
<name>Jiawei Hu</name>
<url>https://github.com/Jiaweihu08</url>
</developer>
<developer>
<id>alexeiakimov</id>
<name>Alexey Akimov</name>
<url>https://github.com/alexeiakimov</url>
<id>osopardo1</id>
<name>Paola Pardo</name>
<url>https://github.com/osopardo1</url>
</developer>
<developer>
<id>polsm91</id>
<name>Pol Santamaria</name>
<url>https://github.com/polsm91</url>
</developer>
</developers>

Expand Down
2 changes: 1 addition & 1 deletion core/src/main/scala/io/qbeast/core/model/CubeId.scala
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ case class CubeId(dimensionCount: Int, depth: Int, bitMask: Array[Long])
}

/**
* Returns the bytes to be stored in a [[org.apache.spark.sql.DataFrame]]
osopardo1 marked this conversation as resolved.
Show resolved Hide resolved
* Returns the bytes to be stored in a byte array.
*
* @return the bytes
*/
Expand Down