Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Use python-version #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ steps:
- uses: actions/checkout@master
- uses: actions/setup-python@v1
with:
version: '3.x' // Version range or exact version of a Python version to use, using semvers version range syntax.
python-version: '3.x' // Version range or exact version of a Python version to use, using semvers version range syntax.
architecture: 'x64' // (x64 or x86)
- run: python my_script.py
```
Expand All @@ -38,7 +38,7 @@ jobs:
- name: Setup python
uses: actions/setup-python@v1
with:
version: ${{ matrix.python }}
python-version: ${{ matrix.python }}
architecture: x64
- run: python my_script.py
```
Expand Down
7 changes: 5 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
name: 'Setup Python environment'
description: 'Setup a Python environment and add it to the PATH, additionally providing proxy support'
author: 'GitHub'
inputs:
version:
inputs:
python-version:
description: 'Version range or exact version of a Python version to use, using semvers version range syntax.'
default: '3.x'
architecture:
description: 'The target architecture (x86, x64) of the Python interpreter.'
default: 'x64'
# Deprecated option, do not use. Will not be supported after October 1, 2019
version:
description: 'Deprecated. Use python-version instead. Will not be supported after October 1, 2019'
runs:
using: 'node12'
main: 'lib/setup-python.js'
5 changes: 4 additions & 1 deletion lib/setup-python.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ const path = __importStar(require("path"));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const version = core.getInput('version');
let version = core.getInput('version');
if (!version) {
version = core.getInput('python-version');
}
if (version) {
const arch = core.getInput('architecture', { required: true });
yield finder.findPythonVersion(version, arch);
Expand Down
5 changes: 4 additions & 1 deletion src/setup-python.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@ import * as path from 'path';

async function run() {
try {
const version: string = core.getInput('version');
let version = core.getInput('version');
if (!version) {
version = core.getInput('python-version');
}
if (version) {
const arch: string = core.getInput('architecture', {required: true});
await finder.findPythonVersion(version, arch);
Expand Down