From 71fe3e78980ca63ba5254df2dbe337b3c490fd63 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 24 Apr 2026 11:26:40 +0100 Subject: [PATCH 1/3] [CHORE] Use .gitattributes to ignore export files list --- .gitattributes | 18 ++++++++++++++++++ .github/workflows/release.yml | 35 ++--------------------------------- .github/workflows/test.yml | 16 +--------------- 3 files changed, 21 insertions(+), 48 deletions(-) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..dd18762 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,18 @@ +# Files and directories excluded from git archive / release zips. +# The leading slash anchors a pattern to the repo root so that e.g. +# /vendor/ is excluded but includes/vendor/ is kept. + +/.github/ export-ignore +/.gitattributes export-ignore +/.gitignore export-ignore +/.wp-env.json export-ignore +/_build/ export-ignore +/docs/ export-ignore +/tests/ export-ignore +/vendor/ export-ignore +/composer.json export-ignore +/composer.lock export-ignore +/phpunit.xml export-ignore +/phpcs.xml export-ignore +/GitVersion.yml export-ignore +/README.md export-ignore diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7e8be8d..3558e04 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -80,21 +80,7 @@ jobs: - name: Stage plugin under its slug directory run: | mkdir -p /tmp/ipquery - rsync -a \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.gitignore' \ - --exclude='.wp-env.json' \ - --exclude='docs' \ - --exclude='tests' \ - --exclude='/vendor' \ - --exclude='composer.json' \ - --exclude='composer.lock' \ - --exclude='phpunit.xml' \ - --exclude='phpcs.xml' \ - --exclude='GitVersion.yml' \ - --exclude='README.md' \ - ./ /tmp/ipquery/ + git archive HEAD | tar -x -C /tmp/ipquery - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1 @@ -155,24 +141,7 @@ jobs: env: VERSION: ${{ needs.version.outputs.fullSemVer }} run: | - mkdir -p /tmp/ipquery - rsync -a \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.gitignore' \ - --exclude='.wp-env.json' \ - --exclude='docs' \ - --exclude='tests' \ - --exclude='/vendor' \ - --exclude='composer.json' \ - --exclude='composer.lock' \ - --exclude='phpunit.xml' \ - --exclude='phpcs.xml' \ - --exclude='GitVersion.yml' \ - --exclude='README.md' \ - ./ /tmp/ipquery/ - cd /tmp - zip -r "ipquery-${VERSION}.zip" ipquery/ + git archive HEAD --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip" echo "ZIP=/tmp/ipquery-${VERSION}.zip" >> "$GITHUB_ENV" - name: Publish GitHub Release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 54e02f6..a9b590d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,21 +72,7 @@ jobs: - name: Stage plugin under its slug directory run: | mkdir -p /tmp/ipquery - rsync -a \ - --exclude='.git' \ - --exclude='.github' \ - --exclude='.gitignore' \ - --exclude='.wp-env.json' \ - --exclude='docs' \ - --exclude='tests' \ - --exclude='/vendor' \ - --exclude='composer.json' \ - --exclude='composer.lock' \ - --exclude='phpunit.xml' \ - --exclude='phpcs.xml' \ - --exclude='GitVersion.yml' \ - --exclude='README.md' \ - ./ /tmp/ipquery/ + git archive HEAD | tar -x -C /tmp/ipquery - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1 From 40cf303be5ad2c5215b9ca133efc8c9077555f61 Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 24 Apr 2026 11:31:44 +0100 Subject: [PATCH 2/3] Fix format --- .github/workflows/release.yml | 6 ++++-- .github/workflows/test.yml | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3558e04..7ead801 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,9 +78,11 @@ jobs: - uses: actions/checkout@v6 - name: Stage plugin under its slug directory + env: + VERSION: ${{ needs.version.outputs.fullSemVer }} run: | mkdir -p /tmp/ipquery - git archive HEAD | tar -x -C /tmp/ipquery + git archive HEAD --format=zip --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip" - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1 @@ -141,7 +143,7 @@ jobs: env: VERSION: ${{ needs.version.outputs.fullSemVer }} run: | - git archive HEAD --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip" + git archive HEAD --format=zip --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip" echo "ZIP=/tmp/ipquery-${VERSION}.zip" >> "$GITHUB_ENV" - name: Publish GitHub Release diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a9b590d..b64e63e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: - name: Stage plugin under its slug directory run: | mkdir -p /tmp/ipquery - git archive HEAD | tar -x -C /tmp/ipquery + git archive HEAD --format=zip --prefix=ipquery/ --output="/tmp/ipquery.zip" - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1 From a13738eca7fc333df08e2bde10c090e6f553a42f Mon Sep 17 00:00:00 2001 From: Guilherme Branco Stracini Date: Fri, 24 Apr 2026 11:36:00 +0100 Subject: [PATCH 3/3] Fix test steps --- .github/workflows/release.yml | 2 +- .github/workflows/test.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 7ead801..2b905ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -82,7 +82,7 @@ jobs: VERSION: ${{ needs.version.outputs.fullSemVer }} run: | mkdir -p /tmp/ipquery - git archive HEAD --format=zip --prefix=ipquery/ --output="/tmp/ipquery-${VERSION}.zip" + git archive HEAD | tar -x -C /tmp/ipquery - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index b64e63e..a9b590d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -72,7 +72,7 @@ jobs: - name: Stage plugin under its slug directory run: | mkdir -p /tmp/ipquery - git archive HEAD --format=zip --prefix=ipquery/ --output="/tmp/ipquery.zip" + git archive HEAD | tar -x -C /tmp/ipquery - name: Run WordPress Plugin Check uses: wordpress/plugin-check-action@v1