Skip to content

Commit

Permalink
Simplify ghpages publish task
Browse files Browse the repository at this point in the history
  • Loading branch information
pondzix committed Feb 17, 2022
1 parent b4b92d7 commit c7a352a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 25 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,30 +12,18 @@ jobs:
- uses: actions/checkout@v2
- uses: coursier/cache-action@v6

- 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: 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
git config --global user.name "GitHub Actions"
git config --global user.email "<>"
sbt ghpagesPushSite
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion project/BuildSettings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ object BuildSettings {
lazy val ghPagesSettings = Seq(
ghpagesPushSite := (ghpagesPushSite dependsOn makeSite).value,
ghpagesNoJekyll := false,
gitRemoteRepo := "git@github.com:snowplow-incubator/scala-lru-map.git",
gitRemoteRepo := "https://github.com/snowplow-incubator/scala-lru-map.git",
gitBranch := Some("gh-pages"),
SiteScaladoc / siteSubdirName := s"${version.value}",
Preprocess / preprocessVars := Map("VERSION" -> version.value),
Expand Down

0 comments on commit c7a352a

Please sign in to comment.