[TASK] Prepare release 1.0.2 #3
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_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 extension key | |
| id: get-extension-key | |
| run: | | |
| echo "DETECTED_EXTENSION_KEY=$(cat composer.json | jq -r '.extra."typo3/cms"."extension-key"' )" >> "$GITHUB_ENV" | |
| - name: Get comment | |
| id: get-comment | |
| run: | | |
| { | |
| echo 'terReleaseNotes<<EOF' | |
| echo "https://github.com/${{ github.repository }}/releases/tag/${{ env.version }}" | |
| echo EOF | |
| } >> "$GITHUB_ENV" | |
| - name: Setup PHP 8.1 | |
| 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: 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 }} | |
| - name: "Render documentation" | |
| run: | | |
| Build/Scripts/runTests.sh -s renderDocumentation && \ | |
| mkdir -p tailor-version-artefact && \ | |
| cd Documentation-GENERATED-temp && \ | |
| zip -r ../tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}-documentation.zip | |
| # 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 | |
| # @todo Revert to release version when https://github.com/softprops/action-gh-release/issues/628 is fixed. | |
| uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 | |
| # 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 | |
| tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}-documentation.zip | |
| LICENSE | |
| fail_on_unmatched_files: true | |
| - name: Publish to TER | |
| run: | | |
| php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.terReleaseNotes }}" ${{ env.version }} \ | |
| --artefact=tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}.zip |