Skip to content

Commit 373324c

Browse files
committed
#784 Add the new release GitHub Actions pipeline.
1 parent 0d0b07e commit 373324c

File tree

6 files changed

+57
-25
lines changed

6 files changed

+57
-25
lines changed

.github/workflows/release2.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#
2+
# Copyright 2022 ABSA Group Limited
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
17+
name: Release2
18+
19+
on:
20+
workflow_dispatch:
21+
22+
defaults:
23+
run:
24+
shell: bash
25+
26+
jobs:
27+
publish:
28+
runs-on: ubuntu-22.04
29+
steps:
30+
- uses: actions/checkout@v4
31+
with:
32+
fetch-depth: 0
33+
- uses: actions/setup-java@v4.2.1
34+
with:
35+
distribution: temurin
36+
java-version: 8
37+
cache: sbt
38+
- name: Build and release to Sonatype and Maven Central
39+
run: sbt ci-release
40+
env:
41+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
42+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
43+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
44+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

build.sbt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,11 @@ lazy val cobrix = (project in file("."))
5252
.disablePlugins(sbtassembly.AssemblyPlugin)
5353
.settings(
5454
name := "cobrix",
55+
crossScalaVersions := List(scala211, scala212, scala213),
5556

5657
// No need to publish the aggregation [empty] artifact
5758
publishArtifact := false,
59+
publish / skip := true,
5860
publish := {},
5961
publishLocal := {}
6062
)
@@ -65,13 +67,13 @@ lazy val cobolParser = (project in file("cobol-parser"))
6567
.enablePlugins(AutomateHeaderPlugin)
6668
.settings(
6769
name := "cobol-parser",
70+
crossScalaVersions := List(scala211, scala212, scala213),
6871
libraryDependencies ++= CobolParserDependencies :+ getScalaDependency(scalaVersion.value),
6972
shadedDependencies ++= CobolParserShadedDependencies,
7073
shadingRules ++= Seq (
7174
ShadingRule.moveUnder("org.antlr.v4.runtime", "za.co.absa.cobrix.cobol.parser.shaded")
7275
),
7376
validNamespaces ++= Set("za"),
74-
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
7577
assemblySettings,
7678
jacocoReportSettings := commonJacocoReportSettings.withTitle("cobrix:cobol-parser Jacoco Report"),
7779
jacocoExcludes := commonJacocoExcludes
@@ -83,16 +85,19 @@ lazy val cobolConverters = (project in file("cobol-converters"))
8385
.enablePlugins(AutomateHeaderPlugin)
8486
.settings(
8587
name := "cobol-converters",
88+
crossScalaVersions := List(scala211, scala212, scala213),
8689
libraryDependencies ++= CobolConvertersDependencies :+ getScalaDependency(scalaVersion.value),
8790
// No need to publish this artifact since it has test only at the moment
8891
publishArtifact := false,
92+
publish / skip := true,
8993
publish := {},
9094
publishLocal := {}
9195
)
9296

9397
lazy val sparkCobol = (project in file("spark-cobol"))
9498
.settings(
9599
name := "spark-cobol",
100+
crossScalaVersions := List(scala211, scala212, scala213),
96101
printSparkVersion := {
97102
val log = streams.value.log
98103
log.info(s"Building with Spark ${sparkVersion(scalaVersion.value)}, Scala ${scalaVersion.value}")
@@ -111,7 +116,6 @@ lazy val sparkCobol = (project in file("spark-cobol"))
111116
libraryDependencies ++= SparkCobolDependencies(scalaVersion.value) :+ getScalaDependency(scalaVersion.value),
112117
Test / fork := true, // Spark tests fail randomly otherwise
113118
populateBuildInfoTemplate,
114-
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
115119
assemblySettings
116120
).dependsOn(cobolParser)
117121
.settings(
@@ -124,10 +128,6 @@ lazy val sparkCobol = (project in file("spark-cobol"))
124128
ThisBuild / coverageExcludedPackages := ".*examples.*;.*replication.*"
125129
ThisBuild / coverageExcludedFiles := ".*Example.*;Test.*"
126130

127-
// release settings
128-
releaseCrossBuild := true
129-
addCommandAlias("releaseNow", ";set releaseVersionBump := sbtrelease.Version.Bump.Bugfix; release with-defaults")
130-
131131
lazy val assemblySettings = Seq(
132132
// This merge strategy retains service entries for all services in manifest.
133133
// It allows custom Spark data sources to be used together, e.g. 'spark-xml' and 'spark-cobol'.

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.10.11
1+
sbt.version=1.11.6

project/plugins.sbt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")
2-
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
3-
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0")
4-
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0")
5-
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
6-
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5")
1+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.11.1")
2+
addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2")
3+
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "1.6.0")
4+
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.2.0")
5+
addSbtPlugin("com.eed3si9n" % "sbt-assembly" % "0.15.0")
6+
addSbtPlugin("io.get-coursier" % "sbt-shading" % "2.1.5")
77

88
addDependencyTreePlugin
99

publish.sbt

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,4 @@ ThisBuild / description := "COBOL Reading and Import Extensions for Apache Spark
4444
ThisBuild / startYear := Some(2018)
4545
ThisBuild / licenses += "Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0.txt")
4646

47-
ThisBuild / pomIncludeRepository := { _ => false }
48-
ThisBuild / publishTo := {
49-
val nexus = "https://oss.sonatype.org/"
50-
if (isSnapshot.value) {
51-
Some("snapshots" at s"${nexus}content/repositories/snapshots")
52-
} else {
53-
Some("releases" at s"${nexus}service/local/staging/deploy/maven2")
54-
}
55-
}
56-
ThisBuild / publishMavenStyle := true
57-
5847
ThisBuild / versionScheme := Some("semver-spec")

version.sbt

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)