Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: start using sbt-ci-release #244

Merged
merged 3 commits into from
Apr 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://github.com/marketplace/actions/release-drafter
name-template: '$NEXT_PATCH_VERSION'

change-template: '* $TITLE. [#$NUMBER](https://github.com/dwijnand/sbt-dynver/pull/$NUMBER) by [@$AUTHOR](https://github.com/$AUTHOR)'
change-template: '* $TITLE. [#$NUMBER](https://github.com/sbt/sbt-dynver/pull/$NUMBER) by [@$AUTHOR](https://github.com/$AUTHOR)'

categories:
- title: 'Dependency Updates'
Expand All @@ -12,4 +12,4 @@ template: |

$CHANGES

https://github.com/dwijnand/sbt-dynver/compare/$PREVIOUS_TAG...$NEXT_PATCH_VERSION
https://github.com/sbt/sbt-dynver/compare/$PREVIOUS_TAG...$NEXT_PATCH_VERSION
9 changes: 6 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: olafurpg/setup-scala@v13
- uses: coursier/cache-action@v6
- uses: actions/checkout@v3
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: 'sbt'
- run: sbt test scripted mimaReportBinaryIssues
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
push:
branches: # Snapshots
- master
tags: ["**"] # Releases
release:
types: [published]

jobs:
publish-artifacts:
runs-on: ubuntu-22.04
if: ${{ github.repository_owner == 'sbt' }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
cache: 'sbt'

- name: Publish artifacts
run: sbt ci-release
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
target
.bsp/
.idea/
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ Features:

Add this to your sbt build plugins, in either `project/plugins.sbt` or `project/dynver.sbt`:

addSbtPlugin("com.dwijnand" % "sbt-dynver" % "x.y.z")
addSbtPlugin("com.github.sbt" % "sbt-dynver" % "x.y.z")
// Until version 4.1.1:
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")

The latest release is: [![release-badge][]][release]

Expand Down Expand Up @@ -195,5 +197,5 @@ Global / onLoad := (Global / onLoad).value.andThen { s =>

Deciding whether going from one version to another is a "breaking change" is out of scope for this project.
If you have binary compatibility check setup using `previousStableVersion` in CI
and want to skip the check for major version branches (e.g. `1.x` vs `2.x`), see https://github.com/dwijnand/sbt-dynver/issues/70#issuecomment-458620722
and want to skip the check for major version branches (e.g. `1.x` vs `2.x`), see https://github.com/sbt/sbt-dynver/issues/70#issuecomment-458620722
for the recommended solution.
10 changes: 3 additions & 7 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@ val dynverRoot = project.in(file("."))
aggregateProjects(dynverLib, sbtdynver)

inThisBuild(List(
organization := "com.dwijnand",
organization := "com.github.sbt",
licenses := Seq("Apache-2.0" -> url("https://www.apache.org/licenses/LICENSE-2.0")),
description := "An sbt plugin to dynamically set your version from git",
developers := List(Developer("dwijnand", "Dale Wijnand", "dale wijnand gmail com", url("https://dwijnand.com"))),
startYear := Some(2016),
homepage := scmInfo.value map (_.browseUrl),
scmInfo := Some(ScmInfo(url("https://github.com/dwijnand/sbt-dynver"), "scm:git:git@github.com:dwijnand/sbt-dynver.git")),
scmInfo := Some(ScmInfo(url("https://github.com/sbt/sbt-dynver"), "scm:git:git@github.com:sbt/sbt-dynver.git")),

Global / sbtVersion := "1.1.0", // must be Global, otherwise ^^ won't change anything
LocalRootProject / crossSbtVersions := List("1.1.0"),

scalaVersion := "2.12.15",
scalaVersion := "2.12.17",

scalacOptions ++= Seq("-encoding", "utf8"),
scalacOptions ++= Seq("-deprecation", "-feature", "-unchecked", "-Xlint"),
Expand All @@ -34,7 +34,6 @@ val dynver = project.settings(
libraryDependencies += "org.scalacheck" %% "scalacheck" % "1.15.4" % Test,
resolvers += Resolver.sbtPluginRepo("releases"), // for prev artifacts, not repo1 b/c of mergly publishing
publishSettings,
publishMavenStyle := false, // so it's resolved out of sbt-plugin-releases as a dep of sbt-dynver
)

val sbtdynver = project.dependsOn(dynverLib).enablePlugins(SbtPlugin).settings(
Expand All @@ -48,9 +47,6 @@ val sbtdynver = project.dependsOn(dynverLib).enablePlugins(SbtPlugin).settings(

lazy val publishSettings = Def.settings(
MimaSettings.mimaSettings,
bintrayPackage := "sbt-dynver", // keep publishing to the same place
bintrayRepository := "sbt-plugins",
bintray / resolvers := Nil, // disable getting my bintray repo through my local credentials; be like CI
)

mimaPreviousArtifacts := Set.empty
Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.4.7
sbt.version=1.8.2
3 changes: 1 addition & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.0")
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.6.1")
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}
2 changes: 1 addition & 1 deletion sbtdynver/src/sbt-test/dynver/versions/project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sys.props.get("plugin.version") match {
case Some(x) => addSbtPlugin("com.dwijnand" % "sbt-dynver" % x)
case Some(x) => addSbtPlugin("com.github.sbt" % "sbt-dynver" % x)
case _ => sys.error("""|The system property 'plugin.version' is not defined.
|Specify this property using the scriptedLaunchOpts -D.""".stripMargin)
}