Comments (2)
Can you elaborate on how you would like this to work?
from semver.
@defji The way I've integrated programatic semver handling to Git repository management, is like so – using command line automation tools (such as Robo):
/**
* Tag the current state of the repository.
*
* @param string $version The name of the tag.
* @param boolean $commitTag (optional) Commit the tag or not.
* @return void
*/
public function tagRelease(string $version, bool $commitTag = true)
{
if ($commitTag) {
$this->taskGitStack()
->stopOnFail()
->tag('v'.ltrim($version, 'v'), 'Tag release for v'.$version)
->run();
}
}
This is within a Robofile.php
(using the Robo task runner) libraries' built-in Git support. It would then be used on the command line, like so:
php robo.phar tag:release v1.2.3
Even further – you can also automate entire releases using the tagRelease
method (modified for your needs, of course) within another method.
/**
* Release the next stable version of the package.
*
* @param string $version A valid semver version scheme string to set as the next version and tag.
* @param bool $commit Should the changes be commited and tagged?
* @return void
*/
public function releaseStable(string $version, bool $commit = true): void
{
$this->checkoutMaster($commit);
$this->tagRelease($version, $commit);
$this->pushAll($version, $commit);
$this->upgradeDocumentation($version, $commit);
$this->upgradeChangelog($version, $commit);
$this->removeTag($version, $commit);
$this->tagRelease($version, $commit);
$this->pushAll($version, $commit);
echo PHP_EOL;
$this->say("Successfully bumped version to <fg=blue>v</><fg=cyan>{$version}</>");
}
Used on the command line, like so:
php robo.phar release:stable v1.2.3
It's worked pretty good for my own needs. YMMV though. 🙂
from semver.
Related Issues (12)
- It can check the pre-release tag HOT 4
- SemVer parsing HOT 5
- Express SemVer as number HOT 2
- Undefined offset HOT 2
- Versions compare bug HOT 1
- Doesn't work when I try to parse a chrome browser version HOT 2
- Check if there is a new patch/minor/major update HOT 4
- Add Version::isPre(), Version::hasBuild() HOT 4
- Add Version::min(), Version::max() HOT 5
- Comparing Versions with Pre-Release fail HOT 2
- The example in the readme is wrong
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semver.