Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 24 additions & 17 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,36 +1,43 @@
# EditorConfig is awesome: http://EditorConfig.org

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending every file
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.php]
indent_size = 4
indent_style = space

[*.{html,js,css}]
indent_size = 4
# JSON-Files
[*.json]
indent_style = tab

[*.{yml,txt,md,sql}]
indent_size = 2
[composer.json]
indent_style = space

[*.json]
# ReST files
[{*.rst,*.rst.txt}]
indent_size = 4
indent_style = space
max_line_length = 80

[*.{xml,xlf,xsd}]
indent_size = 2
indent_style = tab
# MD-Files
[*.md]
indent_size = 4
max_line_length = 80

[*.{yml,yaml}]
# YAML-Files
[{*.yml,*.yaml}]
indent_size = 2

[*.typoscript]
indent_size = 4
# XLF-Files
[*.xlf]
indent_style = tab

# SQL-Files
[*.sql]
indent_style = tab
indent_size = 2
9 changes: 0 additions & 9 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
* text=auto
*.css linguist-vendored
*.scss linguist-vendored

# Enforce checkout with linux lf consistent over all platforms
*.html text eol=lf
*.css text eol=lf
*.tmpl text eol=lf
*.less text eol=lf
*.scss text eol=lf
*.js text eol=lf
*.json text eol=lf
*.php text eol=lf
*.rst text eol=lf
*.md text eol=lf
*.yml text eol=lf
*.yaml text eol=lf
*.ts text eol=lf
*.typoscript text eol=lf
*.xlf text eol=lf
*.sh text eol=lf
*.sql text eol=lf
*.t3s text eol=lf
*.txt text eol=lf

/Documentation export-ignore
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ assignees: ''

## Prerequisites

* [ ] Can you reproduce the problem on TYPO3 v11.5 LTS
* [ ] Can you reproduce the problem on TYPO3 v12.4 LTS
* [ ] Can you reproduce the problem on TYPO3 v13.4 LTS
* [ ] Can you reproduce the problem on TYPO3 dev-main
* [ ] Did you [perform a search](https://github.com/simonschaufi/lock_element/issues)
to see if your bug or enhancement is already reported?
Expand Down
4 changes: 1 addition & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,8 @@

## Prerequisites

* [ ] Changes have been tested on TYPO3 v12.4 LTS
* [ ] Changes have been tested on TYPO3 v11.5 LTS
* [ ] Changes have been tested on TYPO3 v13.4 LTS
* [ ] Changes have been tested on TYPO3 dev-main
* [ ] Changes have been tested on PHP 7.4
* [ ] Changes have been tested on PHP 8.x
* [ ] Changes have been checked for CGL compliance `php-cs-fixer fix`

Expand Down
88 changes: 88 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: CI with Composer scripts
on:
push:
paths:
- '**.php'
- '.github/workflows/ci.yml'
- 'composer.json'
branches:
- main
pull_request:

permissions:
contents: read

jobs:
php-lint:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
php: [8.2, 8.3, 8.4]

name: "PHP linter - ${{ matrix.php }}"

steps:
- name: "Checkout code"
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none

- name: "Run PHP lint"
run: find .*.php *.php Classes Configuration Tests -name '*.php' -print0 | xargs -r -0 -n 1 -P 4 php -l

code-quality:
runs-on: ubuntu-latest
timeout-minutes: 5
strategy:
fail-fast: true
matrix:
command:
- "composer:normalize"
- "composer:psr-verify"
- "php:ecs"
- "php:rector"
- "php:fractor"
- "yaml:lint"
- "xliff:lint"
php: [8.2]

name: "Code quality checks"

steps:
- name: "Checkout code"
uses: actions/checkout@v4

- name: "Setup PHP"
uses: shivammathur/setup-php@v2
with:
php-version: "${{ matrix.php }}"
coverage: none
tools: composer:v2

- name: "Show Composer version"
run: composer --version

- name: "Show the Composer configuration"
run: composer config --global --list

- name: "Cache dependencies installed with composer"
uses: actions/cache@v4
with:
key: "php${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}"
path: ~/.cache/composer
restore-keys: "php${{ matrix.php }}-composer-\n"

- name: "Install Composer dependencies"
run: composer install --no-progress

- name: "List Installed Dependencies"
run: composer show -D

- name: "Run command"
run: composer ci:${{ matrix.command }}
48 changes: 48 additions & 0 deletions .github/workflows/dependabot-auto-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copied from https://github.com/spatie/package-skeleton-laravel/blob/main/.github/workflows/dependabot-auto-merge.yml
# See https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#enable-auto-merge-on-a-pull-request
name: dependabot-auto-merge

# We're using pull_request_target instead of pull_request due to permission issues with the pull_request target:
# https://docs.github.com/en/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#responding-to-events
on: pull_request_target

permissions:
pull-requests: write
contents: write

jobs:
dependabot:
name: "Dependabot auto-merge"
runs-on: ubuntu-latest
timeout-minutes: 5

if: ${{ github.actor == 'dependabot[bot]' }}

steps:
- name: "Dependabot metadata"
# https://docs.github.com/en/enterprise-cloud@latest/code-security/dependabot/working-with-dependabot/automating-dependabot-with-github-actions#fetch-metadata-about-a-pull-request
id: metadata
uses: dependabot/fetch-metadata@v2.4.0
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

# does not work, see https://github.com/dependabot/fetch-metadata/issues/499
# - name: "Auto-merge Dependabot PRs for semver-minor updates"
# if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-minor' }}
# run: gh pr merge --auto --rebase "$PR_URL"
# env:
# PR_URL: "${{ github.event.pull_request.html_url }}"
# github-token: "${{ secrets.GITHUB_TOKEN }}"
#
# - name: "Auto-merge Dependabot PRs for semver-patch updates"
# if: ${{ steps.metadata.outputs.update-type == 'version-update:semver-patch' }}
# run: gh pr merge --auto --rebase "$PR_URL"
# env:
# PR_URL: "${{ github.event.pull_request.html_url }}"
# github-token: "${{ secrets.GITHUB_TOKEN }}"

- name: "Enable auto-merge"
if: ${{ steps.metadata.outputs.dependency-type == 'direct:development' }}
run: gh pr merge -R "${{ github.repository }}" --squash --auto "${{ github.event.pull_request.number }}"
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
48 changes: 0 additions & 48 deletions .github/workflows/php_cs_fixer.yaml

This file was deleted.

48 changes: 8 additions & 40 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,18 @@
name: publish
name: Publish

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- "**"

jobs:
publish:
name: Publish new version to TER
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-20.04
env:
TYPO3_API_TOKEN: ${{ secrets.TYPO3_API_TOKEN }}
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: "Checkout"
uses: actions/checkout@v4

- name: Check tag
run: |
if ! [[ ${{ github.ref }} =~ ^refs/tags/v[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}$ ]]; then
exit 1
fi

- name: Get version
id: get-version
run: echo ::set-output name=version::${GITHUB_REF#refs/tags/v}

- name: Get comment
id: get-comment
run: |
readonly local comment=$(git tag -n10 -l v${{ steps.get-version.outputs.version }} | sed "s/^v[0-9.]*[ ]*//g")

if [[ -z "${comment// }" ]]; then
echo ::set-output name=comment::Released version ${{ steps.get-version.outputs.version }} of ${{ env.TYPO3_EXTENSION_KEY }}
else
echo ::set-output name=comment::$comment
fi

- name: Setup PHP
uses: shivammathur/setup-php@v2
- name: "Publish new version to TER"
uses: tomasnorre/typo3-upload-ter@v2
with:
php-version: 8.3
extensions: intl, mbstring, json, zip, curl

- name: Install tailor
run: composer global require typo3/tailor --prefer-dist --no-progress --no-suggest

- name: Publish to TER
run: php ~/.composer/vendor/bin/tailor ter:publish --comment "${{ steps.get-comment.outputs.comment }}" ${{ steps.get-version.outputs.version }}
api-token: ${{ secrets.TYPO3_API_TOKEN }}
39 changes: 0 additions & 39 deletions .github/workflows/tests.yml

This file was deleted.

Loading