mirror of
https://gitea.com/actions/setup-python.git
synced 2025-04-21 00:05:35 +08:00
Compare commits
No commits in common. "v2.0.2" and "master" have entirely different histories.
2
.github/workflows/test.yml
vendored
2
.github/workflows/test.yml
vendored
@ -2,7 +2,7 @@ name: Validate 'setup-python'
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
|
2
.github/workflows/workflow.yml
vendored
2
.github/workflows/workflow.yml
vendored
@ -2,7 +2,7 @@ name: Main workflow
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
|
@ -106,7 +106,7 @@ Check out our detailed guide on using [Python with GitHub Actions](https://help.
|
||||
- If `3.8.1` is installed for example, and `3.8.2` is released, expect `3.8.1` to be removed and replaced by `3.8.2` in the tools cache.
|
||||
- If the exact patch version doesn't matter to you, specifying just the major and minor version will get you the latest preinstalled patch version. In the previous example, the version spec `3.8` will use the `3.8.2` Python version found in the cache.
|
||||
- Downloadable Python versions from GitHub Releases ([actions/python-versions](https://github.com/actions/python-versions/releases))
|
||||
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
|
||||
- All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/master/versions-manifest.json) file.
|
||||
- If there is a specific version of Python that is not available, you can open an issue here
|
||||
|
||||
# Hosted Tool Cache
|
||||
@ -136,9 +136,7 @@ You should specify only a major and minor version if you are okay with the most
|
||||
|
||||
# Using `setup-python` with a self hosted runner
|
||||
|
||||
Python distributions are only available for the same [environments](https://github.com/actions/virtual-environments#available-environments) that GitHub Actions hosted environments are available for. If you are using an unsupported version of Ubuntu such as `19.04` or another Linux distribution such as Fedora, `setup-python` will not work. If you have a supported self-hosted runner and you would like to use `setup-python`, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner.
|
||||
|
||||
If you are experiencing problems while configuring Python on your self-hosted runner, turn on [step debugging](https://github.com/actions/toolkit/blob/main/docs/action-debugging.md#step-debug-logs) to see addition logs.
|
||||
If you would like to use `setup-python` and a self-hosted runner, there are a few extra things you need to make sure are set up so that new versions of Python can be downloaded and configured on your runner.
|
||||
|
||||
### Windows
|
||||
|
||||
|
10
dist/index.js
vendored
10
dist/index.js
vendored
@ -6338,12 +6338,11 @@ const TOKEN = core.getInput('token');
|
||||
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
|
||||
const MANIFEST_REPO_OWNER = 'actions';
|
||||
const MANIFEST_REPO_NAME = 'python-versions';
|
||||
const MANIFEST_REPO_BRANCH = 'main';
|
||||
exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
|
||||
exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`;
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
function findReleaseFromManifest(semanticVersionSpec, architecture) {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH);
|
||||
const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH);
|
||||
return yield tc.findFromManifest(semanticVersionSpec, true, manifest, architecture);
|
||||
});
|
||||
}
|
||||
@ -6355,10 +6354,7 @@ function installPython(workingDirectory) {
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data) => {
|
||||
core.info(data.toString().trim());
|
||||
},
|
||||
stderr: (data) => {
|
||||
core.error(data.toString().trim());
|
||||
core.debug(data.toString().trim());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -3,14 +3,12 @@ import * as core from '@actions/core';
|
||||
import * as tc from '@actions/tool-cache';
|
||||
import * as exec from '@actions/exec';
|
||||
import {ExecOptions} from '@actions/exec/lib/interfaces';
|
||||
import {stderr} from 'process';
|
||||
|
||||
const TOKEN = core.getInput('token');
|
||||
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
|
||||
const MANIFEST_REPO_OWNER = 'actions';
|
||||
const MANIFEST_REPO_NAME = 'python-versions';
|
||||
const MANIFEST_REPO_BRANCH = 'main';
|
||||
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
|
||||
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`;
|
||||
|
||||
const IS_WINDOWS = process.platform === 'win32';
|
||||
|
||||
@ -21,8 +19,7 @@ export async function findReleaseFromManifest(
|
||||
const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo(
|
||||
MANIFEST_REPO_OWNER,
|
||||
MANIFEST_REPO_NAME,
|
||||
AUTH,
|
||||
MANIFEST_REPO_BRANCH
|
||||
AUTH
|
||||
);
|
||||
return await tc.findFromManifest(
|
||||
semanticVersionSpec,
|
||||
@ -38,10 +35,7 @@ async function installPython(workingDirectory: string) {
|
||||
silent: true,
|
||||
listeners: {
|
||||
stdout: (data: Buffer) => {
|
||||
core.info(data.toString().trim());
|
||||
},
|
||||
stderr: (data: Buffer) => {
|
||||
core.error(data.toString().trim());
|
||||
core.debug(data.toString().trim());
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user