From db532b8e3317146caa8c646b5553fe01ab027502 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20Lochmu=CC=88ller?= Date: Tue, 15 Nov 2022 16:34:25 +0100 Subject: [PATCH] Add Github workflows --- .github/FUNDING.yml | 4 +++ .github/workflows/Release.yml | 48 +++++++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/Release.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..8078b7b --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,4 @@ +# These are supported funding model platforms + +github: lochmueller +custom: ['https://paypal.me/lochmueller'] diff --git a/.github/workflows/Release.yml b/.github/workflows/Release.yml new file mode 100644 index 0000000..de1ae5f --- /dev/null +++ b/.github/workflows/Release.yml @@ -0,0 +1,48 @@ +name: Release + +on: + push: + tags: + - '*' + +jobs: + publish: + name: Publish new version to TER + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-20.04 + env: + TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - 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 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 ${{ steps.get-version.outputs.version }} | sed "s/^[0-9.]*[ ]*//g") + if [[ -z "${comment// }" ]]; then + echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of html5videoplayer + else + echo ::set-output name=comment::$comment + fi + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: 7.4 + extensions: intl, mbstring, json, zip, curl + + - name: Install tailor + run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest + + - name: Publish to TER + run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }}