Skip to content
Open
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
107 changes: 52 additions & 55 deletions .github/files/test-plugin-update/prepare-zips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,68 +7,65 @@ jq -e '.' <<<"$BETAJSON" &>/dev/null

mkdir work
mkdir zips
while IFS=$'\t' read -r SRC MIRROR SLUG; do
if [[ "$SLUG" == wpcomsh ]]; then
echo "Skipping $SLUG, doesn't work on self-hosted sites."
continue
fi

echo "::group::Creating $SLUG-dev.zip"
mv "build/$MIRROR" "work/$SLUG"
touch "work/$SLUG/ci-flag.txt"
(cd work && zip -r "../zips/${SLUG}-dev.zip" "$SLUG")
rm -rf "work/$SLUG"
echo "::endgroup::"
if [[ "$PLUGIN_SLUG" == wpcomsh ]]; then
echo "Skipping $PLUGIN_SLUG, doesn't work on self-hosted sites."
exit 0
fi

echo "::group::Creating $PLUGIN_SLUG-dev.zip"
mv "build/$PLUGIN_MIRROR" "work/$PLUGIN_SLUG"
touch "work/$PLUGIN_SLUG/ci-flag.txt"
(cd work && zip -r "../zips/${PLUGIN_SLUG}-dev.zip" "$PLUGIN_SLUG")
rm -rf "work/$PLUGIN_SLUG"
echo "::endgroup::"

echo "::group::Fetching $SLUG-trunk.zip..."
BETASLUG="$(jq -r '.extra["beta-plugin-slug"] // .extra["wp-plugin-slug"] // ""' "commit/$SRC/composer.json")"
if [[ -z "$BETASLUG" ]]; then
echo "No beta-plugin-slug or wp-plugin-slug in composer.json, skipping"
echo "::group::Fetching $PLUGIN_SLUG-trunk.zip..."
BETASLUG="$(jq -r '.extra["beta-plugin-slug"] // .extra["wp-plugin-slug"] // ""' "commit/$PLUGIN_SRC/composer.json")"
if [[ -z "$BETASLUG" ]]; then
echo "No beta-plugin-slug or wp-plugin-slug in composer.json, skipping"
else
URL="$(jq -r --arg slug "$BETASLUG" '.[$slug].manifest_url // ""' <<<"$BETAJSON")"
if [[ -z "$URL" ]]; then
echo "Beta slug $BETASLUG is not in plugins.json, skipping"
else
URL="$(jq -r --arg slug "$BETASLUG" '.[$slug].manifest_url // ""' <<<"$BETAJSON")"
if [[ -z "$URL" ]]; then
echo "Beta slug $BETASLUG is not in plugins.json, skipping"
else
JSON="$(curl -L --fail --url "$URL")"
if jq -e '.' <<<"$JSON" &>/dev/null; then
URL="$(jq -r '.trunk.download_url // .master.download_url // ""' <<<"$JSON")"
if [[ -z "$URL" ]]; then
echo "Plugin has no trunk build."
else
curl -L --fail --url "$URL" --output "work/tmp.zip" 2>&1
(cd work && unzip -q tmp.zip)
mv "work/$BETASLUG-dev" "work/$SLUG"
(cd work && zip -qr "../zips/${SLUG}-trunk.zip" "$SLUG")
rm -rf "work/$SLUG" "work/tmp.zip"
fi
JSON="$(curl -L --fail --url "$URL")"
if jq -e '.' <<<"$JSON" &>/dev/null; then
URL="$(jq -r '.trunk.download_url // .master.download_url // ""' <<<"$JSON")"
if [[ -z "$URL" ]]; then
echo "Plugin has no trunk build."
else
echo "::error::Unexpected response from betadownload.jetpack.me for $SLUG"
echo "$JSON"
echo "info=❌ Unexpected response from betadownload.jetpack.me for $SLUG" >> "$GITHUB_OUTPUT"
exit 1
curl -L --fail --url "$URL" --output "work/tmp.zip" 2>&1
(cd work && unzip -q tmp.zip)
mv "work/$BETASLUG-dev" "work/$PLUGIN_SLUG"
(cd work && zip -qr "../zips/${PLUGIN_SLUG}-trunk.zip" "$PLUGIN_SLUG")
rm -rf "work/$PLUGIN_SLUG" "work/tmp.zip"
fi
else
echo "::error::Unexpected response from betadownload.jetpack.me for $PLUGIN_SLUG"
echo "$JSON"
echo "❌ Unexpected response from betadownload.jetpack.me for $PLUGIN_SLUG" >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
fi
echo "::endgroup::"
fi
echo "::endgroup::"

echo "::group::Fetching $SLUG-stable.zip..."
JSON="$(curl "https://api.wordpress.org/plugins/info/1.0/$SLUG.json")"
if jq -e --arg slug "$SLUG" '.slug == $slug' <<<"$JSON" &>/dev/null; then
URL="$(jq -r '.download_link // ""' <<<"$JSON")"
if [[ -z "$URL" ]]; then
echo "Plugin has no stable release."
else
curl -L --fail --url "$URL" --output "zips/$SLUG-stable.zip" 2>&1
fi
elif jq -e '.error == "Plugin not found."' <<<"$JSON" &>/dev/null; then
echo "Plugin is not published."
echo "::group::Fetching $PLUGIN_SLUG-stable.zip..."
JSON="$(curl "https://api.wordpress.org/plugins/info/1.0/$PLUGIN_SLUG.json")"
if jq -e --arg slug "$PLUGIN_SLUG" '.slug == $slug' <<<"$JSON" &>/dev/null; then
URL="$(jq -r '.download_link // ""' <<<"$JSON")"
if [[ -z "$URL" ]]; then
echo "Plugin has no stable release."
else
echo "::error::Unexpected response from WordPress.org API for $SLUG"
echo "$JSON"
echo "info=❌ Unexpected response from WordPress.org API for $SLUG" >> "$GITHUB_OUTPUT"
exit 1
curl -L --fail --url "$URL" --output "zips/$PLUGIN_SLUG-stable.zip" 2>&1
fi
echo "::endgroup::"
done < build/plugins.tsv

echo 'info=' >> "$GITHUB_OUTPUT"
elif jq -e '.error == "Plugin not found."' <<<"$JSON" &>/dev/null; then
echo "Plugin is not published."
else
echo "::error::Unexpected response from WordPress.org API for $PLUGIN_SLUG"
echo "$JSON"
echo "❌ Unexpected response from WordPress.org API for $PLUGIN_SLUG" >> "$GITHUB_STEP_SUMMARY"
exit 1
fi
echo "::endgroup::"
8 changes: 3 additions & 5 deletions .github/files/test-plugin-update/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@ for ZIP in *-dev.zip; do
done

FINISHED=false
OUTPUT=()

function onexit {
if ! "$FINISHED"; then
OUTPUT+=( "💣 The testing script exited unexpectedly." )
echo "💣 The testing script exited unexpectedly." >> "$GITHUB_STEP_SUMMARY"
fi
gh_set_output info "$( printf "%s\n" "${OUTPUT[@]}" )"
}
trap "onexit" EXIT

function failed {
ERRMSG="$1"
OUTPUT+=( "❌ $ERRMSG" )
echo "❌ $ERRMSG" >> "$GITHUB_STEP_SUMMARY"
FAILED=1
EXIT=1
}
Expand Down Expand Up @@ -143,7 +141,7 @@ for SLUG in "${SLUGS[@]}"; do
wp --allow-root --quiet option delete fake_plugin_update_url

if [[ -z "$FAILED" ]]; then
OUTPUT+=( "✅ Upgrade of $SLUG from $FROM via $HOW succeeded!" )
echo "✅ Upgrade of $SLUG from $FROM via $HOW succeeded!" >> "$GITHUB_STEP_SUMMARY"
fi
done
done
Expand Down
2 changes: 1 addition & 1 deletion .github/files/test-wpcom-filename-restrictions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ echo "Considering ${#REFS[@]} monorepo commits for Upstream-Ref matching."
UPSTREAM_REGEXES=()
NL=$'\n'
for (( i=0; i<"${#REFS[@]}"; i+=3180 )); do
UPSTREAM_REGEXES+=( "${NL}Upstream-Ref: $GITHUB_REPOSITORY@($( IFS="|"; echo "${REFS[*]:$i:3180}" ))($|${NL})" )
UPSTREAM_REGEXES+=( "${NL}Upstream-Ref: Automattic/jetpack@($( IFS="|"; echo "${REFS[*]:$i:3180}" ))($|${NL})" )
done
cd "$GITHUB_WORKSPACE"
echo "::endgroup::"
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ module.exports = {
ignoreScripts: false,
gitAuthor: 'Renovate Bot (self-hosted) <bot@renovateapp.com>',
platform: 'github',
repositories: [ 'Automattic/jetpack' ],
repositories: [ 'anomiex/jetpack' ],

// Extra code to run before creating a commit.
allowedPostUpgradeCommands: [ monorepoBase + '.github/files/renovate-post-upgrade-run.sh' ],
Expand Down
2 changes: 1 addition & 1 deletion .github/renovate.json5
Original file line number Diff line number Diff line change
Expand Up @@ -161,5 +161,5 @@
},
dependencyDashboardTitle: 'Renovate Dependency Updates',
dependencyDashboardLabels: [ 'Primary Issue', '[Type] Janitorial' ],
dependencyDashboardFooter: 'The bot runs every two hours, and may be monitored or triggered ahead of schedule [here](https://github.com/Automattic/jetpack/actions/workflows/renovate.yml).',
dependencyDashboardFooter: 'The bot runs every two hours, and may be monitored or triggered ahead of schedule [here](https://github.com/anomiex/jetpack/actions/workflows/renovate.yml).',
}
129 changes: 0 additions & 129 deletions .github/workflows/autotagger.yml

This file was deleted.

Loading