From 56ea652840effed484eec2e339e47467cbab95c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20B=C3=BCrk?= Date: Tue, 1 Jul 2025 08:38:09 +0200 Subject: [PATCH] [TASK] Streamline publish workflow This change streamlines the publish workflow to adopt recently found required changes like pin github-action marketplace roles to avoid issues during releasing on pushed tags. --- .github/workflows/publish.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0fcdea7..504f937 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -10,7 +10,6 @@ jobs: 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 @@ -29,12 +28,25 @@ jobs: 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: | + readonly local releaseCommentPrependBody="$( git tag -l ${{ env.version }} --format '%(contents)' )" + if (( $(grep -c . <<<"${releaseCommentPrependBody// }") > 1 )); then + { + echo 'releaseCommentPrependBody<> "$GITHUB_ENV" + fi { echo 'terReleaseNotes<> "$GITHUB_ENV" @@ -56,17 +68,19 @@ jobs: # 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 + # @todo Revert to release version when https://github.com/softprops/action-gh-release/issues/628 is fixed. + uses: softprops/action-gh-release@da05d552573ad5aba039eaac05058a918a7bf631 if: ${{startsWith(github.ref, 'refs/tags/') }} with: name: "[RELEASE] ${{ env.version }}" + body: "${{ env.releaseCommentPrependBody }}" generate_release_notes: true files: | - tailor-version-artefact/${{ env.TYPO3_EXTENSION_KEY }}_${{ env.version }}.zip + tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}.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.TYPO3_EXTENSION_KEY }}_${{ env.version }}.zip + --artefact=tailor-version-artefact/${{ env.DETECTED_EXTENSION_KEY }}_${{ env.version }}.zip