From 60bac432c4b45b0a5c039c09f4b65f2f743095ea Mon Sep 17 00:00:00 2001 From: Tom Milner Date: Tue, 6 Feb 2024 13:45:06 +0000 Subject: [PATCH 1/4] Update SBT Smartrelease --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index aabf1a7c..820df54d 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,6 +1,6 @@ addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") -addSbtPlugin("com.mdsol" % "sbt-smartrelease" % "0.3.4") +addSbtPlugin("com.mdsol" % "sbt-smartrelease" % "0.4.0") addSbtPlugin("com.mintbeans" % "sbt-ecr" % "0.15.0") addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") From addc8b25b9cb2325188ac7f7645dbd3e66847f1a Mon Sep 17 00:00:00 2001 From: Tom Milner Date: Tue, 6 Feb 2024 14:29:26 +0000 Subject: [PATCH 2/4] Switch to SBT CI Release --- .github/release_drafter.yaml | 4 ++ .github/workflows/ci.yaml | 35 +++++++++++++++++ .github/workflows/release_drafter.yaml | 22 +++++++++++ .travis/deploy.sh | 9 ----- .travis/fake_private_key_for_testing | 27 ------------- .travis/secret-key.asc.enc | Bin 6784 -> 0 bytes build.sbt | 1 - project/BuildSettings.scala | 52 ++++--------------------- project/plugins.sbt | 6 +-- 9 files changed, 69 insertions(+), 87 deletions(-) create mode 100644 .github/release_drafter.yaml create mode 100644 .github/workflows/ci.yaml create mode 100644 .github/workflows/release_drafter.yaml delete mode 100755 .travis/deploy.sh delete mode 100644 .travis/fake_private_key_for_testing delete mode 100644 .travis/secret-key.asc.enc diff --git a/.github/release_drafter.yaml b/.github/release_drafter.yaml new file mode 100644 index 00000000..0a5d792c --- /dev/null +++ b/.github/release_drafter.yaml @@ -0,0 +1,4 @@ +template: | + ## What’s Changed + + $CHANGES \ No newline at end of file diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 00000000..e119088d --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,35 @@ +name: Continuous Integration +on: + push: + branches: + - "**" + tags: + - "v*" +permissions: + contents: write + +env: + ARTIFACTORY_USERNAME: ${{ secrets.ARTIFACTORY_USERNAME }} + ARTIFACTORY_PASSWORD: ${{ secrets.ARTIFACTORY_PASSWORD }} + +jobs: + test_and_release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - uses: coursier/cache-action@v6 + - uses: coursier/setup-action@v1 + with: + jvm: temurin:11 + - name: Lint & Test + run: sbt "scalafmtSbtCheck;scalafmtCheckAll;test" + - name: Release + if: ${{ startsWith(github.ref, 'refs/tags/v') }} + run: sbt ci-release + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} \ No newline at end of file diff --git a/.github/workflows/release_drafter.yaml b/.github/workflows/release_drafter.yaml new file mode 100644 index 00000000..9d9c9d10 --- /dev/null +++ b/.github/workflows/release_drafter.yaml @@ -0,0 +1,22 @@ +name: Release Drafter + +on: + push: + branches: + - master + +permissions: + contents: read + +jobs: + update_release_draft: + permissions: + contents: write + pull-requests: read + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + disable-autolabeler: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.travis/deploy.sh b/.travis/deploy.sh deleted file mode 100755 index cd1c2e5a..00000000 --- a/.travis/deploy.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/usr/bin/env bash -set -euxo pipefail - -git config --global user.email "${GIT_USER_EMAIL}" -git config --global user.name "${GIT_USER_NAME}" -openssl aes-256-cbc -K "$encrypted_ff550e95c537_key" -iv "$encrypted_ff550e95c537_iv" -in .travis/secret-key.asc.enc -out .travis/secret-key.asc -d -echo $PGP_PASSPHRASE | gpg --passphrase-fd 0 --batch --yes --import .travis/secret-key.asc - -sbt 'release cross with-defaults' updateChangelogAndPushOnLatestMaster diff --git a/.travis/fake_private_key_for_testing b/.travis/fake_private_key_for_testing deleted file mode 100644 index c0040d33..00000000 --- a/.travis/fake_private_key_for_testing +++ /dev/null @@ -1,27 +0,0 @@ ------BEGIN RSA PRIVATE KEY----- -MIIEpQIBAAKCAQEAyNrCJIQqg26ZU1n+mSPzTzcZnvimVK+EUt9Ty76jX6U0IMdT -sCISskvZHKh/dQ+91QsfQAjlOctaTGJ6spXLTATJplHnNITAO+ovXDCvAhRzY97S -c0ZS6pgxf3aEytUX8Y/XMRIsXpEpdTxprAJuu0SjIXaCEIKAlB7r4R9ouFW5gSLq -1+8scf8BPZqbtUsthuPpI65brnmAhLuZlkyagsRt3qHekxlvXWXmzbI0cCtx2k54 -723BzAz08bHTaJAWT2L7R51pPXL1+RiJBT4q5YrNfI+hOcL3g3LnFIdiQ5uWATlw -OX2k9Poq3+w8oYvyhvJwx3zBe6uDwREdrhJv3wIDAQABAoIBAQCMry1tBmYAyWb7 -yv1ZpqS1x5Jaly9qAcZdha/b9hvY0o5Ap10m8bbGy/m26Q7dn7kHkFLDN3fXk2gc -OJ5YmDNde70CkjuvvYwoa0/g8viiLFDmkxw1Qfyx9Qg2j31T1Q6AVJAV/vS1CFhR -lY8uvEVzRhA9UBSqG76UAVSWyrk+4w0CsxBQ7IMU1yi4mxPdK0W1f7fGt4PTyo4j -65Y3ZesyPxTcF/D+UnPAui+8YYfQSYqZItFHZRXjsxRP/1r5SXgv0Bz4iDdOPGxe -DQGlgLwLRgRVMVS6/LSGavvCYSOFydlgHmqCOe0QI0qkFUiC3kCgcU4yu16N00yE -+Z6bjYkBAoGBAP0+ngRyPmmFRXLEphvWB4bxMEz+MqOMhL9CxjNmBr+3rqMjszen -ahtUQYbtrSwhCxgNyN9Te8mMMzHsEmnpMxAL2mToXOTi4Dd1B4FD1sZLuKJSbxyu -ItDOGyej2YdYlj9J36MBaMwHJ0DXM7VzXjOWerhZnbsFYSrYtmgY39IXAoGBAMsK -NvxTU6wp4RlQsPjpLG9Y5+nrOGGbI5b4pZJAWxOtIseiUpsEpmTLDLnfB/QiDs0R -mZ5e4GgYLsDGKPFvdKmAnA6x2Yv917+06YDTgRUelVDveLXo86xEjyW2S6towpl+ -YPhQPOpcpSshcBev4YYyTvM1g47A9yClk4dVPdV5AoGBAO1nzD8i0nudonNrAsXJ -qZjJdpxXGSXVT4T1llUM6nrEOYVarGIaIhCoth1FpzhdaccM9SjXXI6fTkcYplJ/ -eY0rb3t1kdBJGCUlIvn9nNScm+QgH2XloWHaNf69TeniFEgUewCXC6Vpd1UD6cfK -9Z6rDTTRXlq7OlIugyGnX/vVAoGBAJxp3xgdPS05Cf7NibgHMUMKE4bBvSp8MDui -izKSv1b2Hv/5zXc8as7lGYWrCl6JSiuybkxxvKCUWJgLUAlGmnHl8NLlMblFsUov -HV8wEJXrfI3gHXbN4cIJAtnDiKGgz6EdmahRb8v/2QHT/Z1R0gPmh6mWxSVZBEgz -JeawxTTJAoGAKolzv0T6rZ/INg6+Ho4ioMbenoteb1a04k3l483YfApD8E2rnmaf -4z3KZFEUNdrDSg9HJTFHdYJxaJCJ0+2m+pEU0BbOWlrDaDqzm1MbeFBcmcKMmfLn -bl7ojUVTMutjrB4JXZ5778H9SwZ8HKCYYNjUiZppxQTwUjvFgZfvWaY= ------END RSA PRIVATE KEY----- diff --git a/.travis/secret-key.asc.enc b/.travis/secret-key.asc.enc deleted file mode 100644 index 33bfe4652d1e732f6eb6d7327e405777082cf1b3..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6784 zcmV-`8h_=j)Mc>v9qssw=qO-`)8&NEMm|~n`;}%Cxr^aQ~zXI!=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jvm-clients` = (project in file(".")) basicSettings, publishSettings, publish / skip := false, - smartReleaseAggregateProjectSettings ) diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index f41b0972..4f3b9c55 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -1,12 +1,7 @@ import java.util -import com.jsuereth.sbtpgp.SbtPgp.autoImport._ import sbt.Keys._ import sbt._ -import sbtrelease.ReleasePlugin.autoImport._ -import smartrelease.SmartReleasePlugin.ReleaseSteps -import xerial.sbt.Sonatype.SonatypeKeys._ -import xerial.sbt.Sonatype._ object BuildSettings { val env: util.Map[String, String] = System.getenv() @@ -20,7 +15,7 @@ object BuildSettings { description := "MAuth clients", scalaVersion := scala213, resolvers += Resolver.mavenLocal, - resolvers += Resolver.sonatypeRepo("releases"), + resolvers += Resolver.sonatypeOssRepos("releases"), javacOptions ++= Seq("-encoding", "UTF-8"), // Avoid issues such as java.lang.IllegalAccessError: tried to access method org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey // By running tests in a separate JVM @@ -38,14 +33,6 @@ object BuildSettings { else Seq("-Xfatal-warnings") }, - credentials += Credentials("Sonatype Nexus Repository Manager", "oss.sonatype.org", env.get("SONATYPE_USER"), env.get("SONATYPE_TOKEN")), - publishTo := Some( - if (isSnapshot.value) { - Opts.resolver.sonatypeSnapshots - } else { - Opts.resolver.sonatypeStaging - } - ) ) lazy val noPublishSettings = Seq( @@ -53,8 +40,6 @@ object BuildSettings { ) lazy val publishSettings = Seq( - sonatypeProfileName := "com.mdsol", - publishMavenStyle := true, licenses := Seq("MDSOL" -> url("https://github.com/mdsol/mauth-jvm-clients/blob/master/LICENSE.txt")), scmInfo := Some( ScmInfo( @@ -63,35 +48,12 @@ object BuildSettings { ) ), developers := List( - Developer(id = "austek", name = "Ali Ustek", email = "austek@mdsol.com", url = url("https://github.com/austek")) - ), - sonatypeProjectHosting := Some(GitHubHosting("austek", "mauth-jvm-clients", "austek@mdsol.com")), - publishTo := sonatypePublishToBundle.value, - releaseTagComment := s"Releasing ${(ThisBuild / version).value} [ci skip]", - releaseCommitMessage := s"Setting version to ${(ThisBuild / version).value} [ci skip]", - releaseNextCommitMessage := s"Setting version to ${(ThisBuild / version).value} [ci skip]", - releasePublishArtifactsAction := PgpKeys.publishSigned.value, - releaseCrossBuild := false, // true if you cross-build the project for multiple Scala versions - releaseProcess := releaseSteps, - credentials += Credentials( - "GnuPG Key ID", - "pgp", - "A9A6453ABA90E61B2492BDCD9F58C26F3772CEEE", - "ignored" + Developer( + "scala-mdsol", + "Medidata Scala Team", + "list_custom_Medidata.shared-jvm-libs@3ds.com", + url("https://github.com/mdsol/sbt-smartrelease") + ) ) ) - - val releaseSteps: Seq[ReleaseStep] = { - import sbtrelease.ReleaseStateTransformations._ - Seq( - checkSnapshotDependencies, - ReleaseSteps.checkCurrentVersionIsValidReleaseVersion, - ReleaseSteps.checkReleaseVersionStep, - ReleaseSteps.fetchAllFromOrigin, - ReleaseSteps.checkThisCommitExistOnMaster, - runClean, - releaseStepCommandAndRemaining("+publishSigned"), - releaseStepCommand("sonatypeBundleRelease") - ) - } } diff --git a/project/plugins.sbt b/project/plugins.sbt index 820df54d..49af0f6a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,5 @@ -addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0") -addSbtPlugin("com.jsuereth" % "sbt-pgp" % "2.0.1") -addSbtPlugin("com.mdsol" % "sbt-smartrelease" % "0.4.0") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") addSbtPlugin("com.mintbeans" % "sbt-ecr" % "0.15.0") -addSbtPlugin("com.typesafe.sbt" % "sbt-git" % "1.0.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") -addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.7") addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.2") addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17") From cc7d2de64849f6987194d826f2f5c3a4fc0b18f5 Mon Sep 17 00:00:00 2001 From: Tom Milner Date: Tue, 6 Feb 2024 15:47:15 +0000 Subject: [PATCH 3/4] Switch to SBT CI Release --- .github/workflows/ci.yaml | 6 ++- .travis.yml | 37 ------------------- build.sbt | 2 +- .../test/utils/ProtocolTestSuiteHelper.java | 4 +- project/BuildSettings.scala | 4 +- project/plugins.sbt | 10 ++--- 6 files changed, 15 insertions(+), 48 deletions(-) delete mode 100644 .travis.yml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index e119088d..a81f5963 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,8 +23,10 @@ jobs: - uses: coursier/setup-action@v1 with: jvm: temurin:11 - - name: Lint & Test - run: sbt "scalafmtSbtCheck;scalafmtCheckAll;test" + - name: Lint + run: sbt "scalafmtSbtCheck;scalafmtCheckAll" + - name: Test + run: sbt "test" - name: Release if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: sbt ci-release diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 34a1f8d2..00000000 --- a/.travis.yml +++ /dev/null @@ -1,37 +0,0 @@ -language: scala -jdk: - - openjdk11 -services: - - docker -env: - global: - - APP_MAUTH_UUID=398ea708-50eb-499f-98d3-14cc7692668c -cache: - directories: - - $HOME/.sbt - - $HOME/.ivy2/cache - - $HOME/.cache - - $HOME/.m2 -before_cache: - - find $HOME/.ivy2 -name "ivydata-*.properties" -delete - - find $HOME/.sbt -name "*.lock" -delete -before_install: - - export APP_MAUTH_PRIVATE_KEY=$(cat .travis/fake_private_key_for_testing) - - echo -e "machine github.com\n login $GITHUB_AUTH_TOKEN" >> ~/.netrc -jobs: - include: - - stage: test - name: Format Check - script: sbt scalafmtSbtCheck scalafmtCheckAll - - - stage: test - name: Test - script: sbt +test +suggestNextVersionAcrossAllProjects - - - stage: release - script: .travis/deploy.sh - if: tag IS present - -stages: - - Test - - release diff --git a/build.sbt b/build.sbt index f91b9896..cd969e4f 100644 --- a/build.sbt +++ b/build.sbt @@ -205,5 +205,5 @@ lazy val `mauth-jvm-clients` = (project in file(".")) .settings( basicSettings, publishSettings, - publish / skip := false, + publish / skip := false ) diff --git a/modules/mauth-test-utils/src/main/java/com/mdsol/mauth/test/utils/ProtocolTestSuiteHelper.java b/modules/mauth-test-utils/src/main/java/com/mdsol/mauth/test/utils/ProtocolTestSuiteHelper.java index 9ed9345c..08bf0574 100644 --- a/modules/mauth-test-utils/src/main/java/com/mdsol/mauth/test/utils/ProtocolTestSuiteHelper.java +++ b/modules/mauth-test-utils/src/main/java/com/mdsol/mauth/test/utils/ProtocolTestSuiteHelper.java @@ -22,6 +22,7 @@ public class ProtocolTestSuiteHelper { + final static String TEST_SUITE_RELATIVE_PATH = "../../mauth-protocol-test-suite/"; final static String MWSV2_TEST_CASE_PATH = getFullFilePath("protocols/MWSV2/"); @@ -31,7 +32,8 @@ public class ProtocolTestSuiteHelper { String configFile = getFullFilePath("signing-config.json"); try { ObjectMapper objectMapper = new ObjectMapper(); - byte[] jsonData = Files.readAllBytes(normalizePath(configFile)); + Path path = normalizePath(configFile).toAbsolutePath(); + byte[] jsonData = Files.readAllBytes(path); tmp = objectMapper.readValue(jsonData, SigningConfig.class); } catch (IOException ex) { throw new IllegalStateException("Failed to load the config file " + configFile, ex); diff --git a/project/BuildSettings.scala b/project/BuildSettings.scala index 4f3b9c55..65cbf66d 100644 --- a/project/BuildSettings.scala +++ b/project/BuildSettings.scala @@ -15,7 +15,7 @@ object BuildSettings { description := "MAuth clients", scalaVersion := scala213, resolvers += Resolver.mavenLocal, - resolvers += Resolver.sonatypeOssRepos("releases"), + resolvers ++= Resolver.sonatypeOssRepos("releases"), javacOptions ++= Seq("-encoding", "UTF-8"), // Avoid issues such as java.lang.IllegalAccessError: tried to access method org.bouncycastle.jcajce.provider.asymmetric.rsa.BCRSAPublicKey // By running tests in a separate JVM @@ -32,7 +32,7 @@ object BuildSettings { Seq.empty else Seq("-Xfatal-warnings") - }, + } ) lazy val noPublishSettings = Seq( diff --git a/project/plugins.sbt b/project/plugins.sbt index 49af0f6a..ff0c966a 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,5 +1,5 @@ -addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") -addSbtPlugin("com.mintbeans" % "sbt-ecr" % "0.15.0") -addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") -addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.2") -addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17") +addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12") +addSbtPlugin("com.mintbeans" % "sbt-ecr" % "0.15.0") +addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.2") +addSbtPlugin("se.marcuslonnberg" % "sbt-docker" % "1.8.2") +addSbtPlugin("io.github.davidgregory084" % "sbt-tpolecat" % "0.1.17") From a01beded151e5c2fcc6266a775eb5fbbc74563e8 Mon Sep 17 00:00:00 2001 From: Tom Milner Date: Tue, 6 Feb 2024 16:57:05 +0000 Subject: [PATCH 4/4] Switch to SBT CI Release --- .github/workflows/ci.yaml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index a81f5963..87ce28e5 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -18,7 +18,7 @@ jobs: steps: - uses: actions/checkout@v4 with: - fetch-depth: 0 + submodules: recursive - uses: coursier/cache-action@v6 - uses: coursier/setup-action@v1 with: @@ -26,7 +26,10 @@ jobs: - name: Lint run: sbt "scalafmtSbtCheck;scalafmtCheckAll" - name: Test - run: sbt "test" + run: sbt "+test" + env: + APP_MAUTH_UUID: 398ea708-50eb-499f-98d3-14cc7692668c + APP_MAUTH_PRIVATE_KEY: ${{ secrets.FAKE_PRIVATE_KEY }} - name: Release if: ${{ startsWith(github.ref, 'refs/tags/v') }} run: sbt ci-release