-
-
Notifications
You must be signed in to change notification settings - Fork 172
231 lines (202 loc) · 7.23 KB
/
release.yml
File metadata and controls
231 lines (202 loc) · 7.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
# This workflow is used to build releases
# It can also be called by other workflows to reuse the release flow.
name: ColdBox 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
# Manual Trigger for LTS Releases
workflow_dispatch:
inputs:
lts:
description: 'The LTS marker'
required: false
default: true
type: boolean
env:
SNAPSHOT: ${{ inputs.snapshot || false }}
LTS: ${{ inputs.lts || false }}
jobs:
#############################################
# Build Snapshot or Final Release
#############################################
build:
name: Build & Publish Release
runs-on: ubuntu-24.04
steps:
- name: Checkout Repository
uses: actions/checkout@v6
- name: Setup Java
uses: actions/setup-java@v5
with:
distribution: "temurin"
java-version: "11"
- name: Setup BoxLang
uses: ortus-boxlang/setup-boxlang@1.3.0
with:
version: "snapshot"
- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@v2.0.1
with:
install: commandbox-boxlang
forgeboxAPIKey: ${{ secrets.FORGEBOX_API_TOKEN }}
- name: Setup Environment Variables For Build Process
id: current_version
run: |
echo "COLDBOX_VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
box package set version=@build.version@+@build.number@
# 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: Install Dependencies
run: |
box install --verbose --production
cd apidocs && box install
- name: Update changelog [unreleased] with latest version
uses: thomaseizinger/keep-a-changelog-new-release@3.1.0
if: env.SNAPSHOT == 'false'
with:
changelogPath: ./changelog.md
tag: v${{ env.COLDBOX_VERSION }}
- name: Build ColdBox Variants for ${{ env.BRANCH }} v${{ env.COLDBOX_VERSION }}
run: |
# Fix changelog markdown
npm install -g markdownlint-cli
markdownlint changelog.md --fix
# Startup the server for API Docs mostly.
box server start serverConfigFile="server-lucee@5.json" --debug
# Run the task
box task run build/Build.cfc run ${{ env.COLDBOX_VERSION }} ${{ github.run_number }} ${{ env.BRANCH }}
- name: Commit Changelog [unreleased] with latest version
uses: EndBug/add-and-commit@v10.0.0
if: env.SNAPSHOT == 'false'
with:
author_name: Github Actions
author_email: info@ortussolutions.com
message: 'Finalized changelog for v${{ env.COLDBOX_VERSION }}'
add: changelog.md
- name: Tag Version
uses: rickstaa/action-create-tag@v1.7.2
if: env.SNAPSHOT == 'false'
with:
tag: "v${{ env.COLDBOX_VERSION }}"
force_push_tag: true
message: "Latest Release v${{ env.COLDBOX_VERSION }}"
- name: Upload Build Artifacts
if: success()
uses: actions/upload-artifact@v7
with:
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"
DEST_DIR: "ortussolutions"
- 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: ""
- name: Publish
run: |
ROOT_DIR=`pwd`
cd $ROOT_DIR/.artifacts/coldbox/${{ env.COLDBOX_VERSION }} && box forgebox publish
cd $ROOT_DIR/.artifacts/bx-coldbox/${{ env.COLDBOX_VERSION }} && box forgebox publish
cd $ROOT_DIR/.artifacts/cachebox/${{ env.COLDBOX_VERSION }} && box forgebox publish
cd $ROOT_DIR/.artifacts/wirebox/${{ env.COLDBOX_VERSION }} && box forgebox publish
cd $ROOT_DIR/.artifacts/logbox/${{ env.COLDBOX_VERSION }} && box forgebox publish
- name: Create Github Release
uses: taiki-e/create-gh-release-action@v1.9.3
continue-on-error: true
if: env.SNAPSHOT == 'false'
with:
title: ${{ env.COLDBOX_VERSION }}
changelog: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
ref: refs/tags/v${{ env.COLDBOX_VERSION }}
- 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: 'ColdBox ${{ env.COLDBOX_VERSION }} Built with ${{ job.status }}!'
SLACK_TITLE: "ColdBox Build"
SLACK_USERNAME: CI
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK_URL }}
##########################################################################################
# Prep Next Release
##########################################################################################
prep_next_release:
name: Prep Next Release
if: github.ref != 'refs/heads/development'
runs-on: ubuntu-latest
needs: [ build ]
steps:
- name: Checkout Development Repository
uses: actions/checkout@v6
if: env.LTS == 'false'
with:
ref: development
- name: Checkout LTS Repository
uses: actions/checkout@v6
if: env.LTS == 'true'
- name: Setup CommandBox
uses: Ortus-Solutions/setup-commandbox@v2.0.1
with:
forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
path: .tmp
- name: Copy Changelog
run: |
ls -lR .tmp/
cp .tmp/changelog.md changelog.md || true
- name: Bump Version
if: ${{ always() }}
run: |
if [ $LTS == 'true' ]
then
box bump --patch --!TagVersion
else
box bump --minor --!TagVersion
fi
git pull
- name: Commit Version Bump
uses: EndBug/add-and-commit@v10.0.0
if: ${{ always() }}
with:
author_name: Github Actions
author_email: info@ortussolutions.com
message: 'Version bump'
add: |
box.json
changelog.md