mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-18 11:55:46 +08:00
Clean up bump version script
This commit is contained in:
parent
f9f15d6cd8
commit
16678dc581
15
.github/workflows/check-release.yml
vendored
15
.github/workflows/check-release.yml
vendored
@ -58,22 +58,9 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
pip install .
|
pip install .
|
||||||
|
|
||||||
- name: Configure Version Spec
|
|
||||||
id: version-spec
|
|
||||||
if: ${{ matrix.group == 'check_release' }}
|
|
||||||
run: |
|
|
||||||
set -eux
|
|
||||||
version=$(python setup.py --version)
|
|
||||||
if [[ $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
|
|
||||||
version_spec=patch
|
|
||||||
else
|
|
||||||
version_spec=build
|
|
||||||
fi
|
|
||||||
echo "::set-output name=spec::${version_spec}"
|
|
||||||
|
|
||||||
- name: Check Release
|
- name: Check Release
|
||||||
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
|
uses: jupyter-server/jupyter_releaser/.github/actions/check-release@v1
|
||||||
env:
|
env:
|
||||||
RH_VERSION_SPEC: ${{ steps.version-spec.outputs.spec }}
|
RH_VERSION_SPEC: next
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
@ -23,10 +23,16 @@ commander
|
|||||||
.action((spec: any, opts: any) => {
|
.action((spec: any, opts: any) => {
|
||||||
// Get the previous version.
|
// Get the previous version.
|
||||||
const prev = utils.getPythonVersion();
|
const prev = utils.getPythonVersion();
|
||||||
|
const isFinal = /\d+\.\d+\.\d+$/.test(prev);
|
||||||
|
|
||||||
// Whether to commit after bumping
|
// Whether to commit after bumping
|
||||||
const commit = opts.skipCommit !== true;
|
const commit = opts.skipCommit !== true;
|
||||||
|
|
||||||
|
// for "next", determine whether to use "patch" or "build"
|
||||||
|
if (spec === 'next') {
|
||||||
|
spec = isFinal ? 'patch' : 'build';
|
||||||
|
}
|
||||||
|
|
||||||
// For patch, defer to `patch:release` command
|
// For patch, defer to `patch:release` command
|
||||||
if (spec === 'patch') {
|
if (spec === 'patch') {
|
||||||
let cmd = 'jlpm run release:patch';
|
let cmd = 'jlpm run release:patch';
|
||||||
@ -45,20 +51,10 @@ commander
|
|||||||
if (options.indexOf(spec) === -1) {
|
if (options.indexOf(spec) === -1) {
|
||||||
throw new Error(`Version spec must be one of: ${options}`);
|
throw new Error(`Version spec must be one of: ${options}`);
|
||||||
}
|
}
|
||||||
if (
|
if (isFinal && spec === 'release') {
|
||||||
prev.indexOf('a') === -1 &&
|
|
||||||
prev.indexOf('b') === -1 &&
|
|
||||||
prev.indexOf('rc') === -1 &&
|
|
||||||
spec === 'release'
|
|
||||||
) {
|
|
||||||
throw new Error('Use "major" or "minor" to switch back to alpha release');
|
throw new Error('Use "major" or "minor" to switch back to alpha release');
|
||||||
}
|
}
|
||||||
if (
|
if (isFinal && spec === 'build') {
|
||||||
prev.indexOf('a') === -1 &&
|
|
||||||
prev.indexOf('b') === -1 &&
|
|
||||||
prev.indexOf('rc') === -1 &&
|
|
||||||
spec === 'build'
|
|
||||||
) {
|
|
||||||
throw new Error('Cannot increment a build on a final release');
|
throw new Error('Cannot increment a build on a final release');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user