generated from ortus-boxlang/boxlang-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from ortus-boxlang/development
Version bump
- Loading branch information
Showing
12 changed files
with
276 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 Apache Derby Release | ||
name: Release | ||
|
||
on: | ||
# If you push to main this will trigger a stable release | ||
|
@@ -18,12 +18,15 @@ on: | |
default: false | ||
type: boolean | ||
|
||
# Manual Trigger | ||
workflow_dispatch: | ||
|
||
env: | ||
MODULE_ID: bx-derby | ||
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: | ||
############################################# | ||
|
@@ -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 | ||
|
@@ -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] | ||
|
@@ -110,8 +120,6 @@ jobs: | |
with: | ||
name: boxlang-build | ||
path: | | ||
build/distributions/** | ||
build/libs/** | ||
build/reports/tests/** | ||
changelog.md | ||
|
@@ -126,23 +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: Publish to Maven Central | ||
# run: | | ||
- 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] | ||
|
@@ -155,19 +162,6 @@ jobs: | |
token: ${{ secrets.GITHUB_TOKEN }} | ||
ref: refs/tags/v${{ env.VERSION }} | ||
|
||
- name: Upload Release Asset | ||
uses: sekwah41/upload-release-assets@v1 | ||
if: env.SNAPSHOT == 'false' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_name: boxlang-${{ env.VERSION }}.zip | ||
asset_content_type: application/zip | ||
asset_path: | | ||
build/distributions/** | ||
changelog.md | ||
- name: Inform Slack | ||
if: ${{ always() }} | ||
uses: rtCamp/action-slack-notify@v2 | ||
|
@@ -196,13 +190,13 @@ 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: | ||
gradle-version: ${{ env.GRADLE }} | ||
|
||
- name: Download build artifacts | ||
uses: actions/download-artifact@v4 | ||
|
@@ -216,12 +210,7 @@ jobs: | |
- name: Bump Version | ||
run: | | ||
if [ $LTS == 'true' ] | ||
then | ||
./gradlew bumpPatchVersion --stacktrace --console=plain | ||
else | ||
./gradlew bumpMinorVersion --stacktrace --console=plain | ||
fi | ||
gradle bumpMinorVersion --stacktrace --console=plain | ||
git pull | ||
- name: Commit Version Bump | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: BoxLang Apache Derby Snapshots | ||
name: Snapshots | ||
|
||
on: | ||
push: | ||
|
@@ -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 :( | ||
|
@@ -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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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" | ||
} | ||
|
@@ -22,6 +22,19 @@ 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" | ||
} | ||
|
||
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() | ||
|
@@ -32,13 +45,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-websupport-1.0.0.jar' ) | ||
compileOnly files( 'src/test/resources/libs/boxlang-1.0.0-all.jar' ) | ||
implementation 'org.apache.derby:derby:10.16.1.1' | ||
compileOnly files( '../../boxlang/build/distributions/boxlang-' + boxlangVersion + '-all.jar' ) | ||
compileOnly files( 'src/test/resources/libs/boxlang-' + boxlangVersion + '-all.jar' ) | ||
implementation 'org.apache.derby:derby:10.17.1.0' | ||
|
||
// Testing Dependencies | ||
// testImplementation files( 'src/test/resources/libs/boxlang-websupport-1.0.0.jar' ) | ||
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.+" | ||
|
@@ -62,6 +75,20 @@ compileTestJava{ | |
} | ||
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 | ||
options.addBooleanOption( "Xdoclint:none", true ) | ||
|
@@ -87,12 +114,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 { | ||
|
@@ -136,7 +163,7 @@ 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' ) } | ||
filter{ line -> line.replaceAll( '\\[email protected]@', '' ) } | ||
} else { | ||
filter{ line -> line.replaceAll( '@build.number@', project.buildID ) } | ||
} | ||
|
@@ -148,7 +175,7 @@ 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' ) } | ||
filter{ line -> line.replaceAll( '\\[email protected]@', '' ) } | ||
} else { | ||
filter{ line -> line.replaceAll( '@build.number@', project.buildID ) } | ||
} | ||
|
@@ -185,13 +212,10 @@ task downloadBoxLang( type: Download ) { | |
doFirst { | ||
file( "src/test/resources/libs" ).mkdirs() | ||
} | ||
// Configure the URLs of the files to download | ||
src([ | ||
"https://downloads.ortussolutions.com/ortussolutions/boxlang/${boxlangVersion}/boxlang-${boxlangVersion}-all.jar"//, | ||
// "https://downloads.ortussolutions.com/ortussolutions/boxlang-runtimes/boxlang-web-support/${boxlangVersion}/boxlang-web-support-${boxlangVersion}.jar" | ||
]) | ||
// Specify the destination directories for the downloaded files | ||
dest "src/test/resources/libs/" | ||
// Configure the URL of the file to download | ||
src "https://downloads.ortussolutions.com/ortussolutions/boxlang/${boxlangVersion}/boxlang-${boxlangVersion}-all.jar" | ||
// Specify the destination directory for the downloaded file | ||
dest "src/test/resources/libs/boxlang-${boxlangVersion}-all.jar" | ||
overwrite true | ||
onlyIfModified false | ||
} | ||
|
@@ -202,7 +226,7 @@ task downloadBoxLang( type: Download ) { | |
*/ | ||
project.ext.bumpVersion = { boolean major = false, boolean minor = false, boolean patch = false -> | ||
|
||
def propertiesFile = file( '../gradle.properties' ); | ||
def propertiesFile = file( './gradle.properties' ); | ||
def properties = new Properties(); | ||
|
||
properties.load( propertiesFile.newDataInputStream() ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.