Skip to content
Closed
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
27 changes: 27 additions & 0 deletions .distignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/.git
/.github
/.wordpress-org
/node_modules
/src
/tests

.distignore
.editorconfig
.eslintrc
.gitattributes
.gitignore
.plugin-data
.stylelintrc
.wp-env.json
CHANGELOG.md
composer.json
composer.lock
grumphp.yml
LICENSE.md
package.json
package-lock.json
phpcs.xml.dist
phpunit.xml.dist
README.md
webpack.config.js
yarn.lock
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = tab

[*.{yml,yaml}]
indent_style = space
indent_size = 2
30 changes: 30 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/.git export-ignore
/.github export-ignore
/.wordpress-org export-ignore
/src/ export-ignore -diff
/vendor/ export-ignore -diff
/node_modules export-ignore
/tests export-ignore

/.distignore export-ignore
/.editorconfig export-ignore
/.eslintrc export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.plugin-data export-ignore
/.stylelintrc export-ignore
/.wp-env.json export-ignore
/.wp-env.test.json export-ignore
/CHANGELOG.md export-ignore
/composer.json export-ignore
/composer.lock export-ignore -diff
/eslint.config.cjs export-ignore -diff
/grumphp.yml export-ignore
/LICENSE.md export-ignore
/package.json export-ignore
/package-lock.json export-ignore -diff
/phpcs.xml.dist export-ignore
/phpunit.xml.dist export-ignore
/README.md export-ignore
/webpack.config.js export-ignore
/yarn.lock export-ignore
Binary file added .github/banner-github.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions .github/workflows/pull-request-version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: "Check plugin version and release files"
on:
pull_request:
branches:
- main

jobs:
version-check:
name: "Version bump, tag, and file checks"
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v7
with:
fetch-depth: 0

- name: Fetch tags
run: git fetch --tags --prune origin

- name: Verify version bump and release files
env:
BASE_SHA: ${{ github.event.pull_request.base.sha }}
HEAD_SHA: ${{ github.event.pull_request.head.sha }}
run: tests/bin/check-release-version.sh
48 changes: 48 additions & 0 deletions .github/workflows/quality-js.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Javascript Quality Checks

on:
pull_request:
paths:
- 'src/**'
- '.stylelintrc'
- 'package.json'
- 'package-lock.json'
push:
paths:
- 'src/**'
- '.stylelintrc'
- 'package.json'
- 'package-lock.json'
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

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

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

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

- name: Install npm dependencies
run: npm ci

- name: Run wp-script lint:js on src folder
run: npm run lint:js src

- name: Run stylelint on SCSS
run: npm run lint:css -- "src/**/*.scss"
48 changes: 48 additions & 0 deletions .github/workflows/quality-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: PHP Quality Checks

on:
pull_request:
paths:
- 'composer.json'
- 'blockparty-button-icon.php'
- 'classes/**'
- 'phpcs.xml.dist'
push:
paths:
- 'composer.json'
- 'blockparty-button-icon.php'
- 'classes/**'
- 'phpcs.xml.dist'
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

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

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

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

- name: Validate composer file
run: composer validate

- name: Install composer dependencies
run: composer install

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

permissions:
contents: write

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

- name: Fetch tags
run: git fetch --tags --prune origin

- id: set-vars
name: "Set variable from .plugin-data file"
run: |
{
echo 'pluginData<<EOF'
cat ./.plugin-data
echo 'EOF'
} >> "$GITHUB_OUTPUT"

- 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

if git ls-remote --exit-code --tags origin "refs/tags/${VERSION}" >/dev/null 2>&1; then
echo "Remote tag already exists, stop now";
exit 1;
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Release job fails after first tag

High Severity

The main-branch release workflow treats an already-published .plugin-data version as a hard failure. After 1.0.0 is tagged, every later push to main that does not bump the version exits with status 1, so the release job stays red until the next version change.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit aa40619. Configure here.


- id: build-node
name: Setup NodeJS
uses: actions/setup-node@v7
with:
node-version-file: 'package.json'
cache: 'npm'
- run: npm ci
- 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: 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 "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 tag ${VERSION}"
git add .
git add -u
git commit -m "Release version ${VERSION}"
git tag ${VERSION}
git push --tags
Loading
Loading