Skip to content

Fix deploy script to not attempt re-publishing the same version of a plugin #123

@mukeshpanchal27

Description

@mukeshpanchal27

Is your enhancement related to a problem? Please describe.
While implementing this action in a mono-repo setup for the Performance Lab plugin, the plugins are published either manually (via workflow_dispatch) or as part of the main Performance Lab plugin release process. However, they should only be published if the configured version of the standalone plugin is actually different from the version that is already released for it.

As part of the Performance Lab plugin 2.2.0 release, we noticed that there is a problem with that workflow still. We had already published WebP Uploads version 1.0.0 manually before, but the workflow tried to publish the same version again. While it fortunately did not re-publish the plugin in any way, the workflow attempted to re-publish and then failed, which is undesirable. We should instead include a check that, if the version is the same as the already published one, it should bail early.

Error: https://github.com/WordPress/performance/actions/runs/4723956809/jobs/8380581174

Describe the solution you'd like

What would be better is if this action was aborted early if it detected the version tags in the SVN repo.. Ex:

if [[ -d "tags/$VERSION" ]]; then
    echo "Version $VERSION of plugin $SLUG was already published";
    exit
fi

Metadata

Metadata

Labels

Type

No type

Projects

Status

No status

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions