Skip to content
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
15 changes: 8 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,13 @@ name: CI
on:
push:
branches: ['release/2.x']
tags-ignore: [v*] # release tags are automatically generated after a successful CI build, no need to run CI against them
tags: [v*]
pull_request:
branches: ['**']

permissions:
contents: read

jobs:

#
Expand All @@ -34,8 +37,6 @@ jobs:

- name: 1. Check out code
uses: actions/checkout@v2 # https://github.com/actions/checkout
with:
fetch-depth: '0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci

- name: 2. Set up Java ${{ matrix.java }}
uses: actions/setup-java@v2
Expand All @@ -57,11 +58,13 @@ jobs:
# Release job, only for pushes to the main development branch
#
release:
permissions:
contents: write
runs-on: ubuntu-latest
needs: [build] # build job must pass before we can release

if: github.event_name == 'push'
&& github.ref == 'refs/heads/release/2.x'
&& (github.ref == 'refs/heads/release/2.x' || startsWith(github.ref, 'refs/tags/v'))
&& github.repository == 'mockito/mockito-scala'
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')

Expand All @@ -79,9 +82,7 @@ jobs:
java-version: 17

- name: Build and publish to Bintray/MavenCentral
run: ./gradlew writeActualVersion
&& export PROJECT_VERSION=`cat version.actual`
&& ./build.sh
run: ./build.sh
&& ./gradlew publishToSonatype githubRelease closeAndReleaseStagingRepository releaseSummary
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
Expand Down
6 changes: 0 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,6 @@ nexusPublishing {
}
}

task writeActualVersion {
doLast {
file("version.actual") << "$version"
}
}

def isSnapshot = version.endsWith("-SNAPSHOT")

if (isSnapshot) {
Expand Down
12 changes: 0 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,6 @@ val currentScalaVersion = "2.13.16"
inThisBuild(
Seq(
scalaVersion := currentScalaVersion,
// Load version from the file so that Gradle/Shipkit and SBT use the same version
version := sys.env
.get("PROJECT_VERSION")
.filter(_.trim.nonEmpty)
.orElse {
lazy val VersionRE = """^version=(.+)$""".r
Using.file(Source.fromFile)(baseDirectory.value / "version.properties") {
_.getLines.collectFirst { case VersionRE(v) => v }
}
}
.map(_.replace(".*", "-SNAPSHOT"))
.get
)
)

Expand Down
3 changes: 0 additions & 3 deletions version.properties

This file was deleted.