[TASK] fix TER publish #275
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Tasks | |
| on: | |
| push: | |
| pull_request: | |
| jobs: | |
| lint-php: | |
| name: "php: ${{ matrix.php }} TYPO3: ${{ matrix.typo3 }} sentry/sdk: ${{ matrix.sentry }}" | |
| runs-on: ubuntu-latest | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| php: [ '8.2', '8.3', '8.4' ] | |
| typo3: [ '13', '14' ] | |
| sentry: [ false, true ] | |
| steps: | |
| - name: Setup PHP with PECL extension | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: ${{ matrix.php }} | |
| - uses: actions/checkout@v6 | |
| - uses: actions/cache@v5 | |
| with: | |
| path: ~/.composer/cache/files | |
| key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.lock') }} | |
| restore-keys: | | |
| ${{ runner.os }}-${{ matrix.php }}-composer- | |
| - run: composer require typo3/minimal="^${{ matrix.typo3 }}" --dev --ignore-platform-req=php+ | |
| - run: composer remove sentry/sdk --dev --ignore-platform-req=php+ | |
| if: ${{ ! matrix.sentry }} | |
| - run: composer install --no-interaction --no-progress --ignore-platform-req=php+ | |
| - run: ./vendor/bin/grumphp run --ansi | |
| - run: composer test | |
| - run: jq 'del(.logs.html)' infection.json > infection.json.new && mv infection.json.new infection.json | |
| - run: composer infection | |
| - uses: codecov/codecov-action@v6 | |
| with: | |
| token: ${{ secrets.CODECOV_TOKEN }} | |
| file: Resources/Public/test-result/clover.xml | |
| ter-release: | |
| name: Publish new version to TER | |
| runs-on: ubuntu-latest | |
| if: startsWith(github.ref, 'refs/tags/') | |
| needs: [ lint-php ] | |
| env: | |
| TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Get the version | |
| id: get-version | |
| run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
| - name: Setup PHP | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| 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|'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-${{ env.version }}/ \ | |
| && git reset --hard HEAD~ \ | |
| && php ~/.composer/vendor/bin/tailor ter:publish -vvv ${{ env.version }} --artefact=archive.zip --comment="${{ env.comment }}" |