Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sbt/sbt-release
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v1.1.0
Choose a base ref
...
head repository: sbt/sbt-release
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v1.3.0
Choose a head ref
Loading
Showing with 26 additions and 22 deletions.
  1. +5 −4 .github/workflows/ci.yml
  2. +7 −4 .github/workflows/release.yml
  3. +10 −10 README.md
  4. +1 −1 build.sbt
  5. +1 −1 project/build.properties
  6. +2 −2 project/plugins.sbt
9 changes: 5 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -17,13 +17,14 @@ jobs:
- java: 8
- java: 11
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v12
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
java-version: "adopt@1.${{ matrix.java }}"
- uses: coursier/cache-action@v6
java-version: ${{matrix.java}}
distribution: temurin
- uses: coursier/cache-action@a0e7cd24be81bc84f0d7461e02bd1a96980553d7 # v6.4.4
- run: |
git config --global user.email "example@example.com"
git config --global user.name "example"
11 changes: 7 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -5,14 +5,17 @@ on:
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
fetch-depth: 0
- uses: olafurpg/setup-scala@v12
- uses: actions/setup-java@387ac29b308b003ca37ba93a6cab5eb57c8f5f93 # v4.0.0
with:
java-version: 8
distribution: temurin
- run: sbt ci-release
if: ${{ !github.event.repository.fork }}
if: ${{ github.repository_owner == 'sbt' }}
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# sbt-release
This sbt plugin provides a customizable release process that you can add to your project.

[![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.sbt/sbt-release/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.sbt/sbt-release/)
[![sbt-release Scala version support](https://index.scala-lang.org/sbt/sbt-release/sbt-release/latest-by-scala-version.svg?targetType=Sbt)](https://index.scala-lang.org/sbt/sbt-release/sbt-release)

**Notice:** This README contains information for the latest release. Please refer to the documents for a specific version by looking up the respective [tag](https://github.com/sbt/sbt-release/tags).

@@ -21,15 +21,15 @@ This sbt plugin provides a customizable release process that you can add to your
* 1-BETA17
* 1.2.3.4.5
* 1.2.3.4.5-SNAPSHOT
* A [publish repository](https://www.scala-sbt.org/release/docs/Publishing.html) configured. (Required only for the default release process. See further below for release process customizations.)
* A [publish repository](https://www.scala-sbt.org/1.x/docs/Publishing.html) configured. (Required only for the default release process. See further below for release process customizations.)
* git [optional]

## Usage

Add the following lines to `./project/plugins.sbt`. See the section [Using Plugins](https://www.scala-sbt.org/release/docs/Using-Plugins.html) in the sbt website for more information.
Add the following lines to `./project/plugins.sbt`. See the section [Using Plugins](https://www.scala-sbt.org/1.x/docs/Using-Plugins.html) in the sbt website for more information.

```scala
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.0.15")
addSbtPlugin("com.github.sbt" % "sbt-release" % "1.1.0")
```

## version.sbt
@@ -50,7 +50,7 @@ The default release process consists of the following tasks:
1. Ask the user for the `release version` and the `next development version`. Sensible defaults are provided.
1. Run `clean`.
1. Run `test:test`, if any test fails, the release process is aborted.
1. Write `ThisBuild / version := "$releaseVersion"` to the file `version.sbt` and also apply this setting to the current [build state](https://www.scala-sbt.org/release/docs/Build-State.html).
1. Write `ThisBuild / version := "$releaseVersion"` to the file `version.sbt` and also apply this setting to the current [build state](https://www.scala-sbt.org/1.x/docs/Core-Principles.html#Introduction+to+build+state).
1. Commit the changes in `version.sbt`.
1. Tag the previous commit with `v$version` (eg. `v1.2`, `v1.2.3`).
1. Run `publish`.
@@ -92,7 +92,7 @@ For that emergency release at 2am on a Sunday, you can optionally avoid running

### Cross building during a release

Since version 0.7, *sbt-release* comes with built-in support for [cross building](https://www.scala-sbt.org/release/docs/Cross-Build.html) and cross publishing. A cross release can be triggered in two ways:
Since version 0.7, *sbt-release* comes with built-in support for [cross building](https://www.scala-sbt.org/1.x/docs/Cross-Build.html) and cross publishing. A cross release can be triggered in two ways:

1. via the setting `releaseCrossBuild` (by default set to `false`)
1. by using the option `cross` for the `release` command
@@ -192,7 +192,7 @@ The release process can be customized to the project's needs.
* Want to check for the existence of release notes at the start of the release and then publish it with [posterous-sbt](https://github.com/n8han/posterous-sbt) at the end? Just add the release step.


The release process is defined by [State](https://www.scala-sbt.org/release/api/sbt/State.html) transformation functions (`State => State`), for which *sbt-release* defines this case class:
The release process is defined by [State](https://www.scala-sbt.org/1.x/docs/Build-State.html) transformation functions (`State => State`), for which *sbt-release* defines this case class:

```scala
case class ReleaseStep (
@@ -206,7 +206,7 @@ The function `action` is used to perform the actual release step. Additionally,

The sequence of `ReleaseStep`s that make up the release process is stored in the setting `releaseProcess: SettingKey[Seq[ReleaseStep]]`.

The state transformations functions used in *sbt-release* are the same as the action/body part of a no-argument command. You can read more about [building commands](https://www.scala-sbt.org/release/docs/Commands.html) in the sbt website.
The state transformations functions used in *sbt-release* are the same as the action/body part of a no-argument command. You can read more about [building commands](https://www.scala-sbt.org/1.x/docs/Commands.html) in the sbt website.

### Release Steps

@@ -254,7 +254,7 @@ releaseProcess := Seq[ReleaseStep](
)
```

I highly recommend to make yourself familiar with the [State API](https://www.scala-sbt.org/release/api/sbt/State.html) before you continue your journey to a fully customized release process.
I highly recommend to make yourself familiar with the [State API](https://www.scala-sbt.org/1.x/docs/Build-State.html) before you continue your journey to a fully customized release process.

### Can we finally customize that release process, please?

@@ -284,7 +284,7 @@ releaseProcess := Seq[ReleaseStep](

The names of the individual steps of the release process are pretty much self-describing.
Notice how we can just reuse the `publish` task by utilizing the `releaseTask` helper function,
but keep in mind that it needs to be properly scoped (more info on [Scopes](https://www.scala-sbt.org/release/docs/Scopes.html)).
but keep in mind that it needs to be properly scoped (more info on [Scopes](https://www.scala-sbt.org/1.x/docs/Scopes.html)).

Note, the `commitReleaseVersion` step requires that the working directory has no untracked files by default. It will abort the release in this case. You may disable this check
by setting the `releaseIgnoreUntrackedFiles` key to `true`.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
@@ -26,7 +26,7 @@ Compile / doc / scalacOptions ++= {
)
}

libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "4.12.1" % "test")
libraryDependencies ++= Seq("org.specs2" %% "specs2-core" % "4.20.3" % "test")

// Scripted
enablePlugins(SbtPlugin)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.4
sbt.version=1.9.8
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value

addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1")

addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.7")
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")