Skip to content

Commit

Permalink
Merge pull request #1 from ortus-boxlang/development
Browse files Browse the repository at this point in the history
Version bump
  • Loading branch information
lmajano authored Nov 25, 2024
2 parents 403ddf9 + 2529dc8 commit 52467cd
Show file tree
Hide file tree
Showing 7 changed files with 107 additions and 55 deletions.
58 changes: 29 additions & 29 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This workflow is used to build releases
# It can also be called by other workflows to reuse the release flow.
name: BoxLang PostgreSQL Release
name: Release

on:
# If you push to main this will trigger a stable release
Expand All @@ -18,12 +18,15 @@ on:
default: false
type: boolean

# Manual Trigger
workflow_dispatch:

env:
MODULE_ID: bx-mssql
SNAPSHOT: ${{ inputs.snapshot || false }}
MODULE_ID: ${{ github.event.repository.name }}
JDK: 21
GRADLE: 8.7
BUILD_ID: ${{ github.run_number }}
SNAPSHOT: ${{ inputs.snapshot || false }}

jobs:
#############################################
Expand Down Expand Up @@ -61,9 +64,16 @@ jobs:
id: current_version
run: |
# Read Version from gradle.properties
echo "VERSION=`grep '^version=' gradle.properties | cut -d'=' -f2`" >> $GITHUB_ENV
TMPVERSION=$(grep '^version=' gradle.properties | cut -d'=' -f2)
# Replace existing prerelease identifier with -snapshot or append -snapshot if none exists
# If we are on the development branch, we always append -snapshot
if [[ "${{ github.ref }}" == "refs/heads/development" ]]; then
TMPVERSION=$(echo $TMPVERSION | sed 's/-.*$//')-snapshot
fi
# Set the version in the environment
echo "VERSION=$TMPVERSION" >> $GITHUB_ENV
# Branche
# Branch
echo "Github Ref is $GITHUB_REF"
echo "BRANCH=main" >> $GITHUB_ENV
Expand All @@ -84,8 +94,8 @@ jobs:
run: |
npm install -g markdownlint-cli
markdownlint changelog.md --fix
./gradlew downloadBoxLang
./gradlew build -x test --stacktrace --console=plain
gradle downloadBoxLang
gradle build -x test --stacktrace --console=plain
- name: Commit Changelog [unreleased] with latest version
uses: EndBug/[email protected]
Expand All @@ -110,7 +120,6 @@ jobs:
with:
name: boxlang-build
path: |
build/reports/tests/**
changelog.md
Expand All @@ -125,21 +134,22 @@ jobs:
SOURCE_DIR: "build/distributions"
DEST_DIR: "ortussolutions/boxlang-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"

# - name: Upload API Docs to S3
# uses: jakejarvis/s3-sync-action@master
# with:
# args: --acl public-read
# env:
# AWS_S3_BUCKET: "apidocs.ortussolutions.com"
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
# SOURCE_DIR: "build-coldbox/apidocs"
# DEST_DIR: ""
- name: Upload API Docs to S3
uses: jakejarvis/s3-sync-action@master
with:
args: --acl public-read
env:
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
SOURCE_DIR: "build/docs/javadoc"
DEST_DIR: "boxlang-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"

- name: Publish to ForgeBox
run: |
cd build/module
box forgebox publish --force
cd $GITHUB_WORKSPACE
- name: Create Github Release
uses: taiki-e/[email protected]
Expand Down Expand Up @@ -180,14 +190,9 @@ jobs:
steps:
- name: Checkout Development Repository
uses: actions/checkout@v4
if: env.LTS == 'false'
with:
ref: development

- name: Checkout LTS Repository
uses: actions/checkout@v4
if: env.LTS == 'true'

- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
Expand All @@ -205,12 +210,7 @@ jobs:
- name: Bump Version
run: |
if [ $LTS == 'true' ]
then
gradle bumpPatchVersion --stacktrace --console=plain
else
gradle bumpMinorVersion --stacktrace --console=plain
fi
gradle bumpMinorVersion --stacktrace --console=plain
git pull
- name: Commit Version Bump
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: BoxLang PostgreSQL Snapshots
name: Snapshots

on:
push:
Expand All @@ -10,6 +10,10 @@ concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true

env:
MODULE_ID: ${{ github.event.repository.name }}
JDK_VERSION: 21

jobs:
#############################################
# Tests First baby! We fail, no build :(
Expand Down Expand Up @@ -39,15 +43,11 @@ jobs:
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: 21
java-version: ${{ env.JDK_VERSION }}

- name: Format Java Source
run: ./gradlew spotlessApply --stacktrace

# - name: Format BoxLang Source
# uses: Ortus-Solutions/[email protected]
# with:
# cmd: run-script format
run: |
./gradlew spotlessApply --stacktrace
- name: Commit Format Changes
uses: stefanzweifel/git-auto-commit-action@v5
Expand Down
25 changes: 21 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: BoxLang PostgreSQL Test Suites
name: Test Suites

# We are a reusable Workflow only
on:
Expand All @@ -7,9 +7,13 @@ on:
SLACK_WEBHOOK_URL:
required: false

env:
MODULE_ID: ${{ github.event.repository.name }}
GRADLE_VERSION: 8.7

jobs:
tests:
name: Tests
name: Tests ${{ github.event.repository.name }}
runs-on: ${{ matrix.os }}
env:
DB_USER: root
Expand Down Expand Up @@ -42,7 +46,7 @@ jobs:
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
with:
gradle-version: "8.7"
gradle-version: ${{ env.GRADLE_VERSION }}

# - name: Setup Database and Fixtures
# run: |
Expand Down Expand Up @@ -71,7 +75,8 @@ jobs:
- name: Test Module
run: |
gradle downloadBoxLang
gradle test --stacktrace --console=plain
# this is done in order to build the module structure before testing
gradle shadowJar test --stacktrace --console=plain
- name: Upload Test Results
if: always()
Expand All @@ -82,6 +87,18 @@ jobs:
**/build/reports/tests/**
**/build/test-results/**
- name: Inform Slack
if: ${{ failure() && github.ref == 'refs/heads/development' }}
uses: rtCamp/action-slack-notify@v2
env:
SLACK_CHANNEL: boxlang
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
SLACK_ICON_EMOJI: ":bell:"
SLACK_MESSAGE: "${{ env.MODULE_ID }} Tests FAILED! You broke the build! :("
SLACK_TITLE: "${{ env.MODULE_ID }} Build Failure"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}

publish-test-results:
name: Publish Test Results
runs-on: ubuntu-latest
Expand Down
49 changes: 37 additions & 12 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ plugins {
// For building shadow jars with jdk 17 ONLY
//id 'com.github.johnrengelman.shadow' version '8.1.1'
// For building shadow jars using JDK 21 +, they had to fork
id "io.github.goooler.shadow" version "8.1.7"
id "io.github.goooler.shadow" version "8.1.8"
// Download task
id "de.undercouch.download" version "5.6.0"
}
Expand All @@ -22,6 +22,12 @@ ext {
buildID = System.getenv( 'BUILD_ID' ) ?: '0'
branch = System.getenv( 'BRANCH' ) ?: 'development'
}
if ( branch == 'development' ) {
// If the branch is 'development', ensure the version ends with '-snapshot'
// This replaces any existing prerelease identifier with '-snapshot'
version = version.contains('-') ? version.replaceAll(/-.*/, '-snapshot') : "${version}-snapshot"
boxlangVersion = boxlangVersion.contains('-') ? boxlangVersion.replaceAll(/-.*/, '-snapshot') : "${boxlangVersion}-snapshot"
}

repositories {
mavenLocal()
Expand All @@ -32,12 +38,13 @@ dependencies {
// Until BoxLang is published to Maven Central
// Look for it in the local build directory
// You must run `./gradle build -x test` in the BoxLang project
compileOnly files( 'src/test/resources/libs/boxlang-1.0.0-all.jar' )
// https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc
compileOnly files( '../../boxlang/build/distributions/boxlang-' + boxlangVersion + '-all.jar' )
compileOnly files( 'src/test/resources/libs/boxlang-' + boxlangVersion + '-all.jar' )
implementation 'com.microsoft.sqlserver:mssql-jdbc:12.6.1.jre11'

// Testing Dependencies
testImplementation files( 'src/test/resources/libs/boxlang-1.0.0-all.jar' )
testImplementation files( '../../boxlang/build/distributions/boxlang-' + boxlangVersion + '-all.jar' )
testImplementation files( 'src/test/resources/libs/boxlang-' + boxlangVersion + '-all.jar' )
testImplementation "org.junit.jupiter:junit-jupiter:5.+"
testImplementation "org.mockito:mockito-core:5.+"
testImplementation "com.google.truth:truth:1.+"
Expand All @@ -59,6 +66,21 @@ compileTestJava{
// Make sure the service loaders are created before testing
dependsOn compileJava, serviceLoaderBuild
}
compileTestJava.finalizedBy( shadowJar )

/**
* Clean up
*/
clean {
doLast{
var userDir = file( "${System.getProperty('user.home')}/.boxlang/classes" )
if ( userDir.exists() ) {
userDir.deleteDir()
println "+ Cleared user home classes " + userDir.toString()
}
println "+ Clean finalized!"
}
}

javadoc {
// To avoid our own doclet issues
Expand All @@ -85,12 +107,12 @@ javadoc.finalizedBy( zipJavadocs )
* This generates the META-INF/services files for the ServiceLoader as part of the `build` task
*/
serviceLoader {
serviceInterface 'ortus.boxlang.runtime.jdbc.drivers.IJDBCDriver'
// serviceInterface 'ortus.boxlang.runtime.bifs.BIF'
// serviceInterface 'ortus.boxlang.runtime.components.Component'
// serviceInterface 'ortus.boxlang.runtime.async.tasks.IScheduler'
// serviceInterface 'ortus.boxlang.runtime.cache.providers.ICacheProvider'
// serviceInterface 'ortus.boxlang.runtime.events.IInterceptor'
serviceInterface 'ortus.boxlang.runtime.jdbc.drivers.IJDBCDriver'
serviceInterface 'ortus.boxlang.runtime.bifs.BIF'
serviceInterface 'ortus.boxlang.runtime.components.Component'
serviceInterface 'ortus.boxlang.runtime.async.tasks.IScheduler'
serviceInterface 'ortus.boxlang.runtime.cache.providers.ICacheProvider'
serviceInterface 'ortus.boxlang.runtime.events.IInterceptor'
}

jar {
Expand Down Expand Up @@ -134,7 +156,8 @@ task createModuleStructure(type: Copy) {
// Token Replacements Go Here
filter{ line -> line.replaceAll( '@build.version@', project.version ) }
if( project.branch == "development" ){
filter{ line -> line.replaceAll( '\\[email protected]@', '-SNAPSHOT' ) }
// We already add -snapshot to the project.version variable.
filter{ line -> line.replaceAll( '\\[email protected]@', '' ) }
} else {
filter{ line -> line.replaceAll( '@build.number@', project.buildID ) }
}
Expand All @@ -146,7 +169,8 @@ task createModuleStructure(type: Copy) {
// Token Replacements Go Here
filter{ line -> line.replaceAll( '@build.version@', project.version ) }
if( project.branch == "development" ){
filter{ line -> line.replaceAll( '\\[email protected]@', '-SNAPSHOT' ) }
// We already add -snapshot to the project.version variable.
filter{ line -> line.replaceAll( '\\[email protected]@', '' ) }
} else {
filter{ line -> line.replaceAll( '@build.number@', project.buildID ) }
}
Expand All @@ -173,6 +197,7 @@ test {
showStandardStreams = true
}
}

/**
* TEMPORARY until we publish to maven
* Task to download the latest jar from https://ortus-temp.s3.amazonaws.com/jericho/libs/boxlang-1.0.0-all.jar
Expand Down
10 changes: 9 additions & 1 deletion changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]


### Fixed

- Added URI delimiter that was missing from URIs
- Github Actions Consolidation

## [1.0.0] - 2024-06-13

===

- First iteration of this module

[Unreleased]: https://github.com/ortus-boxlang/bx-mssql/compare/v1.0.0...HEAD

[1.0.0]: https://github.com/ortus-boxlang/bx-mssql/compare/154d0c931fe42b794f5e630bbe5c0099ebc09a7e...v1.0.0
[1.0.0]: https://github.com/ortus-boxlang/bx-mssql/compare/154d0c931fe42b794f5e630bbe5c0099ebc09a7e...v1.0.0
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Gradle Properties
version=1.0.0
version=1.1.0
group=com.ortussolutions
boxlangVersion=1.0.0
jdkVersion=21
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public class MicrosoftSQLDriver extends GenericJDBCDriver {
protected static final String DEFAULT_PORT = "1433";
protected static final String DEFAULT_HOST = "localhost";
protected static final String DEFAULT_DELIMITER = ";";
protected static final String DEFAULT_URI_DELIMITER = ";";
protected static final IStruct DEFAULT_HIKARI_PROPERTIES = Struct.of();
protected static final IStruct DEFAULT_CUSTOM_PARAMS = Struct.of(
"trustServerCertificate", "true"
Expand All @@ -49,6 +50,7 @@ public MicrosoftSQLDriver() {
this.type = DatabaseDriverType.MSSQL;
this.driverClassName = DEFAULT_CLASSNAME;
this.defaultDelimiter = DEFAULT_DELIMITER;
this.defaultURIDelimiter = DEFAULT_URI_DELIMITER;
this.defaultCustomParams = DEFAULT_CUSTOM_PARAMS;
this.defaultProperties = DEFAULT_HIKARI_PROPERTIES;
}
Expand Down

0 comments on commit 52467cd

Please sign in to comment.