Skip to content

Commit

Permalink
Merge pull request #15 from davenverse/fixPublish
Browse files Browse the repository at this point in the history
Define Build because of npm auth requirement with thin client
  • Loading branch information
ChristopherDavenport committed Nov 21, 2021
2 parents e16919f + d4eec09 commit f0f82cc
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ci.yml
Expand Up @@ -122,15 +122,18 @@ jobs:

- name: Publish artifacts to Sonatype
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
run: sbt --client '++${{ matrix.scala }}; ci-release'

- uses: christopherdavenport/create-ghpages-ifnotexists@v1

- name: Publish microsite
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: sbt --client '++${{ matrix.scala }}; site/publishMicrosite'

- name: Publish artifacts to npm
Expand Down
21 changes: 20 additions & 1 deletion build.sbt
Expand Up @@ -33,7 +33,26 @@ ThisBuild / githubWorkflowPublishPreamble ++= Seq(
)
)

ThisBuild / githubWorkflowPublish ++= Seq(
ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
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 }}",
"NPM_TOKEN" -> "${{ secrets.NPM_TOKEN }}", // Here because when we start thin client need env in scope so it can be reused for package publish
)
),
WorkflowStep.Use(UseRef.Public("christopherdavenport", "create-ghpages-ifnotexists", "v1")),
WorkflowStep.Sbt(
List("site/publishMicrosite"),
name = Some("Publish microsite"),
env = Map(
"NPM_TOKEN" -> "${{ secrets.NPM_TOKEN }}"
)
),
WorkflowStep.Sbt(
List("npmPackageNpmrc", "npmPackagePublish"),
name = Some("Publish artifacts to npm"),
Expand Down

0 comments on commit f0f82cc

Please sign in to comment.