roots / wordpress

Automatically updated WordPress Composer package
https://roots.io/composer-wordpress-resources/
MIT License
167 stars 17 forks source link

Support for nightly #6

Closed johnbillion closed 5 years ago

johnbillion commented 5 years ago

Related: #1 and comments on that issue.

Summary

In addition to latest which corresponds to the latest stable version of WordPress, I'd like to be able to specify roots/wordpress as a dependency that pulls in the latest nightly/trunk/master version of WordPress.

Motivation

This is something that's supported by install-wp-tests.sh via the WP_VERSION=nightly environment variable. I use it in the Travis CI build matrix of my plugins (along with a daily build on Travis) so that I can be alerted to problems caused by changes in WordPress trunk well in advance of the stable release.

https://github.com/johnbillion/query-monitor/blob/458bc4fd172116b628d51c91aea64d0062d48d27/.travis.yml#L23-L27

It would be great if roots/wordpress=nightly was a branch which was built daily from WordPress trunk/master, or from the nightly build.

austinpray commented 5 years ago

Yeah I can absolutely get this rolling. I don't even think it has to be automated

austinpray commented 5 years ago

@johnbillion so created two branches:

https://github.com/roots/wordpress/tree/nightly-git and https://github.com/roots/wordpress/tree/nightly-svn

https://packagist.org/packages/roots/wordpress#dev-nightly-git https://packagist.org/packages/roots/wordpress#dev-nightly-svn

Can you try these out (with minimum-stability: dev temporarily) with both composer --prefer-dist and --prefer-source? If they work well for you I can tag nightly-git as nightly

johnbillion commented 5 years ago

Of course, because the roots/wordpress package doesn't need to change it'll just work. Nice.

I didn't need to specify minimum-stability: dev, and I'm not sure why. The Composer docs suggest that using a branch does require this, but who knows.

Installed with from both dist and source and all is good. Successfully got r44907 from core. Installing from source took ages but that's to be expected.

austinpray commented 5 years ago

Sweet, gonna tag. Hope this helps!

https://github.com/roots/wordpress/releases/tag/nightly

johnbillion commented 5 years ago

Interesting, that tag hasn't made its way through to Packagist. Are tags that don't look like valid version numbers allowed in Composer?

johnbillion commented 5 years ago

@austinpray Did you see my message above? It looks like Composer only supports tags that look like version numbers. Might need to stick to a branch and then use dev-nightly.

QWp6t commented 5 years ago

@johnbillion I'm not entirely sure how @austin has everything setup here, but I'll see if that's something I can do. He's out of town right now.

austinpray commented 5 years ago

@johnbillion so just delete the tags and rename branch nightly-git to nightly and it’s done?

QWp6t commented 5 years ago

Yeah, I can confirm that this works as expected...

  "require": {
    "php": ">=7.1",
    "composer/installers": "^1.4",
    "vlucas/phpdotenv": "^3.0.0",
    "oscarotero/env": "^1.1.0",
-   "roots/wordpress": "5.1.1",
+   "roots/wordpress": "dev-nightly-git",
    "roots/wp-config": "1.0.0",
    "roots/wp-password-bcrypt": "1.0.0"
  },

web/wp/wp-includes/version.php

/**
 * The WordPress version string
 *
 * @global string $wp_version
 */
$wp_version = '5.2-beta2-45163';

https://github.com/WordPress/WordPress/blob/master/wp-includes/version.php#L11-L16

johnbillion commented 5 years ago

@johnbillion so just delete the tags and rename branch nightly-git to nightly and it’s done?

Yeah a nightly branch that points to the same reference as nightly-git would be good because that way roots/wordpress, wp-phpunit/wp-phpunit, and other packages that use the nightly branch convention can be pulled in with dev-nightly.

austinpray commented 5 years ago

There ya go! https://github.com/roots/wordpress/tree/nightly

johnbillion commented 5 years ago

Thanks! Working nicely.