Skip to content

Commit

Permalink
Don't use sbt for cutting a release (#618)
Browse files Browse the repository at this point in the history
* small changes

Signed-off-by: Henry Davidge <henry@davidge.me>

* no sbt for cutting release

Signed-off-by: Henry Davidge <henry@davidge.me>

* clean build.sbt

Signed-off-by: Henry Davidge <henry@davidge.me>

---------

Signed-off-by: Henry Davidge <henry@davidge.me>
Co-authored-by: Henry Davidge <henry@davidge.me>
  • Loading branch information
henrydavidge and Henry Davidge authored Mar 5, 2024
1 parent ba2c2ee commit 6bf27a7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 137 deletions.
19 changes: 14 additions & 5 deletions .github/workflows/cut-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,30 @@ jobs:
git config --global user.name "glow-release[bot]"
git config --global user.email "glow-release-bot@noreply.projectglow.io"
- name: Cut release with SBT
- name: Update version files for release
run: |
sbt 'set releaseType := "cutRelease"' 'release release-version ${{ inputs.release-version }} next-version ${{ inputs.next-version }}'
echo "${{ inputs.release-version }}" > stable-version.txt
sed -i "s/^VERSION =.*/VERSION = '${{ inputs.release-version }}'/" python/version.py
echo 'ThisBuild / version := "${{ inputs.release-version }}"' > version.sbt
git add stable-version.txt python/version.py version.sbt
git commit -m "Update version for release ${{ inputs.release-version }}" -s
- name: Update Python version file
run: |
sed -i "s/^VERSION =.*/VERSION = '${{ inputs.release-version }}'/" python/version.py
- name: Create release tag
run: git tag v${{ inputs.release-version }}

- name: Push release tag
run: git push origin v${{ inputs.release-version }}

- name: Update versions for next release
run: |
sed -i "s/^VERSION =.*/VERSION = '${{ inputs.next-version }}-SNAPSHOT'/" python/version.py
echo 'ThisBuild / version := "${{ inputs.next-version }}-SNAPSHOT"' > version.sbt
- name: Open pull request for next version
uses: peter-evans/create-pull-request@v6
with:
signoff: true
branch: releases/${{ inputs.release-version }}
title: Update development version to ${{ inputs.next-version }}
body: Automatically created by the "Cut release" workflow
commit-message: Update development versions
27 changes: 1 addition & 26 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -391,37 +391,12 @@ def sonatypeSteps(): Seq[ReleaseStep] = Seq(
releaseStepCommandAndRemaining("sonatypeBundleUpload")
)

val cutRelease = Seq[ReleaseStep](
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
setReleaseVersion,
updateStableVersion,
commitReleaseVersion,
commitStableVersion,
tagRelease,
setNextVersion,
commitNextVersion
)

val doRelease = Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
setReleaseVersion,
updateStableVersion,
checkRepoClean,
runClean,
runTest,
) ++ crossReleaseStep(releaseStepCommandAndRemaining("publishSigned"), requiresPySpark = false) ++
sonatypeSteps ++
crossReleaseStep(releaseStepCommandAndRemaining("stagedRelease/test"), requiresPySpark = false)

lazy val releaseType = settingKey[String]("releaseType")
ThisBuild / releaseType := "cutRelease"

releaseProcess := {
(ThisBuild / releaseType).value match {
case "cutRelease" => cutRelease
case "doRelease" => doRelease
case _ => throw new RuntimeException("Invalid release type")
}
}
106 changes: 0 additions & 106 deletions project/StableVersionPlugin.scala

This file was deleted.

0 comments on commit 6bf27a7

Please sign in to comment.