Skip to content

Commit

Permalink
Remove gh-pages sbt plugin (close #53)
Browse files Browse the repository at this point in the history
  • Loading branch information
pondzix committed Feb 18, 2022
1 parent aaf1831 commit 309d1d5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 38 deletions.
32 changes: 11 additions & 21 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,20 @@ jobs:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- name: Make site
run: sbt makeSite

- name: Publish ScalaDoc
uses: JamesIves/github-pages-deploy-action@v4.2.5
with:
branch: gh-pages
folder: target/site
clean: false

- name: Deploy scala-lru-map to Maven Central
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.SONA_PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.SONA_PGP_SECRET }}
SONATYPE_USERNAME: ${{ secrets.SONA_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}

- name: Publish ScalaDoc
run: |
project_version=$(sbt version -Dsbt.log.noformat=true | perl -ne 'print "$1\n" if /info.*(\d+\.\d+\.\d+[^\r\n]*)/' | tail -n 1 | tr -d '\n')
if [[ "${{ github.ref }}" = "refs/tags/${project_version}" ]]
then
sbt makeSite
echo Publishing Scaladoc
git fetch
git checkout gh-pages
cp -r target/site/* .
git config user.name "GitHub Actions"
git config user.email "<>"
git add $project_version
git commit -m "Added Scaladoc for $project_version"
git push origin gh-pages
else
echo "${{ github.ref }} does not match project version $project_version => not publishing"
exit 1
fi
SONATYPE_PASSWORD: ${{ secrets.SONA_PASS }}
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ lazy val root = project
)
)
.settings(BuildSettings.publishSettings)
.settings(BuildSettings.ghPagesSettings)
.settings(BuildSettings.docSettings)
.settings(BuildSettings.coverageSettings)
.settings(BuildSettings.mimaSettings)
.enablePlugins(SiteScaladocPlugin, GhpagesPlugin, PreprocessPlugin)
.enablePlugins(SiteScaladocPlugin, PreprocessPlugin)
17 changes: 3 additions & 14 deletions project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ import com.typesafe.tools.mima.plugin.MimaKeys._
// Scoverage
import scoverage.ScoverageKeys._

// GHPages plugin
import com.typesafe.sbt.sbtghpages.GhpagesPlugin.autoImport._
import com.typesafe.sbt.site.SitePlugin.autoImport.{makeSite, siteSubdirName}
import com.typesafe.sbt.SbtGit.GitKeys.{gitBranch, gitRemoteRepo}
// Site plugin
import com.typesafe.sbt.site.SitePlugin.autoImport.siteSubdirName
import com.typesafe.sbt.site.SiteScaladocPlugin.autoImport._
import com.typesafe.sbt.site.preprocess.PreprocessPlugin.autoImport._

object BuildSettings {

Expand Down Expand Up @@ -72,15 +69,7 @@ object BuildSettings {
}
)

lazy val ghPagesSettings = Seq(
ghpagesPushSite := (ghpagesPushSite dependsOn makeSite).value,
ghpagesNoJekyll := false,
gitRemoteRepo := "git@github.com:snowplow-incubator/scala-lru-map.git",
gitBranch := Some("gh-pages"),
lazy val docSettings = Seq(
SiteScaladoc / siteSubdirName := s"${version.value}",
Preprocess / preprocessVars := Map("VERSION" -> version.value),
ghpagesCleanSite / excludeFilter := new FileFilter {
def accept(f: File) = true
}
)
}
1 change: 0 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("org.scoverage" % "sbt-coveralls" % "1.3.1")
addSbtPlugin("com.typesafe.sbt" % "sbt-ghpages" % "0.6.3")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.0.1")
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
addSbtPlugin("com.typesafe.sbt" % "sbt-site" % "1.4.1")
Expand Down

0 comments on commit 309d1d5

Please sign in to comment.