Skip to content

Commit ae3f9b3

Browse files
committed
ci: generate dependencies for ter upload
1 parent 66fca4c commit ae3f9b3

File tree

3 files changed

+55
-11
lines changed

3 files changed

+55
-11
lines changed

.github/workflows/release.yml

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,54 @@
1-
name: TERUpload
1+
name: 'Build and Upload TYPO3 TER Release'
22

33
on:
44
push:
55
tags:
6-
- "**"
6+
- 'v*'
7+
workflow_dispatch:
8+
9+
env:
10+
EXT_KEY: 'altcha'
711

812
jobs:
9-
TERUpload:
13+
build-and-upload:
14+
name: 'Build and Upload to TER'
1015
runs-on: ubuntu-latest
16+
1117
steps:
12-
- uses: actions/checkout@v1
13-
- uses: tomasnorre/typo3-upload-ter@v2
18+
- name: Checkout code
19+
uses: actions/checkout@v4
20+
21+
- name: Setup PHP
22+
uses: shivammathur/setup-php@v2
1423
with:
15-
api-token: ${{ secrets.TYPO3_API_TOKEN }}
24+
php-version: '8.3'
25+
extensions: mbstring, intl, zip
26+
tools: composer:v2
27+
28+
- name: Get tag version
29+
id: get_version
30+
run: echo "VERSION=test" >> $GITHUB_ENV
31+
32+
- name: Install Composer dependencies
33+
run: composer install --no-dev --no-interaction --optimize-autoloader
34+
35+
- name: Bundle Composer dependencies for TER
36+
run: |
37+
mkdir -p Resources/Private/PHP/Composer
38+
mv vendor Resources/Private/PHP/Composer/
39+
40+
- name: Create ZIP archive
41+
run: |
42+
zip -r "${{ env.EXT_KEY }}_${{ env.VERSION }}.zip" . -x ".git/*" ".github/*" "README.md"
43+
44+
- name: Install TER Uploader tool
45+
run: composer require --dev helhum/t3x-uploader
46+
47+
- name: Upload to TER
48+
if: startsWith(github.ref, 'refs/tags/')
49+
run: |
50+
php vendor/bin/t3x_uploader \
51+
--username "${{ secrets.TER_USERNAME }}" \
52+
--password "${{ secrets.TER_PASSWORD }}" \
53+
--upload-comment "Automatic release of version ${{ env.VERSION }}" \
54+
"${{ env.EXT_KEY }}_${{ env.VERSION }}.zip"

composer.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@
2727
}
2828
],
2929
"require": {
30-
"typo3/cms-core": "^12.4.0 || ^13.0 || 13.0.x-dev",
31-
"typo3/cms-extbase": "^12.4.0 || ^13.0 || 13.0.x-dev",
32-
"typo3/cms-form": "^12.4.0 || ^13.0 || 13.0.x-dev",
33-
"typo3/cms-fluid": "^12.4.0 || ^13.0 || 13.0.x-dev",
3430
"altcha-org/altcha": "^1.1.2"
3531
},
3632
"suggest": {

ext_localconf.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,13 @@
1515
}'
1616
)
1717
);
18-
});
18+
});
19+
20+
if (!class_exists(\AltchaOrg\Altcha\Altcha::class)) {
21+
$autoloaderPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('altcha')
22+
. 'Resources/Private/PHP/Composer/autoload.php';
23+
24+
if (file_exists($autoloaderPath)) {
25+
require_once $autoloaderPath;
26+
}
27+
}

0 commit comments

Comments
 (0)