Skip to content

Commit 6cc12f9

Browse files
committed
new ter-release workflow
1 parent 92e6763 commit 6cc12f9

File tree

1 file changed

+39
-19
lines changed

1 file changed

+39
-19
lines changed

.github/workflows/ter-release.yml

Lines changed: 39 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,54 @@
1-
name: TER release
2-
1+
name: publish
32
on:
43
push:
54
tags:
65
- '*'
7-
86
jobs:
9-
ter-release:
10-
name: TER release
11-
runs-on: ubuntu-latest
7+
publish:
8+
name: Publish new version to TER
9+
if: startsWith(github.ref, 'refs/tags/')
10+
runs-on: ubuntu-20.04
1211
env:
13-
TYPO3_EXTENSION_KEY: 'zabbix_client'
14-
REPOSITORY_URL: 'https://github.com/WapplerSystems/zabbix_client'
12+
TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }}
1513
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
16-
TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }}
17-
TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }}
18-
1914
steps:
20-
- name: Get the version
21-
id: get_version
22-
run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
15+
- name: Checkout repository
16+
uses: actions/checkout@v3
17+
18+
- name: Check tag
19+
run: |
20+
if ! [[ ${{ github.ref }} =~ ^refs/tags/[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
21+
exit 1
22+
fi
23+
24+
- name: Get version
25+
id: get-version
26+
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_ENV
27+
28+
- name: Get comment
29+
id: get-comment
30+
run: |
31+
readonly local comment=$(git tag -n10 -l ${{ env.version }} | sed "s/^[0-9.]*[ ]*//g")
32+
33+
if [[ -z "${comment// }" ]]; then
34+
echo "comment=Released version ${{ env.version }} of ${{ env.TYPO3_EXTENSION_KEY }}" >> $GITHUB_ENV
35+
else
36+
{
37+
echo 'comment<<EOF'
38+
echo "$comment"
39+
echo EOF
40+
} >> "$GITHUB_ENV"
41+
fi
2342
2443
- name: Setup PHP
2544
uses: shivammathur/setup-php@v2
2645
with:
27-
php-version: '7.4'
28-
extensions: intl, mbstring, xml, soap, zip, curl
46+
php-version: 7.4
47+
extensions: intl, mbstring, json, zip, curl
48+
tools: composer:v2
2949

30-
- name: Install EXT:tailor
50+
- name: Install tailor
3151
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest
3252

33-
- name: Upload EXT:${{ env.EXTENSION_KEY }} as ${{ steps.get_version.outputs.VERSION }} to TER
34-
run: php ~/.composer/vendor/bin/tailor ter:publish ${{ steps.get_version.outputs.VERSION }} --artefact=${{ env.REPOSITORY_URL }}/archive/${{ steps.get_version.outputs.VERSION }}.zip --comment="New release of version ${{ steps.get_version.outputs.VERSION }} - see details, changelog and documentation on ${{ env.REPOSITORY_URL }}"
53+
- name: Publish to TER
54+
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ env.comment }}" ${{ env.version }}

0 commit comments

Comments
 (0)