Skip to content

Commit d382e57

Browse files
committed
[TASK] Use git commit message for ter upload comment
1 parent 04a010c commit d382e57

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

.github/workflows/ter-release.yml

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,44 @@ jobs:
2121
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}
2222

2323
steps:
24+
- name: Checkout repository
25+
uses: actions/checkout@v3
26+
27+
- name: Check tag
28+
run: |
29+
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
30+
exit 1
31+
fi
32+
2433
- name: Get the version
2534
id: get_version
26-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
35+
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
36+
37+
- name: Get comment
38+
id: get-comment
39+
run: |
40+
readonly local comment=$(git tag -n10 -l ${{ env.version }} | sed "s/^[0-9.]*[ ]*//g")
41+
42+
if [[ -z "${comment// }" ]]; then
43+
echo "comment=Released version ${{ env.version }} of ${{ env.TYPO3_EXTENSION_KEY }}" >> $GITHUB_ENV
44+
else
45+
{
46+
echo 'comment<<EOF'
47+
echo "$comment"
48+
echo EOF
49+
} >> "$GITHUB_ENV"
50+
fi
2751
2852
- name: Setup PHP
2953
uses: shivammathur/setup-php@v2
3054
with:
3155
php-version: '7.4'
3256
extensions: intl, mbstring, xml, soap, zip, curl
57+
tools: composer:v2
3358

3459
- name: Install EXT:tailor
3560
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest
3661

37-
- name: Upload EXT:${{ env.EXTENSION_KEY }} as ${{ steps.get_version.outputs.VERSION }} to TER
38-
run: php ~/.composer/vendor/bin/tailor ter:publish ${{ steps.get_version.outputs.VERSION }} --artefact=${{ env.REPOSITORY_URL }}/archive/${{ steps.get_version.outputs.VERSION }}.zip --comment="New release of version ${{ steps.get_version.outputs.VERSION }} - see details, changelog and documentation on ${{ env.REPOSITORY_URL }}"
62+
- name: Publish to TER
63+
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.comment }}" ${{ env.version }}
64+

0 commit comments

Comments
 (0)