From 73b296aeddda33493e14050642d581f6ca06d9b9 Mon Sep 17 00:00:00 2001 From: Matthias Vogel Date: Tue, 28 Apr 2026 09:38:13 +0200 Subject: [PATCH] [TASK] fix TER publish --- .github/workflows/tasks.yml | 40 +++++++++++++++++++++---------------- ext_emconf.php | 10 +--------- 2 files changed, 24 insertions(+), 26 deletions(-) diff --git a/.github/workflows/tasks.yml b/.github/workflows/tasks.yml index c0c656b..f73cea6 100644 --- a/.github/workflows/tasks.yml +++ b/.github/workflows/tasks.yml @@ -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<> "$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 }}" diff --git a/ext_emconf.php b/ext_emconf.php index 1c67134..d5386a1 100644 --- a/ext_emconf.php +++ b/ext_emconf.php @@ -1,14 +1,6 @@ 'Kanti: server-timing', 'description' => 'Show timings of Database and HTTP Calls (send them to Sentry)', @@ -16,7 +8,7 @@ 'author' => 'Matthias Vogel', 'author_email' => 'git@kanti.de', 'state' => 'stable', - 'version' => $version, + 'version' => 'dev-', 'constraints' => [ 'depends' => [ 'typo3' => '13.0.0-14.4.99',