Skip to content

ci: enable workflow dispatch for triggering boxlang tests and use ubu… #63

ci: enable workflow dispatch for triggering boxlang tests and use ubu…

ci: enable workflow dispatch for triggering boxlang tests and use ubu… #63

Workflow file for this run

name: cbMeilisearch CI
# Only on Development we build snapshots
on:
push:
branches:
- development
- master
workflow_dispatch:
env:
MODULE_ID: cbmeilisearch
jobs:
#############################################
# Tests First baby! We fail, no build :(
#############################################
tests:
uses: ./.github/workflows/tests.yml
secrets:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
#############################################
# Build
#############################################
build:
name: Build & Publish
if: github.repository == 'coldbox-modules/cbmeilisearch'
needs: tests
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup Java
uses: actions/[email protected]
with:
distribution: "temurin"
java-version: "11"
- name: Cache CommandBox Dependencies
uses: actions/cache@v3
if: ${{ true }}
with:
path: ~/.CommandBox/artifacts
key: ${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
restore-keys: |
${{ runner.OS }}-commandbox-cache-${{ hashFiles( 'box.json' ) }}-${{ hashFiles( 'test-harness/box.json' ) }}
- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@main
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
- name: Setup Environment Variables For Build Process
id: current_version
run: |
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
box package set [email protected]@
# master or snapshot
echo "Github Ref is $GITHUB_REF"
echo "BRANCH=master" >> $GITHUB_ENV
if [ $GITHUB_REF == 'refs/heads/development' ]
then
echo "BRANCH=development" >> $GITHUB_ENV
fi
- name: Build ${{ env.MODULE_ID }}
run: |
box install commandbox-docbox
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
- name: Upload Build Artifacts
if: success()
uses: actions/[email protected]
with:
name: ${{ env.MODULE_ID }}
path: |
.artifacts/**/*
# - name: Upload Binaries to S3
# uses: jakejarvis/s3-sync-action@master
# with:
# args: --acl public-read
# env:
# AWS_S3_BUCKET: "downloads.ortussolutions.com"
# AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
# AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
# SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
# DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
- 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: ".tmp/apidocs"
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
- name: Publish To ForgeBox
run: |
cd .tmp/${{ env.MODULE_ID }}
cat box.json
box forgebox publish
- name: Inform Slack of Build
if: ${{ always() }}
uses: rtCamp/action-slack-notify@v2
env:
# SLACK_CHANNEL: coding
SLACK_COLOR: ${{ job.status }} # or a specific color like 'green' or '#ff00ff'
SLACK_ICON_EMOJI: ":bell:"
SLACK_MESSAGE: '${{ env.MODULE_ID }} Built with ${{ job.status }}!'
SLACK_TITLE: "${{ env.MODULE_ID }} Build"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
- name: Show Server Log On Failures
if: ${{ failure() }}
run: |
box server log serverConfigFile="server-${{ matrix.cfengine }}.json"
- name: Upload Debug Logs To Artifacts
if: ${{ failure() }}
uses: actions/[email protected]
with:
name: Failure Debugging Info - ${{ matrix.cfengine }}
path: |
.engine/**/logs/*
.engine/**/WEB-INF/cfusion/logs/*