Skip to content

Commit

Permalink
Merge tag 'v0.6.0' into series/0.6
Browse files Browse the repository at this point in the history
  • Loading branch information
ChristopherDavenport committed Jun 30, 2021
2 parents a6a6fb0 + ca1d4ee commit c4eb3c6
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 68 deletions.
77 changes: 26 additions & 51 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
49 changes: 32 additions & 17 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -8,56 +8,71 @@ 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'"

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
Expand Down

0 comments on commit c4eb3c6

Please sign in to comment.