Download link updating to repo

Beda has encountered a problem with his plugins where the download link is automatically updating to the repo link rather than the download link; this is one of the plugins affected: https://directory.classicpress.net/plugins/tukutoi-maintenance

1 Like

Don’t know how the directory works, but the zip file is linked in the release description rather than being an “asset” of the release.
Maybe this is causing the problem.

1 Like

Changed this according to @Simone’s suggestion for this plugin.

That would mean, the actual user input on the form where we manage the plugin in directory of CP has to be hidden and should not be edited by the developer, because if it changes anyway with some script, then we shouldn’t provide it for edit

Anyway, lets see what happens, I have now added the release ZIP to the “Assets” (without any version or suffix in the filename as required by CP)

2 Likes

Looking at the code:

if ( ! empty( $response->assets ) ) {
     if ( property_exists( $response->assets[0], 'browser_download_url') ) {
         return $response->assets[0]->browser_download_url;
     }
}

Looks like we look for the browser_download_url not just the latest asset.

I’m using version in all my releases zip files and it works as expected.

This is the way I create a new release:

git archive -o "../${slug}-${version}.zip" --prefix ${slug}/ HEAD
hub release create -d -a "../${slug}-${version}.zip" -m "${name} ${version}" "${version}"
rm "../${slug}-${version}.zip"
1 Like