Skip to content

Commit

Permalink
Added ci-release
Browse files Browse the repository at this point in the history
  • Loading branch information
jiveshungerford committed Jan 25, 2024
1 parent 677f2e2 commit c469bd7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 55 deletions.
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
push:
branches: [master]
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: temurin
java-version: 8
cache: sbt
- 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 }}
79 changes: 27 additions & 52 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,62 +1,37 @@

name := """sbt-vite"""
organization := "org.hungerford"
version := "0.1-SNAPSHOT"

sbtPlugin := true

scalaVersion := "2.12.17"

// choose a test framework

// utest
//libraryDependencies += "com.lihaoyi" %% "utest" % "0.7.10" % "test"
//testFrameworks += new TestFramework("utest.runner.Framework")

// ScalaTest
//libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.9" % "test"
//libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % "test"

// Specs2
//libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "4.12.8" % "test")
//scalacOptions in Test ++= Seq("-Yrangepos")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")

inThisBuild(List(
organization := "org.hungerford",
homepage := Some(url("https://github.com/johnhungerford/sbt-vite")),
scalaVersion := "2.12.17",
sbtPlugin := true,
organization := "io.github.johnhungerford.sbt.vite",
organizationName := "johnhungerford",
organizationHomepage := Some(url("https://johnhungerford.github.io")),
homepage := Some(url("https://johnhungerford.github.io")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
startYear := Some(2024),
developers := List(
Developer(
"johnhungerford",
"John Hungerford",
"hungerfordjustice@gmail.com",
url("https://johnhungerford.github.io/")
),
id = "johnhungerford",
name = "John Hungerford",
email = "jiveshungerford@gmail.com",
url = url( "https://johnhungerford.github.io" )
)
),
scmInfo := Some(
ScmInfo(
url("https://github.com/johnhungerford/sbt-vite"),
"scm:git@github.com:johnhungerford/sbt-vite.git"
)
),
// githubWorkflowTargetTags ++= Seq("v*"),
// githubWorkflowPublishTargetBranches :=
// Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
scriptedLaunchOpts ++=
Seq("-Xmx1024M", "-Dvite.plugin.version=" + version.value),
))

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")

console / initialCommands := """import sbtvite._"""
ThisBuild / sonatypeCredentialHost := "s01.oss.sonatype.org"
sonatypeRepository := "https://s01.oss.sonatype.org/service/local"

enablePlugins(ScriptedPlugin)
// set up 'scripted; sbt plugin for testing sbt plugins
scriptedLaunchOpts ++=
Seq("-Xmx1024M", "-Dvite.plugin.version=" + version.value)

ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
ThisBuild / githubWorkflowPublishTargetBranches :=
Seq(RefPredicate.StartsWith(Ref.Tag("v")))

ThisBuild / githubWorkflowPublish := Seq(
WorkflowStep.Sbt(
List("ci-release"),
env = Map(
"PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
"PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
"SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
"SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}"
)
)
)

2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0")

2 changes: 0 additions & 2 deletions src/main/scala/sbtvite/ViteConfigGen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ object ViteConfigGen {
|export default defineConfig(($envVariableName) => {
| $buildConfigString
|
| console.log(config)
|
| return $configVariableName;
|})
|""".stripMargin
Expand Down

0 comments on commit c469bd7

Please sign in to comment.