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
64 changes: 32 additions & 32 deletions .github/workflows/pull-request-version.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
name: "Check plugin version and tags"
name: 'Check plugin version and tags'
on:
pull_request:
branches:
- main
pull_request:
branches:
- main

jobs:
version-check:
name: "Check version doesn't not already exists."
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
version-check:
name: "Check version doesn't not already exists."
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: set-vars
name: "Set variables from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"
- id: set-vars
name: 'Set variables from .plugin-data file'
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: version-check
name: "Check version in .plugin-data is not existing"
run: |
# Check version from .plugin-data
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
- id: version-check
name: 'Check version in .plugin-data is not existing'
run: |
# Check version from .plugin-data
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag aleady exists please update the .plugin-data file to good version";
exit 1;
fi
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag aleady exists please update the .plugin-data file to good version";
exit 1;
fi
52 changes: 26 additions & 26 deletions .github/workflows/quality-js.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
name: Javascript Quality Checks

on:
pull_request:
paths:
- 'src/**'
push:
paths:
- 'src/**'
branches:
- main
pull_request:
paths:
- 'src/**'
push:
paths:
- 'src/**'
branches:
- main

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
checks:
name: Lint JS
runs-on: ubuntu-latest
checks:
name: Lint JS
runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v3
steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'

- name: Install npm dependencies
run: npm install
- name: Install npm dependencies
run: npm install

- name: Run wp-script lint:js on src folder
run: npm run lint:js src
- name: Run wp-script lint:js on src folder
run: npm run lint:js src
62 changes: 31 additions & 31 deletions .github/workflows/quality-php.yml
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
name: PHP Quality Checks

on:
pull_request:
paths:
- 'composer.json'
- 'blockparty-key-figure.php'
push:
paths:
- 'composer.json'
- 'blockparty-key-figure.php'
branches:
- main
pull_request:
paths:
- 'composer.json'
- 'blockparty-key-figure.php'
push:
paths:
- 'composer.json'
- 'blockparty-key-figure.php'
branches:
- main

# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true

jobs:
checks:
name: Codesniffer
runs-on: ubuntu-latest
checks:
name: Codesniffer
runs-on: ubuntu-latest

steps:
- name: Checkout project
uses: actions/checkout@v3
steps:
- name: Checkout project
uses: actions/checkout@v3

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: mbstring, intl
- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
extensions: mbstring, intl

- name: Validate composer file
run: composer validate
- name: Validate composer file
run: composer validate

- name: Install composer dependencies
run: composer install
- name: Install composer dependencies
run: composer install

- name: Run codesniffer
run: composer cs
- name: Run codesniffer
run: composer cs
128 changes: 64 additions & 64 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,77 +1,77 @@
name: "Release new TAG"
name: 'Release new TAG'
on:
push:
branches:
- main
push:
branches:
- main

jobs:
build-and-release:
name: "Release new TAG"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0
build-and-release:
name: 'Release new TAG'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
fetch-depth: 0

- id: set-vars
name: "Set variable from .plugin-data file"
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"
- id: set-vars
name: 'Set variable from .plugin-data file'
run: |
# Get all data from .plugin-data file
content=`cat ./.plugin-data`
# the following lines are only required for multi line json
content="${content//'%'/'%25'}"
content="${content//$'\n'/'%0A'}"
content="${content//$'\r'/'%0D'}"
# end of optional handling for multi line json
echo "::set-output name=pluginData::$content"

- id: check-version
name: "Check version does not exists"
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
- id: check-version
name: 'Check version does not exists'
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

echo "Get Branch tag"
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag already exists, stop now";
exit 1;
fi
echo "Get Branch tag"
if git rev-parse "$VERSION" >/dev/null 2>&1; then
echo "Tag already exists, stop now";
exit 1;
fi

- id: build-node
name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: npm install
- run: npm run build
- id: build-node
name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- run: npm install
- run: npm run build

- id: build-php
name: "Build project PHP"
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs
- id: build-php
name: 'Build project PHP'
uses: shivammathur/setup-php@v2
with:
php-version: 8.1
- run: composer install --prefer-dist --no-dev -o --ignore-platform-reqs

- id: commit-and-push
name: "Commit and push new TAG"
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}
- id: commit-and-push
name: 'Commit and push new TAG'
run: |
# Get the version from .plugin-data file.
VERSION=${{fromJson(steps.set-vars.outputs.pluginData).version}}

echo "Copy .distignore to .gitignore"
cp .distignore .gitignore
echo "Copy .distignore to .gitignore"
cp .distignore .gitignore

echo "Configure git"
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"
echo "Configure git"
git config --local user.email "$(git log --format='%ae' HEAD^!)"
git config --local user.name "$(git log --format='%an' HEAD^!)"

echo "Creating branch"
git checkout -b release/{$VERSION}
echo "Creating branch"
git checkout -b release/{$VERSION}

echo "Creating tag ${VERSION}"
git add .
git add -u
git commit -m "Release version ${VERSION}"
git tag ${VERSION}
git push --tags
echo "Creating tag ${VERSION}"
git add .
git add -u
git commit -m "Release version ${VERSION}"
git tag ${VERSION}
git push --tags
Loading