Removed release Robo task.
This commit is contained in:
1 parent
72ff60fe6e
commit
711371c226
2 files changed
+3
-67
No files matched your search
@@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
|||||||
### Changed
|
### Changed
|
||||||
- updated change log format to Keep a Changelog
|
- updated change log format to Keep a Changelog
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
- removed release Robo task
|
||||||
|
|
||||||
## 1.3.2 - 2015-08-27
|
## 1.3.2 - 2015-08-27
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|||||||
@@ -77,20 +77,6 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
$mustache->loadTemplate( 'laps' );
|
$mustache->loadTemplate( 'laps' );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function versionGet() {
|
|
||||||
|
|
||||||
$content = file_get_contents( __DIR__ . '/laps.php' );
|
|
||||||
|
|
||||||
if ( false !== preg_match( '|^Version: (?P<version>.+)$|m', $content, $matches ) ) {
|
|
||||||
return trim( $matches['version'] );
|
|
||||||
}
|
|
||||||
|
|
||||||
return '';
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the plugin version in header.
|
* Sets the plugin version in header.
|
||||||
*
|
*
|
||||||
@@ -103,57 +89,4 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
->to( 'Version: ' . $version )
|
->to( 'Version: ' . $version )
|
||||||
->run();
|
->run();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates release zip
|
|
||||||
*
|
|
||||||
* @param string $version
|
|
||||||
*/
|
|
||||||
public function makeRelease( $version = '' ) {
|
|
||||||
|
|
||||||
if ( empty( $version ) ) {
|
|
||||||
$version = $this->versionGet();
|
|
||||||
}
|
|
||||||
|
|
||||||
$this->taskFileSystemStack()
|
|
||||||
->mkdir( 'release' )
|
|
||||||
->run();
|
|
||||||
|
|
||||||
$this->taskCleanDir( 'release' )->run();
|
|
||||||
|
|
||||||
$this->taskExec( 'composer' )
|
|
||||||
->dir( __DIR__ . '/release' )
|
|
||||||
->arg( 'create-project rarst/laps laps ' . $version )
|
|
||||||
->arg( '--prefer-dist --no-dev' )
|
|
||||||
->run();
|
|
||||||
|
|
||||||
$this->taskExec( 'composer' )
|
|
||||||
->dir( __DIR__ . '/release/laps' )
|
|
||||||
->arg( 'dump-autoload --optimize' )
|
|
||||||
->run();
|
|
||||||
|
|
||||||
$zipFile = "release/laps-{$version}.zip";
|
|
||||||
$zipArchive = new ZipArchive();
|
|
||||||
|
|
||||||
if ( ! $zipArchive->open( $zipFile, ZIPARCHIVE::CREATE | ZIPARCHIVE::OVERWRITE ) ) {
|
|
||||||
die( "Failed to create archive\n" );
|
|
||||||
}
|
|
||||||
|
|
||||||
$finder = new Symfony\Component\Finder\Finder();
|
|
||||||
$finder->files()->in( 'release/laps' )->ignoreDotFiles( false );
|
|
||||||
|
|
||||||
/** @var \Symfony\Component\Finder\SplFileInfo $file */
|
|
||||||
foreach ( $finder as $file ) {
|
|
||||||
$relativePathname = str_replace( '\\', '/', $file->getRelativePathname() );
|
|
||||||
$zipArchive->addFile( $file->getRealPath(), 'laps/' . $relativePathname );
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! $zipArchive->status === ZIPARCHIVE::ER_OK ) {
|
|
||||||
echo "Failed to write files to zip\n";
|
|
||||||
}
|
|
||||||
|
|
||||||
$zipArchive->close();
|
|
||||||
|
|
||||||
$this->taskDeleteDir( 'release/laps' )->run();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user