Compare commits

...

5 Commits

Author SHA1 Message Date
Konrad Pabjan
7a69c2bc7d
Improved logging during setup (#113)
* Improved error output during setup

* Change from debug to info for normal output

* Apply suggestions from code review

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>

Co-authored-by: Brian Cristante <33549821+brcrista@users.noreply.github.com>
2020-07-15 19:13:43 +02:00
Konrad Pabjan
654aa00a6e
Update README.md 2020-07-15 11:28:54 +02:00
Maxim Lobanov
6f45e887f6
update MANIFEST_URL (#111) 2020-07-15 11:26:28 +02:00
Konrad Pabjan
2989dc4a1a
Update workflow.yml 2020-07-14 16:05:12 +02:00
Konrad Pabjan
a0a76c4ddb
Update test.yml 2020-07-14 16:04:57 +02:00
5 changed files with 290 additions and 278 deletions

View File

@ -2,7 +2,7 @@ name: Validate 'setup-python'
on: on:
push: push:
branches: branches:
- master - main
paths-ignore: paths-ignore:
- '**.md' - '**.md'
pull_request: pull_request:

View File

@ -2,7 +2,7 @@ name: Main workflow
on: on:
push: push:
branches: branches:
- master - main
paths-ignore: paths-ignore:
- '**.md' - '**.md'
pull_request: pull_request:

View File

@ -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 `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. - 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)) - 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/master/versions-manifest.json) file. - All available versions are listed in the [version-manifest.json](https://github.com/actions/python-versions/blob/main/versions-manifest.json) file.
- If there is a specific version of Python that is not available, you can open an issue here - If there is a specific version of Python that is not available, you can open an issue here
# Hosted Tool Cache # Hosted Tool Cache
@ -136,7 +136,9 @@ You should specify only a major and minor version if you are okay with the most
# Using `setup-python` with a self hosted runner # Using `setup-python` with a self hosted runner
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. 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.
### Windows ### Windows

10
dist/index.js vendored
View File

@ -6338,11 +6338,12 @@ const TOKEN = core.getInput('token');
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`; const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
const MANIFEST_REPO_OWNER = 'actions'; const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'python-versions'; const MANIFEST_REPO_NAME = 'python-versions';
exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`; const MANIFEST_REPO_BRANCH = 'main';
exports.MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/${MANIFEST_REPO_BRANCH}/versions-manifest.json`;
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
function findReleaseFromManifest(semanticVersionSpec, architecture) { function findReleaseFromManifest(semanticVersionSpec, architecture) {
return __awaiter(this, void 0, void 0, function* () { return __awaiter(this, void 0, void 0, function* () {
const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH); const manifest = yield tc.getManifestFromRepo(MANIFEST_REPO_OWNER, MANIFEST_REPO_NAME, AUTH, MANIFEST_REPO_BRANCH);
return yield tc.findFromManifest(semanticVersionSpec, true, manifest, architecture); return yield tc.findFromManifest(semanticVersionSpec, true, manifest, architecture);
}); });
} }
@ -6354,7 +6355,10 @@ function installPython(workingDirectory) {
silent: true, silent: true,
listeners: { listeners: {
stdout: (data) => { stdout: (data) => {
core.debug(data.toString().trim()); core.info(data.toString().trim());
},
stderr: (data) => {
core.error(data.toString().trim());
} }
} }
}; };

View File

@ -3,12 +3,14 @@ import * as core from '@actions/core';
import * as tc from '@actions/tool-cache'; import * as tc from '@actions/tool-cache';
import * as exec from '@actions/exec'; import * as exec from '@actions/exec';
import {ExecOptions} from '@actions/exec/lib/interfaces'; import {ExecOptions} from '@actions/exec/lib/interfaces';
import {stderr} from 'process';
const TOKEN = core.getInput('token'); const TOKEN = core.getInput('token');
const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`; const AUTH = !TOKEN || isGhes() ? undefined : `token ${TOKEN}`;
const MANIFEST_REPO_OWNER = 'actions'; const MANIFEST_REPO_OWNER = 'actions';
const MANIFEST_REPO_NAME = 'python-versions'; const MANIFEST_REPO_NAME = 'python-versions';
export const MANIFEST_URL = `https://raw.githubusercontent.com/${MANIFEST_REPO_OWNER}/${MANIFEST_REPO_NAME}/master/versions-manifest.json`; 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`;
const IS_WINDOWS = process.platform === 'win32'; const IS_WINDOWS = process.platform === 'win32';
@ -19,7 +21,8 @@ export async function findReleaseFromManifest(
const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo( const manifest: tc.IToolRelease[] = await tc.getManifestFromRepo(
MANIFEST_REPO_OWNER, MANIFEST_REPO_OWNER,
MANIFEST_REPO_NAME, MANIFEST_REPO_NAME,
AUTH AUTH,
MANIFEST_REPO_BRANCH
); );
return await tc.findFromManifest( return await tc.findFromManifest(
semanticVersionSpec, semanticVersionSpec,
@ -35,7 +38,10 @@ async function installPython(workingDirectory: string) {
silent: true, silent: true,
listeners: { listeners: {
stdout: (data: Buffer) => { stdout: (data: Buffer) => {
core.debug(data.toString().trim()); core.info(data.toString().trim());
},
stderr: (data: Buffer) => {
core.error(data.toString().trim());
} }
} }
}; };