Skip to content

Commit

Permalink
chore(gha): 💙 fix publish to Sonatype
Browse files Browse the repository at this point in the history
  • Loading branch information
felipebonezi committed Jul 10, 2022
1 parent 33e6ed6 commit 9efd4cb
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 30 deletions.
30 changes: 6 additions & 24 deletions .github/workflows/continouos-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,6 @@ jobs:
name: Publish to Sonatype
if: "github.event.release || github.event.release.prerelease"
runs-on: ubuntu-latest
env:
GPG_KEY_FILE: ${{ secrets.GPG_KEY_FILE }}
GPG_SBT: ${{ secrets.GPG_SBT }}
SONATYPE_CREDENTIALS: ${{ secrets.SONATYPE_CREDENTIALS }}
steps:
- uses: actions/checkout@v3

Expand All @@ -88,24 +84,10 @@ jobs:
java-version: '8'
cache: 'sbt'

- name: Configure credentials
run: |
mkdir ~/.sbt/gpg
echo $GPG_PUB_KEY_FILE | base64 --decode > public.key
gpg --import public.key
gpg --list-secret-keys
echo $GPG_KEY_FILE | base64 --decode > secring
mv secring ~/.sbt/gpg/secring
echo $SONATYPE_CREDENTIALS | base64 --decode > sonatype.sbt
mv sonatype.sbt ~/.sbt/sonatype.sbt
echo $GPG_SBT | base64 --decode > gpg.sbt
mv gpg.sbt ~/.sbt/gpg.sbt
echo 'Setup credentials successfuly!'
- name: Publish package
run: sbt +publishSigned sonatypeBundleRelease
run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
4 changes: 2 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ lazy val core = project
.settings(
name := "play-actuator",
organization := "io.github.felipebonezi",
version := "0.1.0",
crossScalaVersions := Seq(scala212, scala213),
publishTo := sonatypePublishToBundle.value,
versionScheme := Some("early-semver"),
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org",
ThisBuild / sonatypeRepository := "https://s01.oss.sonatype.org/service/local",
Dependencies.actuator,
)

Expand Down
1 change: 0 additions & 1 deletion project/Common.scala
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ object Common extends AutoPlugin {
s"https://github.com/felipebonezi/$repoName/graphs/contributors",
url("https://github.com/felipebonezi")
),
versionScheme := Some("early-semver"),
)

override def projectSettings: Seq[Def.Setting[_]] =
Expand Down
5 changes: 2 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.13")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.7.0")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")

// Code formatter for Scala.
// See more: https://github.com/scalameta/sbt-scalafmt
Expand Down

0 comments on commit 9efd4cb

Please sign in to comment.