diff --git a/.github/workflows/ghost-inspector.yml b/.github/workflows/ghost-inspector.yml index 505b4d3e9..56292225e 100644 --- a/.github/workflows/ghost-inspector.yml +++ b/.github/workflows/ghost-inspector.yml @@ -23,22 +23,31 @@ jobs: - name: Build plugin run: | - npm install --legacy-peer-deps - npm run build + composer install --no-dev --no-scripts + composer run strauss-release npm install --legacy-peer-deps npm run build - name: Create plugin archive run: | - zip -r ${{ env.PLUGIN_SLUG }}.zip . \ - -x "*.git*" "*.github*" "tests*" "src*" "node_modules*" "*.gitignore" + mkdir -p /tmp/${{ env.PLUGIN_SLUG }} + + rsync -av --exclude='/.git' --exclude='/.github' --exclude='/bin' --exclude='/gulp' --exclude='/src' --exclude='/node_modules' --exclude='/tests' --exclude='/.wordpress-org' . /tmp/${{ env.PLUGIN_SLUG }}/ + cd /tmp + zip -r ${{ env.PLUGIN_SLUG }}.zip ${{ env.PLUGIN_SLUG }} + mv ${{ env.PLUGIN_SLUG }}.zip $GITHUB_WORKSPACE/ + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + name: ${{ env.PLUGIN_SLUG }} + path: ${{ env.PLUGIN_SLUG }}.zip - name: Upload plugin run: | # Upload plugin using the working format UPLOAD_RESPONSE=$(curl -X POST \ -H "X-API-Key: ${{ env.WP_API_KEY }}" \ - -F "plugin_zip=@${{ env.PLUGIN_SLUG }}.zip" \ -F "plugin_zip=@${{ env.PLUGIN_SLUG }}.zip;type=application/zip" \ -s \ "${{ env.WP_URL }}/wp-json/plugin-upload/v1/upload") @@ -66,14 +75,3 @@ jobs: echo "Failed to trigger Ghost Inspector tests" exit 1 fi - - - name: Run Ghost Inspector tests - run: | - RESPONSE=$(curl -s "https://api.ghostinspector.com/v1/suites/${{ env.GI_SUITE_ID }}/execute/?apiKey=${{ env.GI_API_KEY }}") - echo "Ghost Inspector response: $RESPONSE" - - # Check if the tests were triggered successfully - if ! echo "$RESPONSE" | jq -e '.code == "SUCCESS"' > /dev/null; then - echo "Failed to trigger Ghost Inspector tests" - exit 1 - fi