Skip to content

Commit b14759d

Browse files
committed
Add custom p2p facet
1 parent 22cc1a2 commit b14759d

17 files changed

+8347
-0
lines changed

.distignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.gitignore
2+
.plugin-data
3+
composer.json
4+
composer.lock
5+
.github

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
/.git export-ignore
2+
/.github export-ignore
3+
/.distignore export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.plugin-data export-ignore
7+
/CHANGELOG.md export-ignore
8+
/grumphp.yml export-ignore
9+
/phpcs.xml.dist export-ignore
10+
/psalm.xml export-ignore
11+
/README.md export-ignore
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
2+
name: "Check plugin version and tags"
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
version-check:
10+
name: "Check version doesn't not already exists."
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
18+
- id: set-vars
19+
name: "Set variables from .plugin-data file"
20+
run: |
21+
# Get all data from .plugin-data file
22+
content=`cat ./.plugin-data`
23+
# the following lines are only required for multi line json
24+
content="${content//'%'/'%25'}"
25+
content="${content//$'\n'/'%0A'}"
26+
content="${content//$'\r'/'%0D'}"
27+
# end of optional handling for multi line json
28+
echo "::set-output name=pluginData::$content"
29+
30+
- id: version-check
31+
name: "Check version in .plugin-data is not existing"
32+
run: |
33+
# Check version from .plugin-data
34+
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
35+
36+
if git rev-parse "$VERSION" >/dev/null 2>&1; then
37+
echo "Tag aleady exists please update the .plugin-data file to good version";
38+
exit 1;
39+
fi

.github/workflows/quality-php.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: PHP Quality Checks
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- main
8+
9+
# Cancels all previous workflow runs for pull requests that have not completed.
10+
concurrency:
11+
# The concurrency group contains the workflow name and the branch name for pull requests
12+
# or the commit hash for any other events.
13+
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
14+
cancel-in-progress: true
15+
16+
jobs:
17+
checks:
18+
name: Codesniffer
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout project
23+
uses: actions/checkout@v3
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: 8.3
29+
extensions: mbstring, intl
30+
31+
- name: Validate composer file
32+
run: composer validate
33+
34+
- name: Install composer dependencies
35+
run: composer install
36+
37+
- name: Run codesniffer
38+
run: composer cs

.github/workflows/release.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: "Release new TAG"
2+
on:
3+
push:
4+
branches:
5+
- main
6+
7+
jobs:
8+
build-and-release:
9+
name: "Release new TAG"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v3
14+
with:
15+
fetch-depth: 0
16+
17+
- id: set-vars
18+
name: "Set variable from .plugin-data file"
19+
run: |
20+
# Get all data from .plugin-data file
21+
content=`cat ./.plugin-data`
22+
# the following lines are only required for multi line json
23+
content="${content//'%'/'%25'}"
24+
content="${content//$'\n'/'%0A'}"
25+
content="${content//$'\r'/'%0D'}"
26+
# end of optional handling for multi line json
27+
echo "::set-output name=pluginData::$content"
28+
29+
- id: check-version
30+
name: "Check version does not exists"
31+
run: |
32+
# Get the version from .plugin-data file.
33+
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
34+
35+
echo "Get Branch tag"
36+
if git rev-parse "$VERSION" >/dev/null 2>&1; then
37+
echo "Tag already exists, stop now";
38+
exit 1;
39+
fi
40+
- id: build-php
41+
name: "Build project PHP"
42+
uses: shivammathur/setup-php@v2
43+
with:
44+
php-version: 8.3
45+
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs
46+
47+
- id: commit-and-push
48+
name: "Commit and push new TAG"
49+
run: |
50+
# Get the version from .plugin-data file.
51+
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
52+
53+
echo "Copy .distignore to .gitignore"
54+
cp .distignore .gitignore
55+
56+
echo "Configure git"
57+
git config --local user.email "$(git log --format='%ae' HEAD^!)"
58+
git config --local user.name "$(git log --format='%an' HEAD^!)"
59+
60+
echo "Creating branch"
61+
git checkout -b release/{$VERSION}
62+
63+
echo "Creating tag ${VERSION}"
64+
git add .
65+
git add -u
66+
git commit -m "Release version ${VERSION}"
67+
git tag ${VERSION}
68+
git push --tags

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# Logs
2+
logs
3+
*.log
4+
5+
# Compiled binary addons (https://nodejs.org/api/addons.html)
6+
/vendor/

.plugin-data

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"version": "1.0.0",
3+
"slug": "wp-grid-builder-p2p"
4+
}

0 commit comments

Comments
 (0)