Skip to content

Commit f829997

Browse files
committed
Merge branch 'master' into development
2 parents d9b58bd + e354738 commit f829997

File tree

2 files changed

+45
-53
lines changed

2 files changed

+45
-53
lines changed

.github/workflows/release.yml

Lines changed: 14 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -15,70 +15,28 @@ on:
1515
required: false
1616
default: false
1717
type: boolean
18-
doTests:
19-
description: 'Run tests before the release'
20-
required: false
21-
default: true
22-
type: boolean
2318

2419
env:
2520
MODULE_ID: cbvalidation
21+
SNAPSHOT: ${{ inputs.snapshot || false }}
2622

2723
jobs:
28-
##########################################################################################
29-
# Module Tests
30-
##########################################################################################
31-
tests:
32-
if: ${{ inputs.doTests }}
33-
secrets: inherit
34-
uses: ./.github/workflows/tests.yml
35-
36-
##########################################################################################
37-
# Format Source Code
38-
# This only fires on `development`, stable releases should not have auto-formatting
39-
##########################################################################################
40-
format:
41-
name: Code Auto-Formatting
42-
runs-on: ubuntu-20.04
43-
if: ${{ inputs.snapshot && ( success() || !inputs.doTests ) }}
44-
needs: [ tests ]
45-
steps:
46-
- uses: actions/checkout@v3
47-
48-
- name: Auto-format
49-
uses: Ortus-Solutions/[email protected]
50-
with:
51-
cmd: run-script format
52-
53-
- name: Commit Format Changes
54-
uses: stefanzweifel/git-auto-commit-action@v4
55-
with:
56-
commit_message: Apply cfformat changes
57-
5824
##########################################################################################
5925
# Build & Publish
6026
##########################################################################################
6127
build:
6228
name: Build & Publish
63-
if: ${{ success() || !inputs.doTests }}
64-
needs: [ tests, format ]
6529
runs-on: ubuntu-20.04
6630
steps:
6731
- name: Checkout Repository
6832
uses: actions/checkout@v3
6933

70-
- name: Setup Java
71-
uses: actions/setup-java@v3
72-
with:
73-
distribution: "temurin"
74-
java-version: "11"
75-
7634
- name: Setup CommandBox
7735
uses: Ortus-Solutions/[email protected]
7836
with:
7937
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
8038

81-
- name: Setup Environment Variables For Build Process
39+
- name: "Setup Environment Variables For Build Process"
8240
id: current_version
8341
run: |
8442
echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
@@ -93,7 +51,7 @@ jobs:
9351
9452
- name: Update changelog [unreleased] with latest version
9553
uses: thomaseizinger/[email protected]
96-
if: ${{ !inputs.snapshot }}
54+
if: env.SNAPSHOT == 'false'
9755
with:
9856
changelogPath: ./changelog.md
9957
tag: v${{ env.VERSION }}
@@ -105,7 +63,7 @@ jobs:
10563
10664
- name: Commit Changelog To Master
10765
uses: EndBug/[email protected]
108-
if: ${{ !inputs.snapshot }}
66+
if: env.SNAPSHOT == 'false'
10967
with:
11068
author_name: Github Actions
11169
author_email: [email protected]
@@ -114,7 +72,7 @@ jobs:
11472

11573
- name: Tag Version
11674
uses: rickstaa/[email protected]
117-
if: ${{ !inputs.snapshot }}
75+
if: env.SNAPSHOT == 'false'
11876
with:
11977
tag: "v${{ env.VERSION }}"
12078
force_push_tag: true
@@ -136,7 +94,7 @@ jobs:
13694
- name: Create Github Release
13795
uses: taiki-e/[email protected]
13896
continue-on-error: true
139-
if: ${{ !inputs.snapshot }}
97+
if: env.SNAPSHOT == 'false'
14098
with:
14199
title: ${{ env.VERSION }}
142100
changelog: changelog.md
@@ -146,18 +104,23 @@ jobs:
146104
##########################################################################################
147105
# Prep Next Release
148106
##########################################################################################
149-
prep-next-release:
107+
prep_next_release:
150108
name: Prep Next Release
151-
if: ${{ !inputs.snapshot && success() }}
152-
needs: [ build ]
109+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
153110
runs-on: ubuntu-20.04
111+
needs: [ build ]
154112
steps:
155113
# Checkout development
156114
- name: Checkout Repository
157115
uses: actions/checkout@v3
158116
with:
159117
ref: development
160118

119+
- name: Setup CommandBox
120+
uses: Ortus-Solutions/[email protected]
121+
with:
122+
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
123+
161124
- name: Download build artifacts
162125
uses: actions/download-artifact@v2
163126
with:

.github/workflows/snapshot.yml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,38 @@ on:
66
- 'development'
77

88
jobs:
9-
call-workflow:
9+
##########################################################################################
10+
# Module Tests
11+
##########################################################################################
12+
tests:
13+
secrets: inherit
14+
uses: ./.github/workflows/tests.yml
15+
16+
##########################################################################################
17+
# Format Source Code
18+
##########################################################################################
19+
format:
20+
name: Code Auto-Formatting
21+
runs-on: ubuntu-20.04
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Auto-format
26+
uses: Ortus-Solutions/[email protected]
27+
with:
28+
cmd: run-script format
29+
30+
- name: Commit Format Changes
31+
uses: stefanzweifel/git-auto-commit-action@v4
32+
with:
33+
commit_message: Apply cfformat changes
34+
35+
##########################################################################################
36+
# Release it
37+
##########################################################################################
38+
release:
1039
uses: ./.github/workflows/release.yml
40+
needs: [ tests, format ]
1141
secrets: inherit
1242
with:
13-
doTests: true
1443
snapshot: true

0 commit comments

Comments
 (0)