Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 19 additions & 5 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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<<EOF'
echo "$releaseCommentPrependBody"
echo EOF
} >> "$GITHUB_ENV"
fi
{
echo 'terReleaseNotes<<EOF'
echo "https://github.com/fgtclb/academic-persons/releases/tag/${{ env.version }}"
echo "https://github.com/${{ github.repository }}/releases/tag/${{ env.version }}"
echo EOF
} >> "$GITHUB_ENV"

Expand All @@ -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