Skip to content

Commit

Permalink
Add publishing settings (#11)
Browse files Browse the repository at this point in the history
* Add publishing settings
* Add last LTS
* Reconfigure triggers
  • Loading branch information
danieletorelli authored May 8, 2024
1 parent de1026d commit a9f7c5a
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: CI
on:
pull_request:
push:
branches: [main]
release:
types:
- published

jobs:
test:
Expand All @@ -29,3 +33,29 @@ jobs:
shell: bash
run: |
sbt -v clean +publishLocal scripted
publish:
runs-on: ubuntu-latest

needs: [test]
if: github.event_name != 'pull_request'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/checkout@v4
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 21
cache: sbt
- name: Publish
shell: bash
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 }}
1 change: 1 addition & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ lazy val root = (project in file("."))
)
.settings(scriptedLaunchOpts += s"-Dplugin.version=${version.value}")
.enablePlugins(SbtPlugin)
.publishSettings
.dependsOn(macros)
.aggregate(macros)

Expand Down
33 changes: 33 additions & 0 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,39 @@ object Settings {

implicit final class ProjectSettings(project: sbt.Project) {

def publishSettings: sbt.Project = {
import com.jsuereth.sbtpgp.PgpKeys.*

project.settings(
inThisBuild(
List(
organization := "cloud.golem",
homepage := Some(
url("https://github.com/golemcloud/sbt-wasm-component")
),
licenses := List(
"Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")
),
developers := List(
Developer(
"danieletorelli",
"Daniele Torelli",
"[email protected]",
url("https://mdtorelli.it")
)
),
resolvers +=
"Sonatype OSS Snapshots 01" at "https://s01.oss.sonatype.org/content/repositories/snapshots",
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
resolvers +=
"Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots"
)
)
)
}

def macroParadiseSettings: sbt.Project =
project.settings(
scalacOptions ++= {
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

0 comments on commit a9f7c5a

Please sign in to comment.