updated formates #48
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
name: ContentBox-CLI CI | |
# Only on Development we build snapshots | |
on: | |
push: | |
branches: | |
- development | |
- master | |
jobs: | |
############################################# | |
# Build Module | |
############################################# | |
build: | |
name: Build & Publish | |
runs-on: ubuntu-20.04 | |
env: | |
MODULE_ID: contentbox-cli | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@v3 | |
- name: Setup Java | |
uses: actions/setup-java@v3 | |
with: | |
distribution: "adopt" | |
java-version: "11" | |
- name: Setup CommandBox | |
uses: Ortus-Solutions/[email protected] | |
with: | |
forgeboxAPIKey: ${{ secrets.FORGEBOX_API_TOKEN }} | |
- name: Install Build Dependencies | |
run: | | |
box install | |
- name: Setup Environment 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 | |
- name: Build ${{ env.MODULE_ID }} for ${{ env.BRANCH }} v${{ env.VERSION }} | |
run: | | |
# Create the CommandBox modules folder, for some reason it is not created | |
mkdir -p ~/.CommandBox/cfml/modules | |
# Link up the module so we can do testing! | |
box link --force | |
# Build Project | |
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }} | |
- name: Failure Logs | |
if: failure() | |
run: cat `box system-log` | |
- name: Upload Build Artifacts | |
if: success() | |
uses: actions/upload-artifact@v3 | |
with: | |
name: Module Artifacts | |
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/commandbox-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: "commandbox-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 | |
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 }} |