Skip to content
Merged
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
19 changes: 0 additions & 19 deletions .changeset/config.json

This file was deleted.

39 changes: 39 additions & 0 deletions .github/scripts/sync_plugin_release_files.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env bash

# Syncs a plugin's version from its package.json into the files release-please doesn't know about:
# the plugin header, readme.txt Stable tag, composer.json, and plugins/composer-packages.json.
# Usage: .github/scripts/sync_plugin_release_files.sh <plugin-slug>

set -e

SLUG="$1"
PLUGIN_DIR="plugins/$SLUG"

if [ -z "$SLUG" ] || [ ! -f "$PLUGIN_DIR/package.json" ] || [ ! -f "$PLUGIN_DIR/composer.json" ]; then
echo "Usage: $0 <plugin-slug> (plugin needs both package.json and composer.json)"
exit 1
fi

# Update the plugin header, readme.txt, and composer.json via the plugin's own version script
(cd "$PLUGIN_DIR" && npm run version)

NEW_VERSION=$(jq -r '.version' "$PLUGIN_DIR/package.json")

# Build the download URL
# Format is [github-repository]/releases/download/[encoded-package-name]-[version]/[plugin-slug].zip
PKG_NAME=$(jq -r '.name' "$PLUGIN_DIR/package.json")
ENCODED_PKG_NAME=$(python3 -c "import urllib.parse,sys; print(urllib.parse.quote(sys.argv[1], safe=''))" "$PKG_NAME")
RELEASE_URL="https://github.com/wpengine/hwptoolkit/releases/download/${ENCODED_PKG_NAME}-${NEW_VERSION}/${SLUG}.zip"

COMPOSER_NAME=$(jq -r '.name' "$PLUGIN_DIR/composer.json")
DESCRIPTION=$(jq -r '.description // empty' "$PLUGIN_DIR/composer.json")

if [ -z "$NEW_VERSION" ] || [ -z "$COMPOSER_NAME" ] || [ -z "$DESCRIPTION" ]; then
echo "Error: Missing required values for update_composer_package.sh"
echo "NEW_VERSION: $NEW_VERSION"
echo "COMPOSER_NAME: $COMPOSER_NAME"
echo "DESCRIPTION: $DESCRIPTION"
exit 1
fi

.github/scripts/update_composer_package.sh "$NEW_VERSION" "$RELEASE_URL" "$COMPOSER_NAME" "$DESCRIPTION"
159 changes: 0 additions & 159 deletions .github/workflows/create-release-branch.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .github/workflows/lint-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
# build: Changes that affect the build system or external dependencies
# chore: Routine tasks, maintenance, or refactors that don't change functionality
# ci: Changes to CI configuration files and scripts
# deps: Dependency updates (listed under Dependencies in release notes)
# docs: Documentation only changes
# feat: A new feature for the user or a significant enhancement
# fix: A bug fix
Expand All @@ -34,6 +35,7 @@ jobs:
build
chore
ci
deps
docs
feat
fix
Expand Down
Loading
Loading