Skip to content

Commit 58c6367

Browse files
committed
Fix publish workflow
1 parent 4190ab7 commit 58c6367

File tree

3 files changed

+45
-15
lines changed

3 files changed

+45
-15
lines changed

.github/workflows/Release.yml

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,46 @@ on:
33
push:
44
tags:
55
- '*'
6+
67
jobs:
7-
release:
8-
runs-on: ubuntu-latest
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_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
14+
915
steps:
10-
- uses: actions/checkout@v1
11-
- uses: the-coding-owl/action-typo3-extension-repository-upload@0.0.1
12-
env:
13-
SECRET_USERNAME: ${{ secrets.USERNAME }}
14-
SECRET_PASSWORD: ${{ secrets.PASSWORD }}
15-
EXTENSION_KEY: 'language_detection'
16-
UPLOAD_MESSAGE: 'Next release :) More information on https://github.com/lochmueller/language_detection/releases'
16+
- name: Checkout repository
17+
uses: actions/checkout@v2
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 language_detection
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: 7.4
41+
extensions: intl, mbstring, json, zip, curl
42+
tools: composer:v2
43+
44+
- name: Install tailor
45+
run: composer global require typo3/tailor --prefer-dist --no-progress
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 }}

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
"phpstan/phpstan": "^1.8",
4141
"infection/infection": "^0.26",
4242
"qossmic/deptrac-shim": "^0.24",
43-
"geoip2/geoip2": "^2.13"
43+
"geoip2/geoip2": "^2.13",
44+
"ssch/typo3-rector": "^1.0"
4445
},
4546
"optimize-autoloader": true,
4647
"config": {

rector.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,13 @@
1313
use Ssch\TYPO3Rector\FileProcessor\TypoScript\Rector\FileIncludeToImportStatementTypoScriptRector;
1414
use Ssch\TYPO3Rector\Rector\v9\v0\InjectAnnotationRector;
1515
use Ssch\TYPO3Rector\Rector\General\ExtEmConfRector;
16+
use Ssch\TYPO3Rector\Set\Typo3LevelSetList;
1617
use Ssch\TYPO3Rector\Set\Typo3SetList;
1718
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
1819

1920
return static function (ContainerConfigurator $containerConfigurator): void {
2021

21-
$containerConfigurator->import(Typo3SetList::TYPO3_76);
22-
$containerConfigurator->import(Typo3SetList::TYPO3_87);
23-
$containerConfigurator->import(Typo3SetList::TYPO3_95);
24-
$containerConfigurator->import(Typo3SetList::TYPO3_104);
25-
// $containerConfigurator->import(Typo3SetList::TYPO3_11);
22+
$containerConfigurator->import(Typo3LevelSetList::UP_TO_TYPO3_12);
2623
$containerConfigurator->import(SetList::CODE_QUALITY);
2724
$containerConfigurator->import(SetList::TYPE_DECLARATION);
2825
$containerConfigurator->import(SetList::TYPE_DECLARATION_STRICT);

0 commit comments

Comments
 (0)