mirror of
https://github.com/actions/setup-python
synced 2025-04-06 23:39:42 +00:00
feature: fallback to pre-release when no stable version is found (#414)
This allows to specify version like `3.11` or `pypy3.10` in workflows before those versions are released. This lessen the burden for users of `setup-python` by not having to modify their workflow twice: once when a pre-release is available (e.g. `3.11-dev`) and once when the first stable release is published (e.g. `3.11`)
This commit is contained in:
@ -77,6 +77,7 @@ async function run() {
|
||||
try {
|
||||
const versions = resolveVersionInput();
|
||||
const checkLatest = core.getBooleanInput('check-latest');
|
||||
const allowPreReleases = core.getBooleanInput('allow-prereleases');
|
||||
|
||||
if (versions.length) {
|
||||
let pythonVersion = '';
|
||||
@ -89,7 +90,8 @@ async function run() {
|
||||
version,
|
||||
arch,
|
||||
updateEnvironment,
|
||||
checkLatest
|
||||
checkLatest,
|
||||
allowPreReleases
|
||||
);
|
||||
pythonVersion = `${installed.resolvedPyPyVersion}-${installed.resolvedPythonVersion}`;
|
||||
core.info(
|
||||
@ -100,7 +102,8 @@ async function run() {
|
||||
version,
|
||||
arch,
|
||||
updateEnvironment,
|
||||
checkLatest
|
||||
checkLatest,
|
||||
allowPreReleases
|
||||
);
|
||||
pythonVersion = installed.version;
|
||||
core.info(`Successfully set up ${installed.impl} (${pythonVersion})`);
|
||||
|
Reference in New Issue
Block a user