[GITHUB] Auto-release new TYPO3 extensions from github to TER

[GITHUB] Auto-release new TYPO3 extensions from github to TER

Github actions gives you the possibility to run some code after a special trigger (e.g. a push into a repo) is recognized. This can be used for running tests or - in our case - to deploy the software to TYPO3 TER when a new tag is pushed.

By the way, this works much easier than you might think:

1) First of all, you should login on extensions.typo3.org and create some access token (API Token) to use the new REST API of typo3.org to publish your extensions (see https://github.com/TYPO3/tailor#prerequisites)

2) After that you can add three secret tokens in your github repository (see https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#creating-encrypted-secrets-for-an-environment for details):

TYPO3_API_USERNAME (your username for FE-login on typo3.org)
TYPO3_API_PASSWORD (your password for FE-login on typo3.org)
TYPO3_API_TOKEN (see 1 above)

Those secrets can be used as environment variable now.

3) Just add .github/workflows/ter-release.yml (see below) to your repository. Update line 13 and 14 with your configuration.

4) Done :)

ter-release.yml:

name: TER release on: push: tags: - '*' jobs: ter-release: name: TER release runs-on: ubuntu-latest env: TYPO3_EXTENSION_KEY: 'lux' REPOSITORY_URL: 'https://github.com/in2code-de/lux' TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }} TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }} steps: - 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 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 details, changelog and documentation on ${{ env.REPOSITORY_URL }}"

Inspired from:
https://github.com/TYPO3/tailor/blob/main/README.md
https://www.felixnagel.com/blog/artikel/2020/06/23/automated-typo3-ter-releases-using-github-actions/

Used (e.g.) in extension lux:

https://github.com/in2code-de/lux

TYPO3: Finding unused files in fileadmin

Do you want to delete unused or orphaned files in fileadmin or another storage location? Unfortunately, there's no direct core functionality for this. But a small command in your site package can...

Go to news

TYPO3: Editors with individual user_upload folders

Perhaps you're familiar with this client requirement? Editors should be able to add videos using the "Add media by URL" button. But the files shouldn't be located in fileadmin/user_upload/, but rather...

Go to news

TYPO3: Finding pages in mixed mode

In TYPO3, Mixed Mode refers to translated pages that contain content only partially related to the corresponding content in the main language. This is indicated in the backend by an error message. But...

Go to news

Extbase Extensions: Think extensibility with data, site and language

Today, I have a small request for the TYPO3 extension authors out there: Make sure your extensions are extensible. This will also promote the distribution of the corresponding plugins.

Go to news

SQL: Show all tables sorted by size in descending order

Lately I've been using the SQL command more often to find out which tables in the TYPO3 database are the largest. I've published the snippet once.

Go to news

TYPO3 12 with CKEditor 5: Styles in a single selection

If you set a link in the RTE in TYPO3, you may have to choose between different link classes, for example to create buttons in the frontend. What's new in TYPO3 12 is that you can select not just one...

Go to news