forked from ExpressionEngine/ExpressionEngine
-
Notifications
You must be signed in to change notification settings - Fork 0
237 lines (203 loc) · 8.45 KB
/
pre-release.yml
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
232
233
234
235
236
237
name: Pre-Release
on:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- '*.x'
push:
branches:
- 'feature/7.x/cypress-12'
jobs:
build:
if: github.event.pull_request.draft == false
name: TEST BUILD
runs-on: ubuntu-latest
outputs:
version: ${{ steps.build_json.outputs.BUILD_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Checkout RedactorX
uses: actions/checkout@v4
with:
repository: ExpressionEngine/RedactorX
token: ${{ secrets.ORG_ACCESS_TOKEN }}
path: __redactorx
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: dom, curl, sqlite, libxml, mbstring, zip, pcntl, pdo, mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
ini-values: error_log=/home/runner/php_errors.log, memory_limit=128M
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: '10'
- name: Install build tool dependencies
working-directory: build-tools
run: npm install
- name: Rebuild CSS and JS
run: |
npm install
npm run build:css --production
npm run build:js
npm run build:old-js
- name: Get version
id: build_json
working-directory: build-tools
run: |
content=`node -pe 'JSON.parse(process.argv[1]).tag' "$(cat build.json)"`
echo "BUILD_VERSION=$content" >> $GITHUB_OUTPUT
- name: Set DP version
run: echo "dp_ver=1" >> $GITHUB_ENV
- name: Get previous DP tag
id: prev_tag
continue-on-error: true
uses: oprypin/find-latest-tag@v1
with:
repository: ExpressionEngine/ExpressionEngine
prefix: ${{ steps.build_json.outputs.BUILD_VERSION }}-dp.
- name: Increase DP version
if: ${{ steps.prev_tag.outcome == 'success' }}
run: |
content=`echo "${{ steps.prev_tag.outputs.tag }}" | rev | cut -d "." -s -f 1 | rev`
echo "dp_ver=$(( 1+$content ))" >> $GITHUB_ENV
- name: Run build process
working-directory: build-tools
env:
RELEASE_PRIVATE_KEY: ${{ secrets.RELEASE_PRIVATE_KEY }}
RELEASE_KEY_PASSWORD: ${{ secrets.RELEASE_KEY_PASSWORD }}
APP_REPO_PATH: ${{ github.workspace }}
REDACTORX_REPO_PATH: ${{ github.workspace }}/__redactorx
run: |
gulp app --local --nogit --head --skip-lint --jira-collector --skip-pro --version=${{ steps.build_json.outputs.BUILD_VERSION }}-dp.${{ env.dp_ver }}
- name: Archive Build files
uses: actions/upload-artifact@v4
with:
name: EE${{ steps.build_json.outputs.BUILD_VERSION }}
path: build-tools/builds
- name: Get previous release tag
id: prev_release_tag
continue-on-error: true
uses: oprypin/find-latest-tag@v1
with:
repository: ExpressionEngine/ExpressionEngine
regex: '^7\.\d+\.\d+$'
releases-only: true
- name: Build Changelog
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v3
env:
GITHUB_TOKEN: ${{ secrets.ORG_ACCESS_TOKEN }}
with:
fromTag: ${{ steps.prev_release_tag.outputs.tag }}
toTag: ${{ github.event.pull_request.head.sha }}
configuration: build-tools/changelog.config.json
- uses: ncipollo/[email protected]
with:
artifacts: "build-tools/builds/ExpressionEngine*,build-tools/builds/signature*"
name: ExpressionEngine ${{ steps.build_json.outputs.BUILD_VERSION }} DP ${{ env.dp_ver }}
tag: ${{ steps.build_json.outputs.BUILD_VERSION }}-dp.${{ env.dp_ver }}
commit: ${{ github.event.pull_request.head.sha }}
allowUpdates: true
token: ${{ secrets.ORG_ACCESS_TOKEN }}
prerelease: true
#draft: true
body: ${{ steps.build_changelog.outputs.changelog }}
- name: Directory Listing on Failure
if: failure()
run: |
ls -latr
ls -latr build-tools
ls -latr build-tools/builds
test-one-click:
if: github.event.pull_request.draft == false
needs: build
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
php: [8.0]
os: [ubuntu-latest]
name: One-click updater, PHP${{ matrix.php }} - ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
repository: ExpressionEngine/ExpressionEngine
path: __repo
- name: Download EE 7.0
run: |
wget -q https://github.com/ExpressionEngine/ExpressionEngine/releases/download/7.0.0/ExpressionEngine7.0.0.zip
unzip -q ExpressionEngine7.0.0.zip
mv ./__repo/tests ./
mv ./__repo/build-tools ./
sudo apt-get install -yq rpl
rpl -v https://update.expressionengine.com ${{ secrets.STAGING_UPDATE_URL }} system/ee/ExpressionEngine/Service/Updater/Runner.php
rpl -v https://update.expressionengine.com ${{ secrets.STAGING_UPDATE_URL }} system/ee/legacy/libraries/El_pings.php
- name: List the files
run: |
ls -lar ./
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, sqlite, libxml, mbstring, zip, pcntl, pdo, mysql, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none
ini-values: error_log=/home/runner/php_errors.log, memory_limit=128M
- name: Copy config.php
run: |
rm -f system/user/config/config.php
cp -f tests/cypress/support/config/config.php system/user/config/config.php
rpl -v '${{ needs.build.outputs.version }}' '7.0.0' build-tools/build.json
- name: Remove installer
run: |
ls -lar system/ee
mv system/ee/installer system/ee/_installer
- name: Setup Permissions
run: |
sudo chmod 666 system/user/config/config.php
sudo chmod 777 system/user/config
sudo chmod -R 777 system/user/cache
sudo chmod -R 777 system/user/templates
sudo chmod -R 777 system/user/language
sudo chmod -R 777 tests/cypress/support/tmp
sudo chmod -R 777 tests/cypress/support/file-sync/uploads
sudo chmod -R 777 images
sudo chmod -R 777 themes/user
sudo chmod -R 777 tests/cypress/cypress/screenshots
- name: Configure MySQL
run: |
sudo systemctl start mysql
mysql -u root -proot -e 'CREATE DATABASE `ee-test`;'
mysql -u root -proot -e 'SET GLOBAL sql_mode="ONLY_FULL_GROUP_BY,STRICT_ALL_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION";'
- name: Install Testing PHP dependencies
working-directory: tests/cypress
run: composer install
- name: Start PHP Server
run: php -S localhost:8888 &
- name: Run 1-click Updater Tests
uses: cypress-io/github-action@v6
with:
browser: chrome
working-directory: tests/cypress
config: specPattern=cypress/integration/updater/**.ee6.js
record: true
group: PHP${{ matrix.php }}
env:
CYPRESS_PROJECT_ID: ${{ secrets.CYPRESS_PROJECT_ID }}
CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Archive screenshots
uses: actions/upload-artifact@v4
if: failure()
with:
name: cypress-tests-updater
path: tests/cypress/cypress/screenshots/
- name: Archive server errors
uses: actions/upload-artifact@v4
if: failure()
with:
name: updater.error.log
path: /home/runner/php_errors.log