Skip to content

Commit

Permalink
build scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jclausen committed Jul 7, 2023
1 parent 48034af commit 57607e4
Show file tree
Hide file tree
Showing 6 changed files with 472 additions and 0 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.YML
@@ -0,0 +1 @@
patreon: ortussolutions
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
@@ -0,0 +1,90 @@
name: cbcommerce CI

# Only on Development we build snapshots
on:
push:
branches:
- development
- main

env:
MODULE_ID: contentbox-cbcommerce

jobs:
#############################################
# Build Module
#############################################
build:
name: Build & Publish
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3.2.0
with:
fetch-depth: 0

- name: Setup Java
uses: actions/setup-java@v3.9.0
with:
distribution: "temurin"
java-version: "11"

- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@v2.0.1
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 version=@build.version@+@build.number@
# main or snapshot
echo "Github Ref is $GITHUB_REF"
echo "BRANCH=main" >> $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/upload-artifact@v3.1.1
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/contentbox-modules/${{ env.MODULE_ID }}"

- 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 }}
30 changes: 30 additions & 0 deletions .gitignore
@@ -0,0 +1,30 @@
.vscode

.artifacts/**
.tmp/**
.env

test-harness/.engine/**
test-harness/.env
test-harness/coldbox/**
test-harness/docbox/**
test-harness/testbox/**
test-harness/logs/**
test-harness/modules/**

# CommandBox Modules
modules/**

# Development artifacts
changelog-latest.md
node_modules
includes/fonts
includes/css
includes/images
includes/js
includes/*.json
*-latest.md
# log files
logs/**
/nbproject/private/
nbproject/
29 changes: 29 additions & 0 deletions box.json
@@ -0,0 +1,29 @@
{
"name":"ContentBox cbCommerce Module",
"version":"1.0.0",
"author":"Ortus Solutions, Corp",
"location":"https://downloads.ortussolutions.com/ortussolutions/contentbox-modules/contentbox-cbcommerce/@build.version@/contentbox-cbcommerce-@build.version@+@build.number@.zip",
"homepage":"https://cbcommerce.ortusbooks.com",
"documentation":"https://cbcommerce.ortusbooks.com",
"repository":{
"type":"git",
"URL":"https://github.com/contentbox-modules/cbcommerce"
},
"bugs":"https://github.com/contentbox-modules/cbcommerce/issues",
"slug":"cbcommerce",
"shortDescription":"Contentbox integration module for cbCommerce",
"description":"Contentbox integration module for cbCommerce",
"type":"contentbox-modules",
"dependencies":{
"cbcommerce" : "^1"
},
"devDependencies":{},
"installPaths":{
"cbcommerce" : "modules/cbcommerce"
},
"ignore":[
"**/.*",
"test-harness",
"*/.md"
]
}

0 comments on commit 57607e4

Please sign in to comment.