Skip to content

update changelog (I f0orgot #3

update changelog (I f0orgot

update changelog (I f0orgot #3

Workflow file for this run

# This workflow is used to build releases
# It can also be called by other workflows to reuse the release flow.
name: ContentBox Release
on:
# If you push to master|main this will trigger a stable release
push:
branches:
- master
- main
# Reusable workflow : Usually called by a `snapshot` workflow
workflow_call:
inputs:
snapshot:
description: 'Is this a snapshot build?'
required: false
default: false
type: boolean
# Manual Trigger for LTS Releases
workflow_dispatch:
inputs:
lts:
description: 'The LTS marker'
required: false
default: true
type: boolean
env:
SNAPSHOT: ${{ inputs.snapshot || false }}
LTS: ${{ inputs.lts || false }}
jobs:
#############################################
# Build Snapshot or Final Release
#############################################
build:
name: Build & Publish Release
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: "temurin"
java-version: "11"
- name: Setup CommandBox
uses: Ortus-Solutions/[email protected]
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_API_TOKEN }}
- name: Install CFML Dependencies
run: |
box install --production
box install commandbox-docbox
cd modules/contentbox && box install --production
# Focal ships with node 16.x so we need to update to 18
- name: Install Node 18
uses: actions/setup-node@v4
with:
node-version: 18
- name: Compile Release Assets
run: |
node -v
npm -v
npm install && npm run prod
cd modules/contentbox/themes/default
npm install && npm run prod
cd $GITHUB_WORKSPACE
rm -rf node_modules
rm -rf modules/contentbox/themes/default/node_modules
- 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]@[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
# Env
touch .env
printf "ENVIRONMENT=development\n" >> .env
printf "DB_HOST=127.0.0.1\n" >> .env
printf "DB_DATABASE=contentbox\n" >> .env
printf "DB_DRIVER=MySQL\n" >> .env
printf "DB_USER=${{ env.DB_USER }}\n" >> .env
printf "DB_PASSWORD=${{ env.DB_PASSWORD }}\n" >> .env
printf "DB_CLASS=com.mysql.cj.jdbc.Driver\n" >> .env
printf "DB_BUNDLEVERSION=8.0.24\n" >> .env
printf "DB_BUNDLENAME=com.mysql.cj\n" >> .env
printf "DB_CONNECTIONSTRING=jdbc:mysql://127.0.0.1:3306/contentbox?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=UTC&useLegacyDatetimeCode=true\n" >> .env
- name: Download Test Artifacts
uses: actions/download-artifact@v2
if: env.SNAPSHOT == 'true'
with:
path: tests/results
- name: Start Docs Server
if: env.SNAPSHOT == 'false'
run: |
box server start serverConfigFile="[email protected]" openBrowser=false saveSettings=false
- name: Build API Docs
run: |
# Normalize swagger doc results if they exist
if test -f tests/results/contentbox-test-results-lucee@5/contentbox-swagger.json; then
cp -v tests/results/contentbox-test-results-lucee@5/contentbox-swagger.json tests/results/
else
echo "File tests/results/contentbox-test-results-lucee@5/contentbox-swagger.json does not exist"
fi
# Run Docs Build
box run-script build:allDocs
- name: Update changelog [unreleased] with latest version
uses: thomaseizinger/[email protected]
if: env.SNAPSHOT == 'false'
with:
changelogPath: ./changelog.md
tag: v${{ env.VERSION }}
- name: Build ContentBox Variants for ${{ env.BRANCH }} v${{ env.VERSION }}
run: |
ant -Dcontentbox.version=${{ env.VERSION }} -Dbuild.number=${{ github.run_number }} -Dbuild.branch=${{ env.BRANCH }} -f build/build.xml
cat build/build-contentbox/module/box.json
- name: List Variants
run: ls -R
working-directory: build/build-contentbox
- name: Commit Changelog [unreleased] with latest version
uses: EndBug/[email protected]
if: env.SNAPSHOT == 'false'
with:
author_name: Github Actions
author_email: [email protected]
message: 'Finalized changelog for v${{ env.VERSION }}'
add: changelog.md
- name: Tag Version
uses: rickstaa/[email protected]
if: env.SNAPSHOT == 'false'
with:
tag: "v${{ env.VERSION }}"
force_push_tag: true
message: "Latest Release v${{ env.VERSION }}"
- name: Upload Build Artifacts
if: success()
uses: actions/upload-artifact@v3
with:
name: contentbox-variants
path: |
artifacts/**/*
changelog.md
- 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"
DEST_DIR: "ortussolutions"
- 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/build-contentbox/apidocs"
DEST_DIR: "contentbox/${{ env.VERSION }}"
- name: Publish
run: |
ROOT_DIR=`pwd`
cd $ROOT_DIR/build/build-contentbox/module && box forgebox publish
cd $ROOT_DIR/build/build-contentbox/site && box forgebox publish
cd $ROOT_DIR/build/build-contentbox/installer && box forgebox publish
cd $ROOT_DIR/build/build-contentbox/installer-module && box forgebox publish
- name: Create Github Release
uses: taiki-e/[email protected]
continue-on-error: true
if: env.SNAPSHOT == 'false'
with:
title: ${{ env.VERSION }}
changelog: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
ref: refs/tags/v${{ env.VERSION }}
- name: Inform Slack
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: 'ContentBox Built with ${{ job.status }}!'
SLACK_TITLE: "ContentBox Build"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
##########################################################################################
# Prep Next Release
##########################################################################################
prep_next_release:
name: Prep Next Release
if: github.ref != 'refs/heads/development'
runs-on: ubuntu-20.04
needs: [ build ]
steps:
- name: Checkout Development Repository
uses: actions/checkout@v3
if: env.LTS == 'false'
with:
ref: development
- name: Checkout LTS Repository
uses: actions/checkout@v3
if: env.LTS == 'true'
- name: Setup CommandBox
uses: Ortus-Solutions/[email protected]
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: contentbox-variants
path: .tmp
- name: Copy Changelog
run: |
cp .tmp/changelog.md changelog.md
- name: Bump Version
run: |
if [ $LTS == 'true' ]
then
box bump --patch --!TagVersion
else
box bump --minor --!TagVersion
fi
git pull
- name: Commit Version Bump
uses: EndBug/[email protected]
with:
author_name: Github Actions
author_email: [email protected]
message: 'Version bump'
add: |
box.json
changelog.md