Skip to content

Commit 50e9ce7

Browse files
authored
[TASK] fix TER publish (#58)
1 parent 3102f8e commit 50e9ce7

2 files changed

Lines changed: 24 additions & 26 deletions

File tree

.github/workflows/tasks.yml

Lines changed: 23 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,45 +40,51 @@ jobs:
4040
file: Resources/Public/test-result/clover.xml
4141

4242
ter-release:
43-
name: TER release
43+
name: Publish new version to TER
4444
runs-on: ubuntu-latest
4545
if: startsWith(github.ref, 'refs/tags/')
4646
needs: [ lint-php ]
4747
env:
48-
TYPO3_EXTENSION_KEY: 'server_timing'
49-
REPOSITORY_URL: 'https://github.com/Kanti/server-timing'
5048
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
51-
TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }}
52-
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}
5349

5450
steps:
5551
- uses: actions/checkout@v6
5652
- name: Get the version
57-
id: get_version
58-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
53+
id: get-version
54+
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
5955

6056
- name: Setup PHP
6157
uses: shivammathur/setup-php@v2
6258
with:
63-
php-version: '8.4'
59+
php-version: '8.5'
6460
extensions: intl, mbstring, xml, soap, zip, curl
6561

62+
- name: Get comment
63+
id: get-comment
64+
run: |
65+
curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/Kanti/server_timing/releases/tags/${{ env.version }} > release.json
66+
67+
readonly local comment=$(
68+
jq -r '.name, "", .body, "", .html_url' release.json \
69+
| 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));' \
70+
)
71+
72+
{
73+
echo 'comment<<EOF'
74+
echo "$comment"
75+
echo EOF
76+
} >> "$GITHUB_ENV"
77+
6678
- name: Install typo3/tailor
6779
run: composer global require typo3/tailor --prefer-dist --no-progress
6880

6981
- name: Upload EXT:server_timing to TER
7082
run: |
71-
sed -i 's/InstalledVersions::getPrettyVersion('\''kanti\/server-timing'\'')/'\''${{ steps.get_version.outputs.VERSION }}'\''/g' ext_emconf.php \
83+
sed -i "s|'dev-'|'${{ env.version }}'|g" ext_emconf.php \
7284
&& git config --global user.email "no@one" \
7385
&& git config --global user.name "No One" \
7486
&& git add ext_emconf.php \
7587
&& git commit -m 'x' -n \
76-
&& git archive -o archive.zip HEAD --prefix=server_timing-${{ steps.get_version.outputs.VERSION }}/ \
88+
&& git archive -o archive.zip HEAD --prefix=server_timing-${{ env.version }}/ \
7789
&& git reset --hard HEAD~ \
78-
&& 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 \
79-
&& php ~/.composer/vendor/bin/tailor ter:publish ${{ steps.get_version.outputs.VERSION }} --artefact=archive.zip \
80-
--comment="$(cat release.json | jq -r '.name')
81-
82-
$(cat release.json | jq -r '.body')
83-
84-
$(cat release.json | jq -r '.html_url')"
90+
&& php ~/.composer/vendor/bin/tailor ter:publish -vvv ${{ env.version }} --artefact=archive.zip --comment="${{ env.comment }}"

ext_emconf.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,14 @@
11
<?php
22

3-
use Composer\InstalledVersions;
4-
53
/** @var string $_EXTKEY */
6-
try {
7-
$version = InstalledVersions::getPrettyVersion('kanti/server-timing');
8-
} catch (Exception) {
9-
$version = '99.99.99'; // allow install in typo3-main
10-
}
11-
124
$EM_CONF[$_EXTKEY] = [
135
'title' => 'Kanti: server-timing',
146
'description' => 'Show timings of Database and HTTP Calls (send them to Sentry)',
157
'category' => 'module',
168
'author' => 'Matthias Vogel',
179
'author_email' => 'git@kanti.de',
1810
'state' => 'stable',
19-
'version' => $version,
11+
'version' => 'dev-',
2012
'constraints' => [
2113
'depends' => [
2214
'typo3' => '13.0.0-14.4.99',

0 commit comments

Comments
 (0)