Add support of pre-release Python versions (#112) · retzero/setup-python@306c473 · GitHub
Skip to content

Commit 306c473

Browse files
MaksimZhukovMaksimZhukov
andauthored
Add support of pre-release Python versions (actions#112)
* Add support of unstable Python versions * Update README * Get rid of stable boolean input * Fix typo in the test.yml * Update README Co-authored-by: MaksimZhukov <v-mazhuk@microsoft.com>
1 parent 7a69c2b commit 306c473

7 files changed

Lines changed: 5911 additions & 5803 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 29 additions & 0 deletions

‎README.md‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ This action sets up a Python environment for use in actions by:
1616
- Ability to download, install and set up Python packages from `actions/python-versions` that do not come preinstalled on runners
1717
- Allows for pinning to a specific patch version of Python without the worry of it ever being removed or changed
1818
- Automatic setup and download of Python packages if using a self-hosted runner
19+
- Support for pre-release versions of Python
1920

2021
# Usage
2122

@@ -92,6 +93,26 @@ jobs:
9293

9394
```
9495

96+
Download and set up a accurate pre-release version of Python:
97+
```yaml
98+
steps:
99+
- uses: actions/checkout@v2
100+
- uses: actions/setup-python@v2
101+
with:
102+
python-version: '3.9.0-beta.4'
103+
- run: python my_script.py
104+
```
105+
106+
Download and set up the latest available version of Python (includes both pre-release and stable versions):
107+
```yaml
108+
steps:
109+
- uses: actions/checkout@v2
110+
- uses: actions/setup-python@v2
111+
with:
112+
python-version: '3.9.0-alpha - 3.9.0' # SemVer's version range syntax
113+
- run: python my_script.py
114+
```
115+
95116
# Getting started with Python + Actions
96117
97118
Check out our detailed guide on using [Python with GitHub Actions](https://help.github.com/en/actions/automating-your-workflow-with-github-actions/using-python-with-github-actions).

‎__tests__/data/python-release.json‎

Lines changed: 0 additions & 13 deletions
This file was deleted.
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
[
2+
{
3+
"version": "1.2.3",
4+
"stable": true,
5+
"release_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.6",
6+
"files": [
7+
{
8+
"filename": "sometool-1.2.3-linux-x64.tar.gz",
9+
"arch": "x64",
10+
"platform": "linux",
11+
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.6/sometool-1.2.3-linux-x64.tar.gz"
12+
},
13+
{
14+
"filename": "sometool-1.2.3-darwin-x64.tar.gz",
15+
"arch": "x64",
16+
"platform": "darwin",
17+
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.6/sometool-1.2.3-darwin-x64.tar.gz"
18+
},
19+
{
20+
"filename": "sometool-1.2.3-win32-x64.tar.gz",
21+
"arch": "x64",
22+
"platform": "win32",
23+
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.6/sometool-1.2.3-win32-x64.tar.gz"
24+
}
25+
]
26+
},
27+
{
28+
"version": "1.2.3-beta.2",
29+
"stable": false,
30+
"release_url": "https://github.com/actions/sometool/releases/tag/1.2.3-beta.2-20200402.5",
31+
"files": [
32+
{
33+
"filename": "sometool-1.2.3-linux-x64.tar.gz",
34+
"arch": "x64",
35+
"platform": "linux",
36+
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-beta.2-20200402.5/sometool-1.2.3-linux-x64.tar.gz"
37+
},
38+
{
39+
"filename": "sometool-1.2.3-darwin-x64.tar.gz",
40+
"arch": "x64",
41+
"platform": "darwin",
42+
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.5/sometool-1.2.3-darwin-x64.tar.gz"
43+
},
44+
{
45+
"filename": "sometool-1.2.3-win32-x64.tar.gz",
46+
"arch": "x64",
47+
"platform": "win32",
48+
"download_url": "https://github.com/actions/sometool/releases/tag/1.2.3-20200402.5/sometool-1.2.3-win32-x64.tar.gz"
49+
}
50+
]
51+
}
52+
]

‎__tests__/finder.test.ts‎

Lines changed: 26 additions & 7 deletions

0 commit comments

Comments
 (0)