Skip to content

Commit

Permalink
Revert "Update ghost-inspector.yml"
Browse files Browse the repository at this point in the history
This reverts commit c381bff.
  • Loading branch information
oakesjosh committed Nov 4, 2024
1 parent c381bff commit 75c6091
Showing 1 changed file with 44 additions and 75 deletions.
119 changes: 44 additions & 75 deletions .github/workflows/ghost-inspector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,88 +23,57 @@ jobs:

- name: Build plugin
run: |
composer install --no-dev --no-scripts
composer run strauss-release
npm install --legacy-peer-deps
npm run build
npm install --legacy-peer-deps
npm run build
- name: Create plugin archive
run: |
mkdir -p /tmp/${{ env.PLUGIN_SLUG }}
zip -r ${{ env.PLUGIN_SLUG }}.zip . \
-x "*.git*" "*.github*" "tests*" "src*" "node_modules*" "*.gitignore"
rsync -av \
--exclude='/.git' \
--exclude='/.github' \
--exclude='/bin' \
--exclude='/gulp' \
--exclude='/src' \
--exclude='/node_modules' \
--exclude='/tests' \
--exclude='.distignore' \
--exclude='.gitignore' \
--exclude='.eslintignore' \
--exclude='.eslintrc.js' \
--exclude='.prettierrc.js' \
--exclude='composer.json' \
--exclude='composer.lock' \
--exclude='gulpfile.js' \
--exclude='package.json' \
--exclude='package-lock.json' \
--exclude='webpack.config.js' \
--exclude='docker-compose.yml' \
--exclude='codeception.dist.yml' \
--exclude='.env' \
--exclude='.env.testing' \
--exclude='.prettierignore' \
--exclude='phpcs.xml.dist' \
--exclude='phpcs.xml' \
--exclude='codeception.slic.yml' \
--exclude='.puprc' \
--exclude='.editorconfig' \
--exclude='.git-blame-ignore-revs' \
--exclude='.gitattributes' \
--exclude='.gitmodules' \
--exclude='.wordpress-org' \
. /tmp/${{ env.PLUGIN_SLUG }}/
- 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")
cd /tmp
zip -r ${{ env.PLUGIN_SLUG }}.zip ${{ env.PLUGIN_SLUG }}
mv ${{ env.PLUGIN_SLUG }}.zip $GITHUB_WORKSPACE/
echo "Upload response: $UPLOAD_RESPONSE"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ env.PLUGIN_SLUG }}
path: ${{ env.PLUGIN_SLUG }}.zip
# Check if the request was successful using grep like the shell script
if echo "$UPLOAD_RESPONSE" | grep -q '"success":true'; then
echo "Plugin uploaded successfully!"
PLUGIN_DIR=$(echo "$UPLOAD_RESPONSE" | grep -o '"plugin_directory":"[^"]*"' | cut -d'"' -f4)
echo "Installed in directory: $PLUGIN_DIR"
else
echo "Failed to upload plugin"
echo "$UPLOAD_RESPONSE" | grep -o '"message":"[^"]*"' | cut -d'"' -f4
exit 1
fi
# - 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")
# echo "Upload response: $UPLOAD_RESPONSE"
# # Check if the request was successful using grep like the shell script
# if echo "$UPLOAD_RESPONSE" | grep -q '"success":true'; then
# echo "Plugin uploaded successfully!"
# PLUGIN_DIR=$(echo "$UPLOAD_RESPONSE" | grep -o '"plugin_directory":"[^"]*"' | cut -d'"' -f4)
# echo "Installed in directory: $PLUGIN_DIR"
# else
# echo "Failed to upload plugin"
# echo "$UPLOAD_RESPONSE" | grep -o '"message":"[^"]*"' | cut -d'"' -f4
# 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
- 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"
# - 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
# 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

0 comments on commit 75c6091

Please sign in to comment.