Skip to content

Commit

Permalink
update ci release step
Browse files Browse the repository at this point in the history
  • Loading branch information
rolang committed Jul 7, 2024
1 parent 58cdbaa commit be8f80c
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ jobs:
- name: Cache Dependencies
uses: coursier/cache-action@v6
- name: Release
run: sbt ci-release
run: |-
echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
&& echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
&& (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
&& sbt '+publishSigned; sonatypeCentralRelease'
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
22 changes: 20 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,26 @@ inThisBuild(
case j => j
},
sonatypeCredentialHost := xerial.sbt.Sonatype.sonatypeCentralHost,
scalafmt := true,
scalafmtSbtCheck := true,
ciReleaseJobs := ciReleaseJobs.value.map(j =>
j.copy(
steps = j.steps.map {
case Step.SingleStep(name @ "Release", _, _, _, _, _, env) =>
Step.SingleStep(
name = name,
run = Some(
"""|echo "$PGP_SECRET" | base64 -d -i - > /tmp/signing-key.gpg
| && echo "$PGP_PASSPHRASE" | gpg --pinentry-mode loopback --passphrase-fd 0 --import /tmp/signing-key.gpg
| && (echo "$PGP_PASSPHRASE"; echo; echo) | gpg --command-fd 0 --pinentry-mode loopback --change-passphrase $(gpg --list-secret-keys --with-colons 2> /dev/null | grep '^sec:' | cut --delimiter ':' --fields 5 | tail -n 1)
| && sbt '+publishSigned; sonatypeCentralRelease'""".stripMargin
),
env = env,
)
case s => s
}
)
),
scalafmt := true,
scalafmtSbtCheck := true,
scalafixDependencies ++= List(
"com.github.vovapolu" %% "scaluzzi" % "0.1.23"
),
Expand Down

0 comments on commit be8f80c

Please sign in to comment.