Skip to content

Commit

Permalink
[TASK] Update github action
Browse files Browse the repository at this point in the history
Use latest commit message as upload comment to TER
  • Loading branch information
mschwemer committed Nov 25, 2024
1 parent 85fa607 commit 1fd7f56
Showing 1 changed file with 29 additions and 2 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/ter-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:

jobs:
ter-release:
if: github.repository == 'in2code-de/fetchurl'
name: TER release
runs-on: ubuntu-latest
env:
Expand All @@ -17,18 +18,44 @@ jobs:
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Get comment
id: get-comment
run: |
readonly local comment=$(git tag -n10 -l ${{ env.version }} | sed "s/^[0-9.]*[ ]*//g")
if [[ -z "${comment// }" ]]; then
echo "comment=Released version ${{ env.version }} of ${{ env.TYPO3_EXTENSION_KEY }}" >> $GITHUB_ENV
else
{
echo 'comment<<EOF'
echo "$comment"
echo EOF
} >> "$GITHUB_ENV"
fi
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.1'
extensions: intl, mbstring, xml, soap, zip, curl
tools: composer:v2

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

- name: Upload EXT:${{ env.EXTENSION_KEY }} as ${{ steps.get_version.outputs.VERSION }} to TER
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 readme and commits on ${{ env.REPOSITORY_URL }}"
- name: Publish to TER
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.comment }}" ${{ env.version }}

0 comments on commit 1fd7f56

Please sign in to comment.