123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- class RoboFile extends \Robo\Tasks
- {
-
- public function release($version)
- {
- $package = 'upyun/sdk';
- $name = 'php-sdk';
- $collection = $this->collectionBuilder();
- $workingPath = __DIR__ . DIRECTORY_SEPARATOR . $collection->workDir("release");
- $collection->taskExec("composer create-project {$package} {$name} {$version}")
- ->dir($workingPath)
- ->arg('--prefer-dist')
- ->arg('--no-dev')
- ->arg('-vvv')
- ->taskExec('composer dump-autoload --optimize')
- ->dir($workingPath . DIRECTORY_SEPARATOR . $name)
- ->arg('-vvv');
- $collection->run();
- $zipFile = "release/{$name}-{$version}.zip";
- $this->_remove($zipFile);
- $this->taskPack($zipFile)
- ->addDir("php-sdk", __DIR__ . "/release/php-sdk")
- ->run();
- $this->_deleteDir("release/$name");
- }
- }
|