Skip to content

Commit

Permalink
✨ first automatic TER release
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanti committed Nov 30, 2022
1 parent 90e945d commit 168e779
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions .github/workflows/tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,47 @@ jobs:
- run: composer install --no-interaction --no-progress
- run: ./vendor/bin/grumphp run --ansi
- run: composer test

ter-release:
name: TER release
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
needs: [ lint-php ]
env:
TYPO3_EXTENSION_KEY: 'mail_logger'
REPOSITORY_URL: 'https://github.com/pluswerk/mail_logger/'
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }}
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}

steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
extensions: intl, mbstring, xml, soap, zip, curl

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

- name: Upload EXT:mail_logger to TER
run: |
sed -i 's/\\Composer\\InstalledVersions::getPrettyVersion('\''pluswerk\/mail_logger'\'')/'\''${{ steps.get_version.outputs.VERSION }}'\''/g' ext_emconf.php \
&& git config --global user.email "no@one" \
&& git config --global user.name "No One" \
&& git add ext_emconf.php \
&& git commit -m 'x' -n \
&& git archive -o archive.zip HEAD --prefix=mail_logger-${{ steps.get_version.outputs.VERSION }}/ \
&& git reset --hard HEAD~ \
&& curl -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/pluswerk/mail_logger/releases/tags/${{ steps.get_version.outputs.VERSION }} > release.json \
&& php ~/.composer/vendor/bin/tailor ter:publish ${{ steps.get_version.outputs.VERSION }} --artefact=archive.zip \
--comment="$(cat release.json | jq -r '.name')
$(cat release.json | jq -r '.body')
$(cat release.json | jq -r '.html_url')"

0 comments on commit 168e779

Please sign in to comment.