Publish Release #17
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: 'Tag of the release to upload to TER.' | |
required: true | |
mode: | |
description: 'Release Mode' | |
required: true | |
default: 'draft' | |
type: choice | |
options: | |
- draft | |
- publish | |
env: | |
TYPO3_EXTENSION_KEY: introduction | |
jobs: | |
create_release: | |
name: Publish release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Setup PHP | |
uses: shivammathur/setup-php@v2 | |
with: | |
php-version: 7.4 | |
extensions: intl, mbstring, json, zip, curl | |
tools: composer:v2 | |
- name: Install Tailor | |
run: composer global require typo3/tailor --prefer-dist --no-progress | |
- name: Get release | |
id: release | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
uses: cardinalby/git-get-release-action@v1 | |
with: | |
tag: ${{ github.event.inputs.tag }} | |
- name: Publish to TER | |
env: | |
GITHUB_ARTEFACT: ${{ github.server_url }}/${{ github.repository }}/archive/refs/tags/${{ steps.release.outputs.tag_name }}.zip | |
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_ACCESS_TOKEN }} | |
run: | | |
test -n "$TYPO3_API_TOKEN" && TOKEN_STATUS=Found || TOKEN_STATUS=Missing | |
echo "Artefact: $GITHUB_ARTEFACT" | |
echo "Extension Key: $TYPO3_EXTENSION_KEY" | |
echo "API Token: $TOKEN_STATUS" | |
test -z "$TYPO3_API_TOKEN" && echo "Secret \"TYPO3_API_ACCESS_TOKEN\" is missing, aborting." && exit 1 | |
test "${{ github.event.inputs.mode }}" != "publish" && echo "Publishing to TER skipped." && exit 0 | |
test "${{ github.event.inputs.mode }}" == "publish" && composer global exec -- tailor ter:publish --artefact "$GITHUB_ARTEFACT" --comment "${{ steps.release.outputs.body }}" -- ${{ steps.release.outputs.tag_name }} |