|
1 | | -name: TER release |
2 | | - |
| 1 | +name: publish |
3 | 2 | on: |
4 | 3 | push: |
5 | 4 | tags: |
6 | 5 | - '*' |
7 | | - |
8 | 6 | 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 |
12 | 11 | env: |
13 | | - TYPO3_EXTENSION_KEY: 'zabbix_client' |
14 | | - REPOSITORY_URL: 'https://github.com/WapplerSystems/zabbix_client' |
| 12 | + TYPO3_EXTENSION_KEY: ${{ secrets.TYPO3_EXTENSION_KEY }} |
15 | 13 | TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }} |
16 | | - TYPO3_API_USERNAME: ${{ secrets.TYPO3_API_USERNAME }} |
17 | | - TYPO3_API_PASSWORD: ${{ secrets.TYPO3_API_PASSWORD }} |
18 | | - |
19 | 14 | 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 |
23 | 42 |
|
24 | 43 | - name: Setup PHP |
25 | 44 | uses: shivammathur/setup-php@v2 |
26 | 45 | 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 |
29 | 49 |
|
30 | | - - name: Install EXT:tailor |
| 50 | + - name: Install tailor |
31 | 51 | run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest |
32 | 52 |
|
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