[RELEASE] 5.0.3 #12
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: publish | |
| on: | |
| push: | |
| tags: | |
| - '*' | |
| jobs: | |
| publish: | |
| name: Ensure GitHub Release with extension TER artifact and publishing to TER | |
| if: startsWith(github.ref, 'refs/tags/') | |
| runs-on: ubuntu-latest | |
| env: | |
| TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }} | |
| TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Verify tag | |
| run: | | |
| if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then | |
| echo "ERR: Invalid publish version tag: ${{ github.ref }}" | |
| exit 1 | |
| fi | |
| - name: Get version | |
| id: get-version | |
| run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV | |
| - name: Get comment | |
| id: get-comment | |
| run: | | |
| readonly local releaseCommentPrependBody="$( git tag -l ${{ env.version }} --format '%(contents)' )" | |
| if (( $(grep -c . <<<"${releaseCommentPrependBody// }") > 1 )); then | |
| { | |
| echo 'releaseCommentPrependBody<<EOF' | |
| echo "$releaseCommentPrependBody" | |
| echo EOF | |
| } >> "$GITHUB_ENV" | |
| fi | |
| { | |
| echo 'terReleaseNotes<<EOF' | |
| echo "https://github.com/fgtclb/academic-persons/releases/tag/${{ env.version }}" | |
| echo EOF | |
| } >> "$GITHUB_ENV" | |
| echo "DETECTED_EXTENSION_KEY=$(cat composer.json | jq -r '.extra."typo3/cms"."extension-key"' )" >> "$GITHUB_ENV" | |
| - name: Setup PHP 7.4 ( wv_deepltranslate 4.x ) | |
| if: github.event.base_ref == 'refs/heads/4' | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 7.4 | |
| extensions: intl, mbstring, json, zip, curl | |
| tools: composer:v2 | |
| - name: Setup PHP 8.1 ( deepltranlsate-core 5.x ) | |
| if: github.event.base_ref == 'refs/heads/main' | |
| uses: shivammathur/setup-php@v2 | |
| with: | |
| php-version: 8.1 | |
| extensions: intl, mbstring, json, zip, curl | |
| tools: composer:v2 | |
| - name: Prepare vendor folder and autoload configuration for TER upload | |
| shell: bash | |
| run: | | |
| rm -rf vendor composer.lock composer.json.orig composer.json.pretty \ | |
| && mv composer.json composer.json.orig \ | |
| && composer init -n \ | |
| --type=project \ | |
| --license='GPL-2.0-or-later' \ | |
| --name=release/draft \ | |
| --description empty \ | |
| --author='release' \ | |
| && composer config allow-plugins.php-http/discovery true \ | |
| && composer require "deeplcom/deepl-php":"$( cat composer.json.orig | jq -r '.require."deeplcom/deepl-php"' )" \ | |
| && rm -rf composer.lock \ | |
| vendor/composer \ | |
| vendor/nyholm \ | |
| vendor/php-http/multipart-stream-builder \ | |
| vendor/psr \ | |
| vendor/symfony \ | |
| vendor/autoload.php \ | |
| vendor/bin \ | |
| && cat <<< $(jq --indent 4 '."autoload"."psr-4" += {"DeepL\\": "vendor/deeplcom/deepl-php/src", "Http\\Discovery\\": "vendor/php-http/discovery/src"}' composer.json.orig) > composer.json.pretty \ | |
| && rm -rf composer.json \ | |
| && mv composer.json.pretty composer.json \ | |
| && rm -rf composer.json.orig | |
| - name: Install tailor | |
| run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest | |
| # Note that step will fail when `env.version` does not match the `ext_emconf.php` version. | |
| - name: Create local TER package upload artifact | |
| env: | |
| # See https://github.com/TYPO3/tailor?tab=readme-ov-file#exclude-paths-from-packaging | |
| TYPO3_EXCLUDE_FROM_PACKAGING: Build/tailor/ExcludeFromPackaging.php | |
| run: | | |
| php ~/.composer/vendor/bin/tailor create-artefact ${{ env.version }} ${{ env.DETECTED_EXTENSION_KEY }} | |
| # Note that when release already exists for tag, only files will be uploaded and lets this acting as a | |
| # fallback to ensure that a real GitHub release is created for the tag along with extension artifacts. | |
| - name: Create release and upload artifacts in the same step | |
| uses: softprops/action-gh-release@v2 | |
| if: ${{startsWith(github.ref, 'refs/tags/') }} | |
| with: | |
| name: "[RELEASE] ${{ env.version }}" | |
| body: "${{ env.releaseCommentPrependBody }}" | |
| generate_release_notes: true | |
| files: | | |
| tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}.zip | |
| LICENSE | |
| fail_on_unmatched_files: true | |
| # @todo Currently an issue exists with the TYPO3 Extension Repository (TER) tailor based uploads, which seems to | |
| # be WAF related and the T3O TER Team working on. Allow this step to fail (continue on error) for now until | |
| # issues has been sorted out. | |
| # https://github.com/TYPO3/tailor/issues/82 | |
| - name: Publish to TER | |
| # @todo Remove `continue-on-error` after upload with tailor has been fixed. | |
| continue-on-error: true | |
| run: | | |
| php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.terReleaseNotes }}" ${{ env.version }} \ | |
| --artefact=tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}.zip |