From fca2b4e3042b1b7bf3e6b56b1095395c2803b3b0 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 23 Apr 2021 21:17:01 -0400 Subject: [PATCH 01/11] remove travis config --- .travis.yml | 48 ------------------------------------------------ 1 file changed, 48 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b76b1e3..0000000 --- a/.travis.yml +++ /dev/null @@ -1,48 +0,0 @@ -sudo: required -language: bash - -# exclude tags. -branches: - except: - - /^\d+.\d+.\d+$/ - -services: - - docker - -cache: - directories: - - "$HOME/.ivy2" - - "$HOME/.sbt" - -env: - global: - - CI_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER - - CLOUDSDK_CORE_DISABLE_PROMPTS=1 - -before_install: - - # Install envtpl for easy templating. - - sudo pip install envtpl - - - mkdir "$HOME/.bintray" - - envtpl < .credentials > "$HOME/.bintray/.credentials" - - # Use SNAPSHOT for all other than master builds. - - export CI_BUILD_NUMBER=$(if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then echo $CI_BUILD_NUMBER; else echo "${TRAVIS_BUILD_NUMBER}-SNAPSHOT"; fi) - - echo "CI_BUILD_NUMBER=${CI_BUILD_NUMBER}" - -script: - - make $(if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then echo publish; else echo package; fi) - -after_success: - - git config --global user.email "builds@travis-ci.com" - - git config --global user.name "Travis CI" - - export GIT_TAG=$(make version) - - echo "GIT_TAG=$GIT_TAG" - - > - [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && - git tag $GIT_TAG -f -a -m "Version $GIT_TAG built by Travis CI - https://travis-ci.org/$TRAVIS_REPO_SLUG/builds/$TRAVIS_JOB_ID" - || true - - > - [ "${TRAVIS_PULL_REQUEST}" = "false" ] && [ "${TRAVIS_BRANCH}" = "master" ] && - git push -q https://$GITHUB_USER:$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG --tags || true From 8170a9d09ce4d587d5831d8d02fc53e7ef61a782 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Fri, 23 Apr 2021 21:17:13 -0400 Subject: [PATCH 02/11] add gha workflow for build --- .github/workflows/main.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..183f537 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,21 @@ +name: main + +on: + push: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: olafurpg/setup-scala@v10 + with: + # use Java 8 + java-version: adopt@1.8 + - name: Compile + run: sbt compile + env: + # NB: I'd like not to put this here but the sbt gh package plugin + # will error out if its not resolved + GITHUB_TOKEN: ${{ secrets.GH_PACKAGES_GITHUB_TOKEN }} From bb8c3e570e71d19fd382184e54f92925058d4365 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 13:20:36 -0400 Subject: [PATCH 03/11] use latest sbt 1.5.1 --- project/build.properties | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/build.properties b/project/build.properties index 133a8f1..f0be67b 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=0.13.17 +sbt.version=1.5.1 From 6ac8dbb3a8d5905cb1a06b648058ac91ae2c1fd2 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 13:20:47 -0400 Subject: [PATCH 04/11] add sbt-github-packages plugin --- project/plugins.sbt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/plugins.sbt b/project/plugins.sbt index 9a9591b..4187cd4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -8,3 +8,5 @@ addSbtPlugin("com.meetup" % "sbt-plugins" % "0.3.38") addSbtPlugin("com.eed3si9n" % "sbt-dirty-money" % "0.2.0") addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") + +addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2") From 7ae1d00c76bded6e72bfe10a00d6c5ecb178d478 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 13:22:40 -0400 Subject: [PATCH 05/11] update lic year --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index 11f4c85..5d63538 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2016 Meetup, Inc. +Copyright (c) 2021 Meetup, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal From f2081425d89afbc98190475804db38da2d436047 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 17:35:23 -0400 Subject: [PATCH 06/11] update builder image --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index ccce5ab..1fa3c9d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -BUILDER_TAG = "meetup/sbt-builder:0.1.5" +BUILDER_TAG = "ghcr.io/meetup/sbt-builder:0.3.17" CI_BUILD_NUMBER ?= $(USER)-SNAPSHOT CI_IVY_CACHE ?= $(HOME)/.ivy2 From 23ccbf63668de24ed67af2e3fee2d2221c88e90d Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 17:36:09 -0400 Subject: [PATCH 07/11] update trigger path --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 183f537..4932fa1 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,8 +1,14 @@ name: main on: + # Trigger the workflow on push or pull request, + # but only for the main branch push: + branches: + - master pull_request: + branches: + - master jobs: build: From 4a937288959722dd49e4401f01e457c5136129f3 Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 17:45:22 -0400 Subject: [PATCH 08/11] swagger-codegen 2.4.19 Signed-off-by: Rui Chen --- build.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 1d40c30..7986f76 100644 --- a/build.sbt +++ b/build.sbt @@ -10,7 +10,7 @@ sbtPlugin := true scalaVersion := appConfiguration.value.provider.scalaProvider.version -libraryDependencies += "io.swagger" % "swagger-codegen" % "2.3.1" +libraryDependencies += "io.swagger" % "swagger-codegen" % "2.4.19" licenses += ("MIT", url("http://opensource.org/licenses/MIT")) From ac9fc9fd3f957a4b99bb61b9eb36a4eb943766fc Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 17:47:12 -0400 Subject: [PATCH 09/11] remove sbt-dirty-money and bintray-sbt Signed-off-by: Rui Chen --- project/plugins.sbt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index 4187cd4..231783c 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -5,8 +5,4 @@ resolvers += Resolver.url( addSbtPlugin("com.meetup" % "sbt-plugins" % "0.3.38") -addSbtPlugin("com.eed3si9n" % "sbt-dirty-money" % "0.2.0") - -addSbtPlugin("me.lessis" % "bintray-sbt" % "0.3.0") - addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2") From bb3a23098c195ca99f0db8e91c2233e5bb053cbb Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Mon, 26 Apr 2021 17:49:48 -0400 Subject: [PATCH 10/11] migrate off bintray Signed-off-by: Rui Chen --- build.sbt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 7986f76..424511a 100644 --- a/build.sbt +++ b/build.sbt @@ -14,4 +14,6 @@ libraryDependencies += "io.swagger" % "swagger-codegen" % "2.4.19" licenses += ("MIT", url("http://opensource.org/licenses/MIT")) -bintrayOrganization in ThisBuild := Some("meetup") +ThisBuild / githubOwner := "meetup" +ThisBuild / githubRepository := "meetup-oss" +ThisBuild / githubTokenSource := TokenSource.Environment("GITHUB_TOKEN") From 3551a71d973546a30c486902811576c865affb7d Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Sun, 2 May 2021 15:45:27 -0400 Subject: [PATCH 11/11] rename creds file remove CommonSettingsPlugin use sbt 0.13 add publish.sbt include sbt-pgp for publishing to sonatype add sonatype plugin update plugins use sonatype.sbt instead of publish.sbt GitHubHosting instead of GithubHosting ``` [info] Loading project definition from /Users/rchen/mup/sbt-openapi/project /Users/rchen/mup/sbt-openapi/soantype.sbt:6: warning: value GithubHosting in object Sonatype is deprecated: Use GitHubHosting (capital H) instead sonatypeProjectHosting := Some(GithubHosting(user="meetup", repository="sbt-openapi", email="engineering@meetup.com")) ^ ``` update plugins gitignore sbt.json react password --- .credentials | 4 ---- .gitignore | 4 +++- .sonatype_credentials | 4 ++++ build.sbt | 11 ++++------- project/build.properties | 2 +- project/plugins.sbt | 10 ++-------- soantype.sbt | 12 ++++++++++++ 7 files changed, 26 insertions(+), 21 deletions(-) delete mode 100644 .credentials create mode 100644 .sonatype_credentials create mode 100644 soantype.sbt diff --git a/.credentials b/.credentials deleted file mode 100644 index 6bcc839..0000000 --- a/.credentials +++ /dev/null @@ -1,4 +0,0 @@ -realm = Bintray API Realm -host = api.bintray.com -user = {{ BINTRAY_USER }} -password = {{ BINTRAY_PASS }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index cff77b4..efe4d70 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,6 @@ project/plugins/project/ *.sublime-project *.sublime-workspace -*~ \ No newline at end of file +*~ + +sbt.json diff --git a/.sonatype_credentials b/.sonatype_credentials new file mode 100644 index 0000000..00d8f14 --- /dev/null +++ b/.sonatype_credentials @@ -0,0 +1,4 @@ +realm=Sonatype Nexus Repository Manager +host=oss.sonatype.org +user=rui-meetup +password= diff --git a/build.sbt b/build.sbt index 424511a..f180f9b 100644 --- a/build.sbt +++ b/build.sbt @@ -1,8 +1,5 @@ -enablePlugins(CommonSettingsPlugin) - -name := "sbt-openapi" - organization := "com.meetup" +name := "sbt-openapi" description := "Plugin for generating managed code from OpenAPI specifications" @@ -14,6 +11,6 @@ libraryDependencies += "io.swagger" % "swagger-codegen" % "2.4.19" licenses += ("MIT", url("http://opensource.org/licenses/MIT")) -ThisBuild / githubOwner := "meetup" -ThisBuild / githubRepository := "meetup-oss" -ThisBuild / githubTokenSource := TokenSource.Environment("GITHUB_TOKEN") + +// Add the default sonatype repository setting +publishTo := sonatypePublishTo.value diff --git a/project/build.properties b/project/build.properties index f0be67b..8e682c5 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.5.1 +sbt.version=0.13.18 diff --git a/project/plugins.sbt b/project/plugins.sbt index 231783c..1c70137 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,8 +1,2 @@ -resolvers += Resolver.url( - "meetup-sbt-plugins", - new java.net.URL("https://dl.bintray.com/meetup/sbt-plugins/") -)(Resolver.ivyStylePatterns) - -addSbtPlugin("com.meetup" % "sbt-plugins" % "0.3.38") - -addSbtPlugin("com.codecommit" % "sbt-github-packages" % "0.5.2") +addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3") +addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.0") diff --git a/soantype.sbt b/soantype.sbt new file mode 100644 index 0000000..e09d431 --- /dev/null +++ b/soantype.sbt @@ -0,0 +1,12 @@ +import xerial.sbt.Sonatype._ + +publishMavenStyle := true + +sonatypeProfileName := "com.meetup" +sonatypeProjectHosting := Some(GitHubHosting(user="meetup", repository="sbt-openapi", email="engineering@meetup.com")) +developers := List( + Developer(id = "meetup", name = "Meetup Developer", email = "engineering@meetup.com", url = url("https://www.meetup.com")) +) +licenses := Seq("MIT" -> url("https://mit-license.org/")) + +publishTo := sonatypePublishTo.value