Skip to content

Commit f2c886e

Browse files
committed
[TASK] Add publishing TER workflow
1 parent 6683e78 commit f2c886e

File tree

3 files changed

+58
-0
lines changed

3 files changed

+58
-0
lines changed

.github/workflows/publish.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tag:
6+
7+
jobs:
8+
publish:
9+
name: Publish new version to TER
10+
if: startsWith(github.ref, 'refs/tags/')
11+
runs-on: ubuntu-20.04
12+
env:
13+
TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }}
14+
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
15+
16+
steps:
17+
- name: Checkout repository
18+
uses: actions/checkout@v2
19+
20+
- name: Check tag
21+
run: |
22+
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
23+
exit 1
24+
fi
25+
- name: Get version
26+
id: get-version
27+
run: echo ::set-output name=version::${GITHUB_REF/refs\/tags\//}
28+
29+
- name: Get comment
30+
id: get-comment
31+
run: |
32+
readonly local comment=$(git tag -n10 -l ${{ steps.get-version.outputs.version }} | sed "s/^[0-9.]*[ ]*//g")
33+
if [[ -z "${comment// }" ]]; then
34+
echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of ${{ env.TYPO3_EXTENSION_KEY }}
35+
else
36+
echo ::set-output name=comment::$comment
37+
fi
38+
- name: Setup PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: 7.4
42+
extensions: intl, mbstring, json, zip, curl
43+
44+
- name: Install tailor
45+
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest
46+
47+
- name: Publish to TER
48+
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }}

.gitignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/.idea/
2+
/.php_cs.cache
3+
/.DS_Store
4+
/vendor
5+
/.env
6+
/composer.lock
7+
/.phpunit.result.cache

composer.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,8 @@
2222
"psr-4": {
2323
"B13\\Codeblock\\": "Classes/"
2424
}
25+
},
26+
"require-dev": {
27+
"typo3/tailor": "^1.2"
2528
}
2629
}

0 commit comments

Comments
 (0)