Skip to content

Commit a6fb9a5

Browse files
authored
Merge pull request #159 from mdsol/tech/update_http4s
Replace SBT Smart Release
2 parents eb75000 + a01bede commit a6fb9a5

File tree

11 files changed

+83
-131
lines changed

11 files changed

+83
-131
lines changed

.github/release_drafter.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
template: |
2+
## What’s Changed
3+
4+
$CHANGES

.github/workflows/ci.yaml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Continuous Integration
2+
on:
3+
push:
4+
branches:
5+
- "**"
6+
tags:
7+
- "v*"
8+
permissions:
9+
contents: write
10+
11+
env:
12+
ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }}
13+
ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }}
14+
15+
jobs:
16+
test_and_release:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
submodules: recursive
22+
- uses: coursier/cache-action@v6
23+
- uses: coursier/setup-action@v1
24+
with:
25+
jvm: temurin:11
26+
- name: Lint
27+
run: sbt "scalafmtSbtCheck;scalafmtCheckAll"
28+
- name: Test
29+
run: sbt "+test"
30+
env:
31+
APP_MAUTH_UUID: 398ea708-50eb-499f-98d3-14cc7692668c
32+
APP_MAUTH_PRIVATE_KEY: ${{ secrets.FAKE_PRIVATE_KEY }}
33+
- name: Release
34+
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
35+
run: sbt ci-release
36+
env:
37+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
38+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
39+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
40+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Release Drafter
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
update_release_draft:
13+
permissions:
14+
contents: write
15+
pull-requests: read
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: release-drafter/release-drafter@v5
19+
with:
20+
disable-autolabeler: true
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.travis.yml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.travis/deploy.sh

Lines changed: 0 additions & 9 deletions
This file was deleted.

.travis/fake_private_key_for_testing

Lines changed: 0 additions & 27 deletions
This file was deleted.

.travis/secret-key.asc.enc

-6.63 KB
Binary file not shown.

build.sbt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,5 @@ lazy val `mauth-jvm-clients` = (project in file("."))
205205
.settings(
206206
basicSettings,
207207
publishSettings,
208-
publish / skip := false,
209-
smartReleaseAggregateProjectSettings
208+
publish / skip := false
210209
)

modules/mauth-test-utils/src/main/java/com/mdsol/mauth/test/utils/ProtocolTestSuiteHelper.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222

2323
public class ProtocolTestSuiteHelper {
2424

25+
2526
final static String TEST_SUITE_RELATIVE_PATH = "../../mauth-protocol-test-suite/";
2627
final static String MWSV2_TEST_CASE_PATH = getFullFilePath("protocols/MWSV2/");
2728

@@ -31,7 +32,8 @@ public class ProtocolTestSuiteHelper {
3132
String configFile = getFullFilePath("signing-config.json");
3233
try {
3334
ObjectMapper objectMapper = new ObjectMapper();
34-
byte[] jsonData = Files.readAllBytes(normalizePath(configFile));
35+
Path path = normalizePath(configFile).toAbsolutePath();
36+
byte[] jsonData = Files.readAllBytes(path);
3537
tmp = objectMapper.readValue(jsonData, SigningConfig.class);
3638
} catch (IOException ex) {
3739
throw new IllegalStateException("Failed to load the config file " + configFile, ex);

project/BuildSettings.scala

Lines changed: 8 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,7 @@
11
import java.util
22

3-
import com.jsuereth.sbtpgp.SbtPgp.autoImport._
43
import sbt.Keys._
54
import sbt._
6-
import sbtrelease.ReleasePlugin.autoImport._
7-
import smartrelease.SmartReleasePlugin.ReleaseSteps
8-
import xerial.sbt.Sonatype.SonatypeKeys._
9-
import xerial.sbt.Sonatype._
105

116
object BuildSettings {
127
val env: util.Map[String, String] = System.getenv()
@@ -20,7 +15,7 @@ object BuildSettings {
2015
description := "MAuth clients",
2116
scalaVersion := scala213,
2217
resolvers += Resolver.mavenLocal,
23-
resolvers += Resolver.sonatypeRepo("releases"),
18+
resolvers ++= Resolver.sonatypeOssRepos("releases"),
2419
javacOptions ++= Seq("-encoding", "UTF-8"),
2520
// Avoid issues such as java.lang.IllegalAccessError: tried to access method org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey
2621
// By running tests in a separate JVM
@@ -37,24 +32,14 @@ object BuildSettings {
3732
Seq.empty
3833
else
3934
Seq("-Xfatal-warnings")
40-
},
41-
credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", env.get("SONATYPE_USER"), env.get("SONATYPE_TOKEN")),
42-
publishTo := Some(
43-
if (isSnapshot.value) {
44-
Opts.resolver.sonatypeSnapshots
45-
} else {
46-
Opts.resolver.sonatypeStaging
47-
}
48-
)
35+
}
4936
)
5037

5138
lazy val noPublishSettings = Seq(
5239
publish / skip := true
5340
)
5441

5542
lazy val publishSettings = Seq(
56-
sonatypeProfileName := "com.mdsol",
57-
publishMavenStyle := true,
5843
licenses := Seq("MDSOL" -> url("https://github.com/mdsol/mauth-jvm-clients/blob/master/LICENSE.txt")),
5944
scmInfo := Some(
6045
ScmInfo(
@@ -63,35 +48,12 @@ object BuildSettings {
6348
)
6449
),
6550
developers := List(
66-
Developer(id = "austek", name = "Ali Ustek", email = "[email protected]", url = url("https://github.com/austek"))
67-
),
68-
sonatypeProjectHosting := Some(GitHubHosting("austek", "mauth-jvm-clients", "[email protected]")),
69-
publishTo := sonatypePublishToBundle.value,
70-
releaseTagComment := s"Releasing ${(ThisBuild / version).value} [ci skip]",
71-
releaseCommitMessage := s"Setting version to ${(ThisBuild / version).value} [ci skip]",
72-
releaseNextCommitMessage := s"Setting version to ${(ThisBuild / version).value} [ci skip]",
73-
releasePublishArtifactsAction := PgpKeys.publishSigned.value,
74-
releaseCrossBuild := false, // true if you cross-build the project for multiple Scala versions
75-
releaseProcess := releaseSteps,
76-
credentials += Credentials(
77-
"GnuPG Key ID",
78-
"pgp",
79-
"A9A6453ABA90E61B2492BDCD9F58C26F3772CEEE",
80-
"ignored"
51+
Developer(
52+
"scala-mdsol",
53+
"Medidata Scala Team",
54+
55+
url("https://github.com/mdsol/sbt-smartrelease")
56+
)
8157
)
8258
)
83-
84-
val releaseSteps: Seq[ReleaseStep] = {
85-
import sbtrelease.ReleaseStateTransformations._
86-
Seq(
87-
checkSnapshotDependencies,
88-
ReleaseSteps.checkCurrentVersionIsValidReleaseVersion,
89-
ReleaseSteps.checkReleaseVersionStep,
90-
ReleaseSteps.fetchAllFromOrigin,
91-
ReleaseSteps.checkThisCommitExistOnMaster,
92-
runClean,
93-
releaseStepCommandAndRemaining("+publishSigned"),
94-
releaseStepCommand("sonatypeBundleRelease")
95-
)
96-
}
9759
}

0 commit comments

Comments
 (0)