Skip to content

Commit a08e7a6

Browse files
authored
Merge pull request #15 from takapi327/feature/2022-05-Create-Release-Action
Feature/2022 05 create release action
2 parents 61c9131 + fc263d1 commit a08e7a6

File tree

5 files changed

+80
-11
lines changed

5 files changed

+80
-11
lines changed

.github/release.yml

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
changelog:
2+
categories:
3+
- title: '🚀 Features'
4+
labels:
5+
- 'feature'
6+
- title: '💪 Enhancement'
7+
labels:
8+
- 'enhancement'
9+
- title: '🐛 Bug Fixes'
10+
labels:
11+
- 'fix'
12+
- 'bugfix'
13+
- 'bug'
14+
- title: '🧰 Maintenance'
15+
label: 'chore'
16+
- title: '🔧 Refactoring'
17+
label: 'refactor'
18+
- title: '📖 Documentation'
19+
label: 'documentation'
20+
- title: '⛓️ Dependency update'
21+
label: 'dependencies'

README.md

+17-2
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,25 @@ This framework relies on several libraries (automatically installed by Lepus).
4343
Coming soon...
4444

4545
## Quickstart with sbt
46+
Lepus Framework is not an official, publicly available plugin, but is privately maintained.
47+
48+
Therefore, S3 is used as maven. To use Lepus Framework plug-ins from s3, the following plug-in must be configured under project/project/build.sbt of the project to be used.
49+
50+
:warning: If it is project/build.sbt or plugin.sbt, I can't get the plugin properly and an error occurs. :warning:
51+
52+
※ Once officially released, the following settings will no longer be necessary.
53+
54+
in: project/project/build.sbt
55+
```sbt
56+
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.20.0")
57+
```
58+
4659
Add the following dependencies to plugins.sbt
4760

61+
in: project/plugins.sbt
4862
```sbt
49-
addSbtPlugin("com.github.takapi327" % "sbt-plugin" % "0.1.0-SNAPSHOT")
63+
ThisBuild / resolvers += "Lepus Maven" at "s3://com.github.takapi327.s3-ap-northeast-1.amazonaws.com/lepus/"
64+
addSbtPlugin("com.github.takapi327" % "sbt-plugin" % <version>)
5065
```
5166

5267
Load the required project with build.sbt
@@ -193,4 +208,4 @@ services:
193208
command: mock -h 0.0.0.0 /OpenApi.yaml
194209
volumes:
195210
- ./OpenApi.yaml:/OpenApi.yaml
196-
```
211+
```

build.sbt

+33-9
Original file line numberDiff line numberDiff line change
@@ -28,32 +28,53 @@ ThisBuild / githubWorkflowAddedJobs ++= Seq(
2828
)
2929
)
3030

31+
import ReleaseTransformations._
32+
lazy val publishSettings = Seq(
33+
publishTo := Some("Lepus Maven" at "s3://com.github.takapi327.s3-ap-northeast-1.amazonaws.com/lepus/"),
34+
(Compile / packageDoc) / publishArtifact := false,
35+
(Compile / packageSrc) / publishArtifact := false,
36+
releaseProcess := Seq[ReleaseStep](
37+
checkSnapshotDependencies,
38+
inquireVersions,
39+
runClean,
40+
runTest,
41+
setReleaseVersion,
42+
commitReleaseVersion,
43+
tagRelease,
44+
publishArtifacts,
45+
setNextVersion,
46+
commitNextVersion,
47+
pushChanges
48+
)
49+
)
50+
3151
// Project settings
3252
lazy val LepusProject = Project("Lepus", file("core/lepus"))
3353
.settings(
3454
scalaVersion := sys.props.get("scala.version").getOrElse(ScalaVersions.scala213),
3555
crossScalaVersions := Seq(scalaVersion.value),
36-
commonSettings,
3756
scalacOptions += "-target:jvm-1.8",
3857
libraryDependencies ++= Seq(
3958
cats,
4059
typesafeConfig,
4160
) ++ specs2Deps.map(_ % Test)
4261
)
62+
.settings(commonSettings: _*)
63+
.settings(publishSettings: _*)
4364

4465
lazy val LepusRouterProject = Project("Lepus-Router", file("core/lepus-router"))
4566
.settings(
4667
scalaVersion := (LepusProject / scalaVersion).value,
4768
crossScalaVersions := Seq(scalaVersion.value),
48-
commonSettings,
4969
libraryDependencies ++= routerDependencies
5070
)
71+
.settings(commonSettings: _*)
72+
.settings(publishSettings: _*)
5173

5274
lazy val LepusServerProject = Project("Lepus-Server", file("development/lepus-server"))
5375
.settings(
5476
scalaVersion := (LepusProject / scalaVersion).value,
5577
crossScalaVersions := Seq(scalaVersion.value),
56-
commonSettings,
5778
libraryDependencies ++= serverDependencies,
5879
(Compile / unmanagedSourceDirectories) += {
5980
val suffix = CrossVersion.partialVersion(scalaVersion.value) match {
@@ -63,23 +84,25 @@ lazy val LepusServerProject = Project("Lepus-Server", file("development/lepus-se
6384
(Compile / sourceDirectory).value / s"scala-$suffix"
6485
}
6586
)
87+
.settings(commonSettings: _*)
88+
.settings(publishSettings: _*)
6689
.dependsOn(LepusProject, LepusRouterProject)
6790

6891
lazy val LepusSwaggerProject = Project("Lepus-Swagger", file("development/lepus-swagger"))
6992
.settings(
7093
scalaVersion := (LepusProject / scalaVersion).value,
7194
crossScalaVersions := Seq(scalaVersion.value),
72-
commonSettings,
7395
libraryDependencies ++= swaggerDependencies
7496
)
97+
.settings(commonSettings: _*)
98+
.settings(publishSettings: _*)
7599
.dependsOn(LepusProject, LepusRouterProject)
76100

77101
lazy val SbtPluginProject = Project("Sbt-Plugin", file("development/sbt-plugin"))
78102
.enablePlugins(SbtPlugin)
79103
.settings(
80104
scalaVersion := scala212,
81105
crossScalaVersions := Seq(scala212),
82-
commonSettings,
83106
libraryDependencies ++= Seq(
84107
Defaults.sbtPluginExtra(
85108
"com.github.sbt" % "sbt-native-packager" % "1.9.7",
@@ -96,6 +119,8 @@ lazy val SbtPluginProject = Project("Sbt-Plugin", file("development/sbt-plugin")
96119
)
97120
}.taskValue
98121
)
122+
.settings(commonSettings: _*)
123+
.settings(publishSettings: _*)
99124

100125
lazy val userProjects = Seq[ProjectReference](
101126
LepusProject,
@@ -109,8 +134,7 @@ lazy val nonUserProjects = Seq[ProjectReference](
109134
)
110135

111136
lazy val LepusFramework = Project("Lepus-Framework", file("."))
112-
.settings(
113-
scalaVersion := sys.props.get("scala.version").getOrElse(scala213),
114-
commonSettings
115-
)
137+
.settings(scalaVersion := sys.props.get("scala.version").getOrElse(scala213))
138+
.settings(commonSettings: _*)
139+
.settings(publishSettings: _*)
116140
.aggregate((userProjects ++ nonUserProjects): _*)

project/plugins.sbt

+8
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,10 @@
1+
/**
2+
* This file is part of the Lepus Framework.
3+
* For the full copyright and license information,
4+
* please view the LICENSE file that was distributed with this source code.
5+
*/
6+
17
addSbtPlugin("com.codecommit" % "sbt-github-actions" % "0.14.2")
28
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.4.6")
9+
addSbtPlugin("com.frugalmechanic" % "fm-sbt-s3-resolver" % "0.20.0")
10+
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")

version.sbt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ThisBuild / version := "0.1.0"

0 commit comments

Comments
 (0)