Skip to content

Commit 470743f

Browse files
committed
fix: start releasing to Sonatype
Since bintray is no longer an option, this sets up sbt-ci-release which is commonly used for sbt plugins to do releases. I'll include some comments inline.
1 parent 38c6944 commit 470743f

File tree

5 files changed

+31
-42
lines changed

5 files changed

+31
-42
lines changed

.github/workflows/release.yml

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Release
2+
on:
3+
push:
4+
branches:
5+
- master
6+
tags: ["*"]
7+
jobs:
8+
publish:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- uses: actions/setup-java@v3
15+
with:
16+
distribution: 'temurin'
17+
java-version: '8'
18+
- run: sbt ci-release
19+
env:
20+
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
21+
PGP_SECRET: ${{ secrets.PGP_SECRET }}
22+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
23+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}

.github/workflows/sbt.yml

+5-24
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,29 @@
11
name: Scala CI
22

3-
# Support "official releases" on master, and release fixes on release/ prefixed branches
43
on:
54
push:
65
branches:
76
- 'master'
8-
- 'releases/**'
9-
- '!releases/**-alpha'
107
paths-ignore:
118
- 'docs/**'
129
- 'README.md'
1310
pull_request:
1411
branches:
1512
- 'master'
16-
# trigger on new branch/tag creation
17-
create: []
1813

1914
jobs:
2015
build:
2116
runs-on: ubuntu-latest
2217
steps:
23-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v3
2419
with:
2520
fetch-depth: 0
2621
- name: Set up JDK
27-
uses: actions/setup-java@v2
22+
uses: actions/setup-java@v3
2823
with:
2924
java-version: 8
3025
distribution: temurin
31-
- name: Cache SBT ivy cache
32-
uses: actions/cache@v1
33-
with:
34-
path: ~/.ivy2/cache
35-
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}
36-
- name: Cache SBT
37-
uses: actions/cache@v1
38-
with:
39-
path: ~/.sbt
40-
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
26+
cache: 'sbt'
27+
4128
- name: Run tests
42-
run: sbt ^test ^scripted
43-
- name: Publish
44-
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
45-
env:
46-
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
47-
BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }}
48-
run: sbt ^publish
29+
run: sbt ^scripted

build.sbt

+1-12
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,16 @@ specifications as part of your build. Other tasks are available as command line
1010
lazy val `sbt-openapi-generator` = (project in file("."))
1111
.settings(
1212
scalaVersion := "2.12.15",
13-
crossScalaVersions := Seq(scalaVersion.value, "2.11.12"),
1413
crossSbtVersions := List("0.13.17", "1.3.10"),
1514
sbtPlugin := true,
1615

17-
publishMavenStyle := false,
18-
19-
bintrayRepository := "sbt-plugins",
20-
bintrayOrganization := Option("openapitools"),
21-
bintrayPackageLabels := Seq("sbt", "plugin", "oas", "openapi", "openapi-generator"),
22-
bintrayVcsUrl := Some("git@github.com:OpenAPITools/sbt-openapi-generator.git"),
23-
2416
scriptedLaunchOpts := {
2517
scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-server", "-Dplugin.version=" + version.value)
2618
},
2719

2820
scriptedBufferLog := false,
2921

30-
resolvers ++= Seq(
31-
Resolver.sbtPluginRepo("snapshots"),
32-
Resolver.sonatypeRepo("snapshots")
33-
),
22+
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),
3423

3524
homepage := Some(url("https://openapi-generator.tech")),
3625

project/build.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
sbt.version=1.6.2
1+
sbt.version=1.7.2

project/plugin.sbt

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
// Manages publishing.
2-
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")
3-
4-
// Versions the build.
5-
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
1+
addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")

0 commit comments

Comments
 (0)