Skip to content

Commit 849bafc

Browse files
authored
Merge pull request #42 from coldbox-modules/development
v3.4.0
2 parents 0571db3 + c09395e commit 849bafc

21 files changed

+440
-215
lines changed

.cfconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"clob":"true",
2323
"connectionLimit":"100",
2424
"connectionTimeout":"1",
25-
"custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&useSSL=false",
25+
"custom":"useUnicode=true&characterEncoding=UTF8&serverTimezone=UTC&useLegacyDatetimeCode=true&autoReconnect=true&useSSL=false&allowPublicKeyRetrieval=true",
2626
"database":"cbsecurity",
2727
"dbdriver":"MySQL",
2828
"dsn":"jdbc:mysql://{host}:{port}/{database}",

.github/CODE_OF_CONDUCT.MD

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Code of Conduct
2+
3+
Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#code-of-conduct).

.github/SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#security-vulnerabilities).

.github/SUPPORT.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Support & Help
2+
3+
Please see it in our [Contributing Guidelines](../CONTRIBUTING.md#support-questions).

.github/workflows/ci.yml

Lines changed: 0 additions & 110 deletions
This file was deleted.

.github/workflows/gh-release.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.

.github/workflows/pr.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,24 @@ on:
66
- "main"
77
- "master"
88
- "development"
9+
- "releases/v*"
910
pull_request:
1011
branches:
12+
- "releases/v*"
1113
- development
1214

1315
jobs:
1416
tests:
1517
uses: ./.github/workflows/tests.yml
16-
secrets:
17-
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
18+
secrets: inherit
1819

19-
# Format PR
20-
format:
21-
name: Format
20+
formatCheck:
21+
name: Checks Source Code Formatting
2222
runs-on: ubuntu-20.04
2323
steps:
2424
- name: Checkout Repository
25-
uses: actions/checkout@v3.2.0
25+
uses: actions/checkout@v3
2626

2727
- uses: Ortus-Solutions/[email protected]
2828
with:
29-
cmd: run-script format
30-
31-
- name: Commit Format Changes
32-
uses: stefanzweifel/git-auto-commit-action@v4
33-
with:
34-
commit_message: Apply cfformat changes
29+
cmd: run-script format:check

.github/workflows/release.yml

Lines changed: 175 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,175 @@
1+
name: Build a Release
2+
3+
on:
4+
# If you push to master|main this will trigger a stable release
5+
push:
6+
branches:
7+
- master
8+
- main
9+
10+
# Reusable workflow : Usually called by a `snapshot` workflow
11+
workflow_call:
12+
inputs:
13+
snapshot:
14+
description: 'Is this a snapshot build?'
15+
required: false
16+
default: false
17+
type: boolean
18+
19+
env:
20+
MODULE_ID: cbsecurity
21+
SNAPSHOT: ${{ inputs.snapshot || false }}
22+
23+
jobs:
24+
##########################################################################################
25+
# Build & Publish
26+
##########################################################################################
27+
build:
28+
name: Build & Publish
29+
runs-on: ubuntu-20.04
30+
steps:
31+
- name: Checkout Repository
32+
uses: actions/checkout@v3
33+
34+
- name: Setup CommandBox
35+
uses: Ortus-Solutions/[email protected]
36+
with:
37+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
38+
39+
- name: "Setup Environment Variables For Build Process"
40+
id: current_version
41+
run: |
42+
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
43+
44+
# master or snapshot
45+
echo "Github Ref is $GITHUB_REF"
46+
echo "BRANCH=master" >> $GITHUB_ENV
47+
if [ $GITHUB_REF == 'refs/heads/development' ]
48+
then
49+
echo "BRANCH=development" >> $GITHUB_ENV
50+
fi
51+
52+
- name: Update changelog [unreleased] with latest version
53+
uses: thomaseizinger/[email protected]
54+
if: env.SNAPSHOT == 'false'
55+
with:
56+
changelogPath: ./changelog.md
57+
tag: v${{ env.VERSION }}
58+
59+
- name: Build ${{ env.MODULE_ID }}
60+
run: |
61+
npm install -g markdownlint-cli
62+
markdownlint changelog.md --fix
63+
box install commandbox-docbox
64+
box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
65+
66+
- name: Commit Changelog To Master
67+
uses: EndBug/[email protected]
68+
if: env.SNAPSHOT == 'false'
69+
with:
70+
author_name: Github Actions
71+
author_email: [email protected]
72+
message: 'Finalized changelog for v${{ env.VERSION }}'
73+
add: changelog.md
74+
75+
- name: Tag Version
76+
uses: rickstaa/[email protected]
77+
if: env.SNAPSHOT == 'false'
78+
with:
79+
tag: "v${{ env.VERSION }}"
80+
force_push_tag: true
81+
message: "Latest Release v${{ env.VERSION }}"
82+
83+
- name: Upload Build Artifacts
84+
if: success()
85+
uses: actions/upload-artifact@v3
86+
with:
87+
name: ${{ env.MODULE_ID }}
88+
path: |
89+
.artifacts/**/*
90+
changelog.md
91+
92+
- name: Upload Binaries to S3
93+
uses: jakejarvis/s3-sync-action@master
94+
with:
95+
args: --acl public-read
96+
env:
97+
AWS_S3_BUCKET: "downloads.ortussolutions.com"
98+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
99+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
100+
SOURCE_DIR: ".artifacts/${{ env.MODULE_ID }}"
101+
DEST_DIR: "ortussolutions/coldbox-modules/${{ env.MODULE_ID }}"
102+
103+
- name: Upload API Docs to S3
104+
uses: jakejarvis/s3-sync-action@master
105+
with:
106+
args: --acl public-read
107+
env:
108+
AWS_S3_BUCKET: "apidocs.ortussolutions.com"
109+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY }}
110+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_ACCESS_SECRET }}
111+
SOURCE_DIR: ".tmp/apidocs"
112+
DEST_DIR: "coldbox-modules/${{ env.MODULE_ID }}/${{ env.VERSION }}"
113+
114+
- name: Publish To ForgeBox
115+
run: |
116+
cd .tmp/${{ env.MODULE_ID }}
117+
cat box.json
118+
box forgebox publish --force
119+
120+
- name: Create Github Release
121+
uses: taiki-e/[email protected]
122+
continue-on-error: true
123+
if: env.SNAPSHOT == 'false'
124+
with:
125+
title: ${{ env.VERSION }}
126+
changelog: changelog.md
127+
token: ${{ secrets.GITHUB_TOKEN }}
128+
ref: refs/tags/v${{ env.VERSION }}
129+
130+
##########################################################################################
131+
# Prep Next Release
132+
##########################################################################################
133+
prep_next_release:
134+
name: Prep Next Release
135+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
136+
runs-on: ubuntu-20.04
137+
needs: [ build ]
138+
steps:
139+
# Checkout development
140+
- name: Checkout Repository
141+
uses: actions/checkout@v3
142+
with:
143+
ref: development
144+
145+
- name: Setup CommandBox
146+
uses: Ortus-Solutions/[email protected]
147+
with:
148+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
149+
150+
- name: Download build artifacts
151+
uses: actions/download-artifact@v2
152+
with:
153+
name: ${{ env.MODULE_ID }}
154+
path: .tmp
155+
156+
# Copy the changelog to the development branch
157+
- name: Copy Changelog
158+
run: |
159+
cp .tmp/changelog.md changelog.md
160+
161+
# Bump to next version
162+
- name: Bump Version
163+
run: |
164+
box bump --minor --!TagVersion
165+
166+
# Commit it back to development
167+
- name: Commit Version Bump
168+
uses: EndBug/[email protected]
169+
with:
170+
author_name: Github Actions
171+
author_email: [email protected]
172+
message: 'Version bump'
173+
add: |
174+
box.json
175+
changelog.md

0 commit comments

Comments
 (0)