Skip to content

Commit

Permalink
Merge pull request #67 from MongoCamp/2.6.5
Browse files Browse the repository at this point in the history
2.6.5
  • Loading branch information
sfxcode authored Oct 21, 2023
2 parents 6f94bd2 + cfe910b commit 5d55884
Show file tree
Hide file tree
Showing 12 changed files with 1,969 additions and 69 deletions.
30 changes: 13 additions & 17 deletions .github/workflows/main_test_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
mongodb-version: ['4.4', '5.0', '6.0']
mongodb-version: ['4.4', '5.0', '6.0', '7.0']
java: [ '11', '17' ]
steps:
- uses: actions/[email protected]
Expand Down Expand Up @@ -41,29 +41,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Git Checkout
uses: actions/checkout@v3.0.0
uses: actions/checkout@v4.1.0
with:
fetch-depth: 0
- name: Install pnpm
uses: pnpm/[email protected]
with:
version: 6.0.2
- name: install conventional-changelog-cli
run: pnpm install -g conventional-changelog-cli
- name: install conventional-github-release
run: pnpm install -g conventional-github-releaser
- name: Set up JDK 17
uses: actions/[email protected]
with:
distribution: 'corretto'
java-version: '17'
token: ${{ secrets.GH_ADMIN_TOKEN }}
- id: install-secret-key
name: Install gpg secret key
run: cat <(echo -e "${{ secrets.PGP_SECRET_KEY }}") | gpg --batch --import
- name: Set up JDK
uses: coursier/setup-action@v1
with:
jvm: graalvm-java17:22.3.3
apps: sbt scala scalac
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Release
env:
CONVENTIONAL_GITHUB_RELEASER_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
GITHUB_USER: ${{ secrets.GH_USERNAME }}
GITHUB_USER: ${{ github.actor }}
GITHUB_TOKEN: ${{ secrets.GH_ADMIN_TOKEN }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/other_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
mongodb-version: ['4.4', '5.0', '6.0']
mongodb-version: ['4.4', '5.0', '6.0', '7.0']
java: [ '11', '17' ]
steps:
- uses: actions/checkout@v2
Expand Down
36 changes: 36 additions & 0 deletions .github/workflows/release_and_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Github Release and Changelog

on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+

jobs:
update-change-infos:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ github.ref_name }}

- name: Create Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
draft: false
makeLatest: true
name: ${{ github.ref_name }}
body: ${{ steps.changelog.outputs.changes }}
token: ${{ github.token }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: 'docs: update CHANGELOG.md for ${{ github.ref_name }}'
file_pattern: CHANGELOG.md
18 changes: 9 additions & 9 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ developers := List(

licenses += ("Apache-2.0", url("https://www.apache.org/licenses/LICENSE-2.0.html"))

crossScalaVersions := Seq("2.13.11", "2.12.17")
crossScalaVersions := Seq("2.13.12", "2.12.17")

scalaVersion := crossScalaVersions.value.head

Expand All @@ -61,27 +61,27 @@ resolvers += "Sonatype OSS Snapshots".at("https://oss.sonatype.org/content/repos

// Test

libraryDependencies += "org.specs2" %% "specs2-core" % "4.20.0" % Test
libraryDependencies += "org.specs2" %% "specs2-core" % "4.20.2" % Test

libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.4.8" % Test
libraryDependencies += "ch.qos.logback" % "logback-classic" % "1.4.11" % Test

libraryDependencies += "joda-time" % "joda-time" % "2.12.5" % Test

val circeVersion = "0.14.5"
val circeVersion = "0.14.6"

libraryDependencies ++= Seq(
"io.circe" %% "circe-core",
"io.circe" %% "circe-generic",
"io.circe" %% "circe-parser"
).map(_ % circeVersion % Test)

libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "4.10.2"
libraryDependencies += "org.mongodb.scala" %% "mongo-scala-driver" % "4.11.0"

libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.10.3" % Provided
libraryDependencies += "org.xerial.snappy" % "snappy-java" % "1.1.10.5" % Provided

libraryDependencies += "com.github.luben" % "zstd-jni" % "1.5.5-5" % Provided
libraryDependencies += "com.github.luben" % "zstd-jni" % "1.5.5-6" % Provided

libraryDependencies += "org.apache.lucene" % "lucene-queryparser" % "9.7.0"
libraryDependencies += "org.apache.lucene" % "lucene-queryparser" % "9.8.0"

val MongoJavaServerVersion = "1.44.0"

Expand All @@ -91,7 +91,7 @@ libraryDependencies += "de.bwaldvogel" % "mongo-java-server-h2-backend" % MongoJ

libraryDependencies += "com.github.pathikrit" %% "better-files" % "3.9.2"

libraryDependencies += "com.typesafe" % "config" % "1.4.2"
libraryDependencies += "com.typesafe" % "config" % "1.4.3"

libraryDependencies += "com.typesafe.scala-logging" %% "scala-logging" % "3.9.5"

Expand Down
49 changes: 11 additions & 38 deletions build_release.sbt
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
import com.vdurmont.semver4j.Semver
import dev.quadstingray.sbt.json.JsonFile
import sbtrelease.ReleasePlugin.autoImport.ReleaseKeys.versions
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations._
import sbtrelease.ReleasePlugin.autoImport.ReleaseTransformations.*
import sbtrelease.ReleasePlugin.runtimeVersion
import dev.quadstingray.sbt.json.JsonFile

import scala.sys.process._
import scala.sys.process.*

val gitAddAllTask = ReleaseStep(action = st => {
"git add .".!
st
})

val generateChangeLog = ReleaseStep(action = st => {
st.log.warn("start generating changelog")
val response = "conventional-changelog -p conventionalcommits -i CHANGELOG.md -s -r 0 -n ./changelog/config.js".!!
st.log.warn("Output of conventional-changelog" + response)
st
})

val addGithubRelease = ReleaseStep(action = st => {
st.log.warn("start github release process")
var response = ""
try response = "conventional-github-releaser -p conventionalcommits -r 3 -n ./changelog/config.js".!!
catch {
case e: Exception =>
st.log.warn("Catched Exception on generate release notes: " + e.getMessage)
}
st.log.warn("Output of conventional-github-releaser: " + response)
st
})

val setToMyNextVersion = ReleaseStep(action = st => {
setMyVersion(st.get(versions).get._2, st)
st
Expand All @@ -51,17 +33,12 @@ releaseNextCommitMessage := s"ci: update version after release"
releaseCommitMessage := s"ci: prepare release of version ${runtimeVersion.value}"

commands += Command.command("ci-release")((state: State) => {
val lowerCaseVersion = version.value.toLowerCase
if (
(lowerCaseVersion.contains("snapshot") ||
lowerCaseVersion.contains("beta") ||
lowerCaseVersion.contains("rc") ||
lowerCaseVersion.contains("m"))
) {
state
val semVersion = new Semver(version.value)
if (semVersion.isStable) {
Command.process("release with-defaults", state)
}
else {
Command.process("release with-defaults", state)
state
}
})

Expand All @@ -71,20 +48,16 @@ releaseProcess := {
inquireVersions,
runClean,
setToMyReleaseVersion,
generateChangeLog,
releaseStepCommand("scalafmt"),
gitAddAllTask,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("ci-deploy-docs"),
releaseStepCommand("sonatypeBundleRelease"),
releaseStepCommand("ci-deploy-docs"),
setToMyNextVersion,
releaseStepCommand("scalafmt"),
gitAddAllTask,
commitNextVersion,
pushChanges,
publishArtifacts,
addGithubRelease
pushChanges
)
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name" : "mongodb-driver",
"organization" : "dev.mongocamp",
"version" : "2.6.5.snapshot",
"version" : "2.6.5",
"author" : "[email protected]",
"license" : "Apache-2.0",
"repository" : {
Expand Down
1 change: 1 addition & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ addDependencyTreePlugin
// todo remove as soon as possible
dependencyOverrides += "org.scala-lang.modules" %% "scala-xml" % "1.2.0"

libraryDependencies += ("com.vdurmont" % "semver4j" % "3.1.0")
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Args = -H:ReflectionConfigurationResources=${.}/reflection-config.json \
-H:ResourceConfigurationResources=${.}/resource-config.json \
--initialize-at-build-time=org.slf4j.LoggerFactory,ch.qos.logback,dev.mongocamp.driver.mongodb.Converter,dev.mongocamp.driver.mongodb.BsonConverter \
--enable-url-protocols=https,http
Loading

0 comments on commit 5d55884

Please sign in to comment.