Skip to content

Commit

Permalink
Merge pull request #11 from coldbox-modules/development
Browse files Browse the repository at this point in the history
v2.2.0
  • Loading branch information
lmajano authored May 9, 2024
2 parents 5732a0a + 851757c commit 588d98d
Show file tree
Hide file tree
Showing 23 changed files with 747 additions and 398 deletions.
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Code of Conduct

Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#code-of-conduct).
3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#security-vulnerabilities).
3 changes: 3 additions & 0 deletions .github/SUPPORT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Support & Help

Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#support-questions).
107 changes: 0 additions & 107 deletions .github/workflows/ci.yml

This file was deleted.

19 changes: 0 additions & 19 deletions .github/workflows/gh-release.yml

This file was deleted.

6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ on:
- "main"
- "master"
- "development"
- "v*"
- "releases/v*"
pull_request:
branches:
- "v*"
- "releases/v*"
- development

jobs:
Expand All @@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3.2.0
uses: actions/checkout@v4

- uses: Ortus-Solutions/[email protected]
with:
Expand Down
175 changes: 175 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: Build a 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

env:
MODULE_ID: route-visualizer
SNAPSHOT: ${{ inputs.snapshot || false }}

jobs:
##########################################################################################
# Build & Publish
##########################################################################################
build:
name: Build & Publish
runs-on: ubuntu-20.04
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Setup CommandBox
uses: Ortus-Solutions/[email protected]
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]@[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: Update changelog [unreleased] with latest version
uses: thomaseizinger/[email protected]
if: env.SNAPSHOT == 'false'
with:
changelogPath: ./changelog.md
tag: v${{ env.VERSION }}

- name: Build ${{ env.MODULE_ID }}
run: |
npm install -g markdownlint-cli
markdownlint changelog.md --fix
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: Commit Changelog To Master
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@v4
with:
name: ${{ env.MODULE_ID }}
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/${{ 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 --force
- 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 }}

##########################################################################################
# Prep Next Release
##########################################################################################
prep_next_release:
name: Prep Next Release
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-20.04
needs: [ build ]
steps:
# Checkout development
- name: Checkout Repository
uses: actions/checkout@v4
with:
ref: development

- name: Setup CommandBox
uses: Ortus-Solutions/[email protected]
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}

- name: Download build artifacts
uses: actions/download-artifact@v2
with:
name: ${{ env.MODULE_ID }}
path: .tmp

# Copy the changelog to the development branch
- name: Copy Changelog
run: |
cp .tmp/changelog.md changelog.md
# Bump to next version
- name: Bump Version
run: |
box bump --minor --!TagVersion
# Commit it back to development
- 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
43 changes: 43 additions & 0 deletions .github/workflows/snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Build Snapshot

on:
push:
branches:
- 'development'

jobs:
##########################################################################################
# Module Tests
##########################################################################################
tests:
secrets: inherit
uses: ./.github/workflows/tests.yml

##########################################################################################
# Format Source Code
##########################################################################################
format:
name: Code Auto-Formatting
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v4

- name: Auto-format
uses: Ortus-Solutions/[email protected]
with:
cmd: run-script format

- name: Commit Format Changes
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: Apply cfformat changes

##########################################################################################
# Release it
##########################################################################################
release:
uses: ./.github/workflows/release.yml
needs: [ tests, format ]
secrets: inherit
with:
snapshot: true
Loading

0 comments on commit 588d98d

Please sign in to comment.