From 94aed03f1675468b725c05d1c9ab193f5e8e05f1 Mon Sep 17 00:00:00 2001 From: JesusMtnez Date: Thu, 20 May 2021 06:13:38 +0200 Subject: [PATCH 1/3] Disable artifact upload --- build.sbt | 1 + 1 file changed, 1 insertion(+) diff --git a/build.sbt b/build.sbt index ae45d0b..6ed5695 100644 --- a/build.sbt +++ b/build.sbt @@ -8,6 +8,7 @@ ThisBuild / organization := "io.chrisdavenport" ThisBuild / crossScalaVersions := Seq(Scala213, Scala212) ThisBuild / scalaVersion := Scala213 +ThisBuild / githubWorkflowArtifactUpload := false ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8", "adopt@1.11") val MicrositesCond = s"matrix.scala == '$Scala212'" From ab08b6f341af995a7b1a5af353fa1eb472ebc98d Mon Sep 17 00:00:00 2001 From: JesusMtnez Date: Thu, 20 May 2021 06:14:09 +0200 Subject: [PATCH 2/3] Set secrets for publish workflow --- build.sbt | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/build.sbt b/build.sbt index 6ed5695..d00a0d3 100644 --- a/build.sbt +++ b/build.sbt @@ -11,22 +11,25 @@ ThisBuild / scalaVersion := Scala213 ThisBuild / githubWorkflowArtifactUpload := false ThisBuild / githubWorkflowJavaVersions := Seq("adopt@1.8", "adopt@1.11") -val MicrositesCond = s"matrix.scala == '$Scala212'" - -ThisBuild / githubWorkflowBuild := Seq( - WorkflowStep.Sbt(List("test"), name = Some("Test")), - WorkflowStep.Sbt(List("mimaReportBinaryIssues"), name = Some("Binary Compatibility Check")) -) +val Scala213Cond = s"matrix.scala == '$Scala213'" def micrositeWorkflowSteps(cond: Option[String] = None): List[WorkflowStep] = List( WorkflowStep.Use( UseRef.Public("ruby", "setup-ruby", "v1"), - params = Map("ruby-version" -> "2.6"), + name = Some("Setup Ruby"), + params = Map("ruby-version" -> "2.6.0"), cond = cond ), - WorkflowStep.Run(List("gem update --system"), cond = cond), - WorkflowStep.Run(List("gem install sass"), cond = cond), - WorkflowStep.Run(List("gem install jekyll -v 4"), cond = cond) + WorkflowStep.Run( + List("gem install saas", "gem install jekyll -v 3.2.1"), + name = Some("Install microsite dependencies"), + cond = cond + ) +) + +ThisBuild / githubWorkflowBuild := Seq( + WorkflowStep.Sbt(List("test"), name = Some("Test")), + WorkflowStep.Sbt(List("mimaReportBinaryIssues"), name = Some("Binary Compatibility Check")) ) ThisBuild / githubWorkflowAddedJobs ++= Seq( @@ -34,17 +37,17 @@ ThisBuild / githubWorkflowAddedJobs ++= Seq( "scalafmt", "Scalafmt", githubWorkflowJobSetup.value.toList ::: List( - WorkflowStep.Sbt(List("scalafmtCheckAll"), name = Some("Scalafmt")) + WorkflowStep.Sbt(List("scalafmtCheckAll", "scalafmtSbtCheck"), name = Some("Scalafmt")) ), // Awaiting release of https://github.com/scalameta/scalafmt/pull/2324/files - scalas = crossScalaVersions.value.toList.filter(_.startsWith("2.")) + scalas = List(Scala213) ), WorkflowJob( "microsite", "Microsite", githubWorkflowJobSetup.value.toList ::: (micrositeWorkflowSteps(None) :+ WorkflowStep .Sbt(List("docs/makeMicrosite"), name = Some("Build the microsite"))), - scalas = List(Scala212) + scalas = List(Scala213) ) ) @@ -52,13 +55,24 @@ ThisBuild / githubWorkflowTargetBranches := List("*", "series/*") ThisBuild / githubWorkflowTargetTags ++= Seq("v*") ThisBuild / githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))) +ThisBuild / githubWorkflowPublishPreamble ++= + WorkflowStep.Use(UseRef.Public("olafurpg", "setup-gpg", "v3")) +: micrositeWorkflowSteps(None) + ThisBuild / githubWorkflowPublish := Seq( WorkflowStep.Sbt( - List("ci-release") + List("ci-release"), + name = Some("Publish artifacts to Sonatype"), + env = Map( + "PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}", + "PGP_SECRET" -> "${{ secrets.PGP_SECRET }}", + "SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}", + "SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}" + ) + ), + WorkflowStep.Sbt( + List(s"++${Scala213} docs/publishMicrosite"), + name = Some("Publish microsite") ) -) ++ micrositeWorkflowSteps(Some(MicrositesCond)).toSeq :+ WorkflowStep.Sbt( - List("docs/publishMicrosite"), - cond = Some(MicrositesCond) ) lazy val fuuid = project From 4cc3f9391fd748a540361f6e710bbaee3a0024e3 Mon Sep 17 00:00:00 2001 From: JesusMtnez Date: Thu, 20 May 2021 06:14:31 +0200 Subject: [PATCH 3/3] Run githubWorkflowGenerate --- .github/workflows/ci.yml | 77 ++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 51 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e392f62..62e2289 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -58,15 +58,6 @@ jobs: - name: Binary Compatibility Check run: sbt ++${{ matrix.scala }} mimaReportBinaryIssues - - name: Compress target directories - run: tar cf targets.tar modules/http4s/target modules/circe/.jvm/target target modules/doobie/target modules/core/.js/target modules/circe/.js/target modules/core/.jvm/target project/target - - - name: Upload target directories - uses: actions/upload-artifact@v2 - with: - name: target-${{ matrix.os }}-${{ matrix.scala }}-${{ matrix.java }} - path: targets.tar - publish: name: Publish Artifacts needs: [build] @@ -100,51 +91,35 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - name: Download target directories (2.13.6) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.13.6-${{ matrix.java }} - - - name: Inflate target directories (2.13.6) - run: | - tar xf targets.tar - rm targets.tar - - - name: Download target directories (2.12.13) - uses: actions/download-artifact@v2 - with: - name: target-${{ matrix.os }}-2.12.13-${{ matrix.java }} - - - name: Inflate target directories (2.12.13) - run: | - tar xf targets.tar - rm targets.tar - - - run: sbt ++${{ matrix.scala }} ci-release + - uses: olafurpg/setup-gpg@v3 - - if: matrix.scala == '2.12.13' + - name: Setup Ruby uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 - - - if: matrix.scala == '2.12.13' - run: gem update --system + ruby-version: 2.6.0 - - if: matrix.scala == '2.12.13' - run: gem install sass + - name: Install microsite dependencies + run: | + gem install saas + gem install jekyll -v 3.2.1 - - if: matrix.scala == '2.12.13' - run: gem install jekyll -v 4 + - name: Publish artifacts to Sonatype + env: + PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }} + PGP_SECRET: ${{ secrets.PGP_SECRET }} + SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }} + SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }} + run: sbt ++${{ matrix.scala }} ci-release - - if: matrix.scala == '2.12.13' - run: sbt ++${{ matrix.scala }} docs/publishMicrosite + - name: Publish microsite + run: sbt ++${{ matrix.scala }} '++2.13.6 docs/publishMicrosite' scalafmt: name: Scalafmt strategy: matrix: os: [ubuntu-latest] - scala: [2.13.6, 2.12.13] + scala: [2.13.6] java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: @@ -171,14 +146,14 @@ jobs: key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - name: Scalafmt - run: sbt ++${{ matrix.scala }} scalafmtCheckAll + run: sbt ++${{ matrix.scala }} scalafmtCheckAll scalafmtSbtCheck microsite: name: Microsite strategy: matrix: os: [ubuntu-latest] - scala: [2.12.13] + scala: [2.13.6] java: [adopt@1.8] runs-on: ${{ matrix.os }} steps: @@ -204,15 +179,15 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} - - uses: ruby/setup-ruby@v1 + - name: Setup Ruby + uses: ruby/setup-ruby@v1 with: - ruby-version: 2.6 - - - run: gem update --system + ruby-version: 2.6.0 - - run: gem install sass - - - run: gem install jekyll -v 4 + - name: Install microsite dependencies + run: | + gem install saas + gem install jekyll -v 3.2.1 - name: Build the microsite run: sbt ++${{ matrix.scala }} docs/makeMicrosite \ No newline at end of file