Skip to content

fix: start releasing to Sonatype #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
23 changes: 23 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Release
on:
push:
branches:
- master
tags: ["*"]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '8'
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
29 changes: 5 additions & 24 deletions .github/workflows/sbt.yml
Original file line number Diff line number Diff line change
@@ -1,48 +1,29 @@
name: Scala CI

# Support "official releases" on master, and release fixes on release/ prefixed branches
on:
push:
branches:
- 'master'
- 'releases/**'
- '!releases/**-alpha'
Comment on lines -8 to -9
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These didn't seem to be used, plus you'll get SNAPSHOTS being published now. This just simplifies things.

paths-ignore:
- 'docs/**'
- 'README.md'
pull_request:
branches:
- 'master'
# trigger on new branch/tag creation
create: []

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up JDK
uses: actions/setup-java@v2
uses: actions/setup-java@v3
with:
java-version: 8
distribution: temurin
- name: Cache SBT ivy cache
uses: actions/cache@v1
with:
path: ~/.ivy2/cache
key: ${{ runner.os }}-sbt-ivy-cache-${{ hashFiles('**/*.sbt') }}
- name: Cache SBT
uses: actions/cache@v1
with:
path: ~/.sbt
key: ${{ runner.os }}-sbt-${{ hashFiles('**/*.sbt') }}
cache: 'sbt'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of all the manual caching, setup/java@3 has built-in sbt caching.


- name: Run tests
run: sbt ^test ^scripted
- name: Publish
if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/tags/v')
env:
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
BINTRAY_PASS: ${{ secrets.BINTRAY_PASS }}
run: sbt ^publish
run: sbt ^scripted
13 changes: 1 addition & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,16 @@ specifications as part of your build. Other tasks are available as command line
lazy val `sbt-openapi-generator` = (project in file("."))
.settings(
scalaVersion := "2.12.15",
crossScalaVersions := Seq(scalaVersion.value, "2.11.12"),
crossSbtVersions := List("0.13.17", "1.3.10"),
sbtPlugin := true,

publishMavenStyle := false,

bintrayRepository := "sbt-plugins",
bintrayOrganization := Option("openapitools"),
bintrayPackageLabels := Seq("sbt", "plugin", "oas", "openapi", "openapi-generator"),
bintrayVcsUrl := Some("git@github.com:OpenAPITools/sbt-openapi-generator.git"),

scriptedLaunchOpts := {
scriptedLaunchOpts.value ++ Seq("-Xmx1024M", "-server", "-Dplugin.version=" + version.value)
},

scriptedBufferLog := false,

resolvers ++= Seq(
Resolver.sbtPluginRepo("snapshots"),
Resolver.sonatypeRepo("snapshots")
),
resolvers ++= Resolver.sonatypeOssRepos("snapshots"),

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

Expand Down
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.6.2
sbt.version=1.7.2
6 changes: 1 addition & 5 deletions project/plugin.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
// Manages publishing.
addSbtPlugin("org.foundweekends" % "sbt-bintray" % "0.5.6")

// Versions the build.
addSbtPlugin("com.dwijnand" % "sbt-dynver" % "4.1.1")
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will still be used to version, sbt-ci-release includes and uses it.

addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.10")