-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
58 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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: [[email protected]] | ||
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: [[email protected]] | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,56 +8,71 @@ ThisBuild / organization := "io.chrisdavenport" | |
ThisBuild / crossScalaVersions := Seq(Scala213, Scala212) | ||
ThisBuild / scalaVersion := Scala213 | ||
|
||
ThisBuild / githubWorkflowArtifactUpload := false | ||
ThisBuild / githubWorkflowJavaVersions := Seq("[email protected]", "[email protected]") | ||
|
||
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( | ||
WorkflowJob( | ||
"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) | ||
) | ||
) | ||
|
||
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 | ||
|