-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add publish via github workflow action.
- Loading branch information
Christian Hellmund
committed
Apr 29, 2021
1 parent
2ad4a16
commit 4f051cb
Showing
1 changed file
with
49 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish: | ||
name: Publish new version to TER | ||
if: startsWith(github.ref, 'refs/tags/') | ||
runs-on: ubuntu-latest | ||
env: | ||
TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }} | ||
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 ${{ env.TYPO3_EXTENSION_KEY }} | ||
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 }} |