Skip to content

Commit 075c29f

Browse files
committed
[TASK] Add publish workflow
1 parent a3ea5e5 commit 075c29f

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

.github/workflows/publish.yaml

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

0 commit comments

Comments
 (0)