Skip to content

Commit

Permalink
Publish configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Karel Cemus committed Nov 7, 2023
1 parent 4fd8312 commit f2391a3
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 5 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: Publish
on:
workflow_dispatch:
inputs:
version:
required: true
description: "The version to be published"
type: string
push:
branches: ["*"]
tags: ["*"]

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
build-and-test:
runs-on: ubuntu-22.04
timeout-minutes: 15
env:
SBT_OPTS: -Dfile.encoding=UTF-8 -Duser.timezone=UTC
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}

- name: Cache Coursier
uses: coursier/[email protected]

- name: Setup JDK
uses: coursier/[email protected]
with:
jvm: adoptium:1.17

- name: Import GPG Key
timeout-minutes: 10
env:
PGP_SECRET: ${{ secrets.PGP_SECRET }}
run: |
echo $PGP_SECRET | base64 --decode | gpg --batch --import
- name: Build
timeout-minutes: 10
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
run: |
sbt --client "+test; +publishSigned;"
6 changes: 1 addition & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,4 @@ releaseTagName := (ThisBuild / version).value
releasePublishArtifactsAction := PgpKeys.publishSigned.value

// Publish settings
publishTo := {
// Resolver.sonatypeOssRepos("snapshots")
if (isSnapshot.value) None
else Some(Opts.resolver.sonatypeStaging)
}
publishTo := sonatypePublishToBundle.value
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// library release
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.21")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

// checks for updates
Expand Down

0 comments on commit f2391a3

Please sign in to comment.