Skip to content

Commit f387a20

Browse files
authored
Migrate to sbt ci release (#14)
* replace bintray with sbt-ci-release * Update template README * add GitHub actions plugin to replace Travis * Updated resolver to use https
1 parent 10e1268 commit f387a20

File tree

8 files changed

+53
-44
lines changed

8 files changed

+53
-44
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ lazy val root = project.in(file("."))
99
val _ = (g8Test in Test).toTask("").value
1010
},
1111
scriptedLaunchOpts ++= List("-Xms1024m", "-Xmx1024m", "-XX:ReservedCodeCacheSize=128m", "-XX:MaxPermSize=256m", "-Xss2m", "-Dfile.encoding=UTF-8"),
12-
resolvers += Resolver.url("typesafe", url("http://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)
12+
resolvers += Resolver.url("typesafe", url("https://repo.typesafe.com/typesafe/ivy-releases/"))(Resolver.ivyStylePatterns)
1313
)

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.2.1
1+
sbt.version=1.5.5

project/giter8.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
addSbtPlugin("org.foundweekends.giter8" %% "sbt-giter8" % "0.11.0")
1+
addSbtPlugin("org.foundweekends.giter8" %% "sbt-giter8" % "0.13.1")
22

33
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

src/main/g8/.travis.yml

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/main/g8/README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ Run `test` for regular unit tests.
1212

1313
Run `scripted` for [sbt script tests](http://www.scala-sbt.org/1.x/docs/Testing-sbt-plugins.html).
1414

15+
### CI
16+
17+
The generated project uses [sbt-github-actions](https://github.com/djspiewak/sbt-github-actions) as a plugin to generate workflows for GitHub actions. For full details of how to use it [read this](https://github.com/djspiewak/sbt-github-actions/blob/main/README.md)
18+
1519
### Publishing
1620

1721
1. publish your source to GitHub
18-
2. [create a bintray account](https://bintray.com/signup/index) and [set up bintray credentials](https://github.com/sbt/sbt-bintray#publishing)
19-
3. create a bintray repository `sbt-plugins`
20-
4. update your bintray publishing settings in `build.sbt`
21-
5. `sbt publish`
22-
6. [request inclusion in sbt-plugin-releases](https://bintray.com/sbt/sbt-plugin-releases)
23-
7. [Add your plugin to the community plugins list](https://github.com/sbt/website#attention-plugin-authors)
24-
8. [Claim your project an Scaladex](https://github.com/scalacenter/scaladex-contrib#claim-your-project)
22+
2. Follow the instructions in [sbt-ci-release](https://github.com/olafurpg/sbt-ci-release/blob/main/readme.md) to create a sonatype account and setup your keys
23+
3. `sbt ci-release`
24+
4. [Add your plugin to the community plugins list](https://github.com/sbt/website#attention-plugin-authors)
25+
5. [Claim your project an Scaladex](https://github.com/scalacenter/scaladex-contrib#claim-your-project)

src/main/g8/build.sbt

Lines changed: 34 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,51 @@ sbtPlugin := true
88
// choose a test framework
99

1010
// utest
11-
//libraryDependencies += "com.lihaoyi" %% "utest" % "0.4.8" % "test"
11+
//libraryDependencies += "com.lihaoyi" %% "utest" % "0.7.10" % "test"
1212
//testFrameworks += new TestFramework("utest.runner.Framework")
1313

1414
// ScalaTest
15-
//libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.1" % "test"
16-
//libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.1" % "test"
15+
//libraryDependencies += "org.scalactic" %% "scalactic" % "3.2.9" % "test"
16+
//libraryDependencies += "org.scalatest" %% "scalatest" % "3.2.9" % "test"
1717

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

22-
bintrayPackageLabels := Seq("sbt","plugin")
23-
bintrayVcsUrl := Some("""[email protected]:$organization$/$name;format="norm"$.git""")
22+
inThisBuild(List(
23+
organization := "$organization$",
24+
homepage := Some(url("$homePageUrl$")),
25+
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
26+
developers := List(
27+
Developer(
28+
"$developerGitHubId$",
29+
"$developerFullName$",
30+
"$developerEmailAddress$",
31+
url("$developerWebsiteUrl$")
32+
)
33+
)
34+
))
2435

2536
initialCommands in console := """import $package$._"""
2637

2738
enablePlugins(ScriptedPlugin)
2839
// set up 'scripted; sbt plugin for testing sbt plugins
2940
scriptedLaunchOpts ++=
3041
Seq("-Xmx1024M", "-Dplugin.version=" + version.value)
42+
43+
ThisBuild / githubWorkflowTargetTags ++= Seq("v*")
44+
ThisBuild / githubWorkflowPublishTargetBranches :=
45+
Seq(RefPredicate.StartsWith(Ref.Tag("v")))
46+
47+
ThisBuild / githubWorkflowPublish := Seq(
48+
WorkflowStep.Sbt(
49+
List("ci-release"),
50+
env = Map(
51+
"PGP_PASSPHRASE" -> "\${{ secrets.PGP_PASSPHRASE }}",
52+
"PGP_SECRET" -> "\${{ secrets.PGP_SECRET }}",
53+
"SONATYPE_PASSWORD" -> "\${{ secrets.SONATYPE_PASSWORD }}",
54+
"SONATYPE_USERNAME" -> "\${{ secrets.SONATYPE_USERNAME }}"
55+
)
56+
)
57+
)
58+

src/main/g8/default.properties

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
pluginName=Foo Bar
2+
homePageUrl=https://github.com/sbt/sbt-autoplugin.g8
23
name=sbt-$pluginName;format="norm"$
34
organization=org.example
45
package=$organization;format="lower,package"$.sbt
56
purpose=An sbt AutoPlugin
67
description=sbt AutoPlugin seed
78
verbatim=.travis.yml
89
sbtVersion=maven(org.scala-sbt,sbt,stable)
10+
developerGitHubId=sbt
11+
developerFullName=Foo Bar
12+
developerEmailAddress[email protected]
13+
developerWebsiteUrl=https://scala-lang.org

src/main/g8/project/plugins.sbt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
2-
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.1")
2+
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
3+
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.13.0")
4+

0 commit comments

Comments
 (0)