forked from video-dev/hls.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request video-dev#2284 from video-dev/support-beta-tags
support preprelease publishes from git tag
- Loading branch information
Showing
5 changed files
with
65 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
# Performing A Release | ||
Releases are performed automatically with travis. | ||
|
||
1. `git tag -a v<major>.<minor>.<patch>` _('v' required)_ | ||
2. `git push --tag` | ||
3. Wait for travis to create a new draft GitHub release with the build attached. At this point the new npm package should have been published. | ||
4. Add the release notes to the new draft GitHub release. | ||
5. Publish the GitHub release. | ||
1. `git tag -a v<major>.<minor>.<patch>` or `git tag -a v<major>.<minor>.<patch>-<prerelease>` _('v' required)_ where anything before the first `.` in `<prerelease>` will be become the [npm dist-tag](https://docs.npmjs.com/cli/dist-tag). | ||
1. `git push` | ||
1. `git push --tag` | ||
1. Wait for travis to create a new draft GitHub release with the build attached. At this point the new npm package should have been published. | ||
1. Add the release notes to the new draft GitHub release. | ||
1. Publish the GitHub release. | ||
|
||
## Examples | ||
- `git tag -a v1.2.3` will result in `1.2.3` being published with the `latest` npm tag. | ||
- `git tag -a v1.2.3-beta` will result in `1.2.3-beta` being published with the `beta` npm tag. | ||
- `git tag -a v1.2.3-beta.1` will result in `1.2.3-beta.1` being published with the `beta` npm tag. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
'use strict'; | ||
|
||
const versionParser = require('./version-parser.js'); | ||
const packageJson = require('../package.json'); | ||
|
||
console.log(versionParser.getVersionTag('v' + packageJson.version)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
'use strict'; | ||
|
||
const VALID_VERSION_REGEX = /^v\d+\.\d+\.\d+(?:-([a-zA-Z][0-9a-zA-Z-]*))?/; | ||
const STABLE_VERSION_REGEX = /^v\d+\.\d+\.\d+$/; | ||
|
||
module.exports = { | ||
isValidVersion: function(version) { | ||
return VALID_VERSION_REGEX.test(version); | ||
}, | ||
isValidStableVersion: function(version) { | ||
return STABLE_VERSION_REGEX.test(version); | ||
}, | ||
// extract what we should use as the npm dist-tag (https://docs.npmjs.com/cli/dist-tag) | ||
// e.g | ||
// v1.2.3-beta => beta | ||
// v1.2.3-beta.1 => beta | ||
// v1.2.3 => latest | ||
getVersionTag: function(version) { | ||
const match = VALID_VERSION_REGEX.exec(version); | ||
if (!match) { | ||
throw new Error('Invalid version.'); | ||
} | ||
return match[1] || 'latest'; | ||
} | ||
} |