File tree Expand file tree Collapse file tree 4 files changed +8
-28
lines changed Expand file tree Collapse file tree 4 files changed +8
-28
lines changed Original file line number Diff line number Diff line change @@ -10,10 +10,13 @@ name: CI
10
10
on :
11
11
push :
12
12
branches : ['release/2.x']
13
- tags-ignore : [v*] # release tags are automatically generated after a successful CI build, no need to run CI against them
13
+ tags : [v*]
14
14
pull_request :
15
15
branches : ['**']
16
16
17
+ permissions :
18
+ contents : read
19
+
17
20
jobs :
18
21
19
22
#
34
37
35
38
- name : 1. Check out code
36
39
uses : actions/checkout@v2 # https://github.com/actions/checkout
37
- with :
38
- fetch-depth : ' 0' # https://github.com/shipkit/shipkit-changelog#fetch-depth-on-ci
39
40
40
41
- name : 2. Set up Java ${{ matrix.java }}
41
42
uses : actions/setup-java@v2
@@ -57,11 +58,13 @@ jobs:
57
58
# Release job, only for pushes to the main development branch
58
59
#
59
60
release :
61
+ permissions :
62
+ contents : write
60
63
runs-on : ubuntu-latest
61
64
needs : [build] # build job must pass before we can release
62
65
63
66
if : github.event_name == 'push'
64
- && github.ref == 'refs/heads/release/2.x'
67
+ && ( github.ref == 'refs/heads/release/2.x' || startsWith(github.ref, 'refs/tags/v'))
65
68
&& github.repository == 'mockito/mockito-scala'
66
69
&& !contains(toJSON(github.event.commits.*.message), '[skip release]')
67
70
79
82
java-version : 17
80
83
81
84
- name : Build and publish to Bintray/MavenCentral
82
- run : ./gradlew writeActualVersion
83
- && export PROJECT_VERSION=`cat version.actual`
84
- && ./build.sh
85
+ run : ./build.sh
85
86
&& ./gradlew publishToSonatype githubRelease closeAndReleaseStagingRepository releaseSummary
86
87
env :
87
88
GITHUB_TOKEN : ${{secrets.GITHUB_TOKEN}}
Original file line number Diff line number Diff line change @@ -85,12 +85,6 @@ nexusPublishing {
85
85
}
86
86
}
87
87
88
- task writeActualVersion {
89
- doLast {
90
- file(" version.actual" ) << " $version "
91
- }
92
- }
93
-
94
88
def isSnapshot = version. endsWith(" -SNAPSHOT" )
95
89
96
90
if (isSnapshot) {
Original file line number Diff line number Diff line change @@ -7,18 +7,6 @@ val currentScalaVersion = "2.13.16"
7
7
inThisBuild(
8
8
Seq (
9
9
scalaVersion := currentScalaVersion,
10
- // Load version from the file so that Gradle/Shipkit and SBT use the same version
11
- version := sys.env
12
- .get(" PROJECT_VERSION" )
13
- .filter(_.trim.nonEmpty)
14
- .orElse {
15
- lazy val VersionRE = """ ^version=(.+)$""" .r
16
- Using .file(Source .fromFile)(baseDirectory.value / " version.properties" ) {
17
- _.getLines.collectFirst { case VersionRE (v) => v }
18
- }
19
- }
20
- .map(_.replace(" .*" , " -SNAPSHOT" ))
21
- .get
22
10
)
23
11
)
24
12
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments