Skip to content

Commit ba13224

Browse files
authored
Merge pull request #129 from cb372/sbt-ci-release
2 parents 2bda92d + 316340b commit ba13224

File tree

5 files changed

+43
-14
lines changed

5 files changed

+43
-14
lines changed

.github/release-drafter.yml

-5
This file was deleted.

.github/workflows/ci.yml

+40-3
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
11
name: CI
22
on:
33
push:
4-
branches: [main]
4+
branches: [ main ]
55
pull_request:
6+
release:
7+
types: [ created ]
68

79
jobs:
8-
build:
10+
11+
test:
912
strategy:
1013
fail-fast: false
1114
matrix:
1215
include:
1316
- sbt_version: 1.3.13
1417
- sbt_version: 1.4.0
1518
- sbt_version: 1.8.3
16-
1719
runs-on: ubuntu-latest
1820
steps:
1921
- uses: actions/checkout@v3
@@ -23,3 +25,38 @@ jobs:
2325
java-version: 17
2426
- name: Test
2527
run: sbt -Dfile.encoding=UTF8 -J-XX:ReservedCodeCacheSize=256M "^^${{ matrix.sbt_version }}" "scripted basic/*"
28+
29+
release:
30+
needs: [ test ]
31+
if: github.ref == 'refs/heads/main' || github.ref_type == 'tag'
32+
runs-on: ubuntu-latest
33+
steps:
34+
- uses: actions/checkout@v3
35+
with:
36+
fetch-depth: 0
37+
- uses: actions/setup-java@v3
38+
with:
39+
distribution: adopt
40+
java-version: 17
41+
- name: Release
42+
run: sbt ci-release
43+
env:
44+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
45+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
46+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
47+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
48+
49+
update-version-number:
50+
needs: [ release ]
51+
if: github.ref_type == 'tag'
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
with:
56+
ref: 'main'
57+
- name: Update version number in example project
58+
run: |
59+
echo 'addSbtPlugin("com.github.cb372" % "sbt-explicit-dependencies" % "${{ github.ref_name }}")' > example/project/plugins.sbt
60+
- uses: EndBug/add-and-commit@v9
61+
with:
62+
message: '[skip ci] Update plugin version in example repo'

build.sbt

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import ReleaseTransformations._
2-
31
enablePlugins(SbtPlugin)
42

53
val latestSbt_1_3_x_version = "1.3.13"
@@ -18,7 +16,7 @@ description := "An sbt plugin to check that your project does not directly depen
1816
homepage := Some(url("https://github.com/cb372/sbt-explicit-dependencies"))
1917
licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))
2018

21-
releaseCrossBuild := false
19+
/*
2220
releaseProcess := Seq[ReleaseStep](
2321
checkSnapshotDependencies,
2422
inquireVersions,
@@ -32,6 +30,7 @@ releaseProcess := Seq[ReleaseStep](
3230
commitNextVersion,
3331
pushChanges
3432
)
33+
*/
3534

3635
lazy val updateVersionInExampleProject = taskKey[Unit]("update the version of the plugin used in the example project")
3736
updateVersionInExampleProject := {

project/plugins.sbt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")
2-
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.13")
1+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")

version.sbt

-1
This file was deleted.

0 commit comments

Comments
 (0)