Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,45 +40,51 @@ jobs:
file: Resources/Public/test-result/clover.xml

ter-release:
name: TER release
name: Publish new version to TER
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [ lint-php ]
env:
TYPO3_EXTENSION_KEY: 'server_timing'
REPOSITORY_URL: 'https://github.com/Kanti/server-timing'
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }}
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}

steps:
- uses: actions/checkout@v6
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
id: get-version
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.4'
php-version: '8.5'
extensions: intl, mbstring, xml, soap, zip, curl

- name: Get comment
id: get-comment
run: |
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/Kanti/server_timing/releases/tags/${{ env.version }} > release.json

readonly local comment=$(
jq -r '.name, "", .body, "", .html_url' release.json \
| php -r 'echo preg_replace("/[\x{1F1E6}-\x{1F1FF}\x{1F300}-\x{1FAFF}\x{2600}-\x{27BF}\x{FE0F}\x{200D}]/u", "", stream_get_contents(STDIN));' \
)

{
echo 'comment<<EOF'
echo "$comment"
echo EOF
} >> "$GITHUB_ENV"

- name: Install typo3/tailor
run: composer global require typo3/tailor --prefer-dist --no-progress

- name: Upload EXT:server_timing to TER
run: |
sed -i 's/InstalledVersions::getPrettyVersion('\''kanti\/server-timing'\'')/'\''${{ steps.get_version.outputs.VERSION }}'\''/g' ext_emconf.php \
sed -i "s|'dev-'|'${{ env.version }}'|g" ext_emconf.php \
&& git config --global user.email "no@one" \
&& git config --global user.name "No One" \
&& git add ext_emconf.php \
&& git commit -m 'x' -n \
&& git archive -o archive.zip HEAD --prefix=server_timing-${{ steps.get_version.outputs.VERSION }}/ \
&& git archive -o archive.zip HEAD --prefix=server_timing-${{ env.version }}/ \
&& git reset --hard HEAD~ \
&& curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/Kanti/server-timing/releases/tags/${{ steps.get_version.outputs.VERSION }} > release.json \
&& php ~/.composer/vendor/bin/tailor ter:publish ${{ steps.get_version.outputs.VERSION }} --artefact=archive.zip \
--comment="$(cat release.json | jq -r '.name')

$(cat release.json | jq -r '.body')

$(cat release.json | jq -r '.html_url')"
&& php ~/.composer/vendor/bin/tailor ter:publish -vvv ${{ env.version }} --artefact=archive.zip --comment="${{ env.comment }}"
10 changes: 1 addition & 9 deletions ext_emconf.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
<?php

use Composer\InstalledVersions;

/** @var string $_EXTKEY */
try {
$version = InstalledVersions::getPrettyVersion('kanti/server-timing');
} catch (Exception) {
$version = '99.99.99'; // allow install in typo3-main
}

$EM_CONF[$_EXTKEY] = [
'title' => 'Kanti: server-timing',
'description' => 'Show timings of Database and HTTP Calls (send them to Sentry)',
'category' => 'module',
'author' => 'Matthias Vogel',
'author_email' => 'git@kanti.de',
'state' => 'stable',
'version' => $version,
'version' => 'dev-',
'constraints' => [
'depends' => [
'typo3' => '13.0.0-14.4.99',
Expand Down
Loading