5
0
Fork 0
mirror of https://github.com/cycjimmy/semantic-release-action.git synced 2025-11-07 10:46:56 +00:00

feat(outputs): add new_release_channel

This commit is contained in:
cycjimmy 2020-07-02 15:28:08 +08:00
parent 606b318c9c
commit ae40dc6658
6 changed files with 10 additions and 2 deletions

View file

@ -7,6 +7,10 @@ on:
push: push:
branches: branches:
- master - master
- next
- next-major
- alpha
- beta
jobs: jobs:
release: release:

View file

@ -6,7 +6,6 @@ on:
- master - master
- next - next
- next-major - next-major
- next-major
- alpha - alpha
- beta - beta
- 'feat/**' - 'feat/**'

View file

@ -200,6 +200,7 @@ steps:
| new_release_major_version | Major version of the new release. (e.g. `1`) | | new_release_major_version | Major version of the new release. (e.g. `1`) |
| new_release_minor_version | Minor version of the new release. (e.g. `3`) | | new_release_minor_version | Minor version of the new release. (e.g. `3`) |
| new_release_patch_version | Patch version of the new release. (e.g. `0`) | | new_release_patch_version | Patch version of the new release. (e.g. `0`) |
| new_release_channel | The distribution channel on which the last release was initially made available (undefined for the default distribution channel). |
| new_release_notes | The release notes for the new release. | | new_release_notes | The release notes for the new release. |
#### Using Output Variables: #### Using Output Variables:

View file

@ -34,6 +34,8 @@ outputs:
description: 'Minor version of the new release' description: 'Minor version of the new release'
new_release_patch_version: new_release_patch_version:
description: 'Patch version of the new release' description: 'Patch version of the new release'
new_release_channel:
description: 'The distribution channel on which the last release was initially made available (undefined for the default distribution channel).'
new_release_notes: new_release_notes:
description: 'The release notes for the new release.' description: 'The release notes for the new release.'
runs: runs:

View file

@ -4,5 +4,6 @@
"new_release_major_version": "new_release_major_version", "new_release_major_version": "new_release_major_version",
"new_release_minor_version": "new_release_minor_version", "new_release_minor_version": "new_release_minor_version",
"new_release_patch_version": "new_release_patch_version", "new_release_patch_version": "new_release_patch_version",
"new_release_channel": "new_release_channel",
"new_release_notes": "new_release_notes" "new_release_notes": "new_release_notes"
} }

View file

@ -24,7 +24,7 @@ module.exports = async (result) => {
core.debug(`The release was published with plugin "${release.pluginName}".`); core.debug(`The release was published with plugin "${release.pluginName}".`);
} }
const {version, notes} = nextRelease; const {version, channel, notes} = nextRelease;
const [major, minor, patch] = version.split(/\.|-|\s/g, 3); const [major, minor, patch] = version.split(/\.|-|\s/g, 3);
// set outputs // set outputs
@ -33,5 +33,6 @@ module.exports = async (result) => {
core.setOutput(outputs.new_release_major_version, major); core.setOutput(outputs.new_release_major_version, major);
core.setOutput(outputs.new_release_minor_version, minor); core.setOutput(outputs.new_release_minor_version, minor);
core.setOutput(outputs.new_release_patch_version, patch); core.setOutput(outputs.new_release_patch_version, patch);
core.setOutput(outputs.new_release_channel, channel);
core.setOutput(outputs.new_release_notes, notes); core.setOutput(outputs.new_release_notes, notes);
}; };