Skip to content

Commit 6f82494

Browse files
authored
Merge pull request #31 from cybertec-postgresql/python-install-fix
Python install fix
2 parents d07b808 + 59f4f94 commit 6f82494

3 files changed

Lines changed: 48 additions & 8 deletions

File tree

.github/workflows/release.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
on:
2-
push:
3-
tags:
4-
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
2+
release:
3+
types: [created]
54

65
name: Upload Release Asset
76

@@ -10,9 +9,12 @@ jobs:
109
name: Upload Release Asset
1110
runs-on: windows-latest
1211
steps:
12+
- uses: actions/setup-python@v3
13+
with:
14+
python-version: '3.10.4'
1315

1416
- name: Checkout code
15-
uses: actions/checkout@v2
17+
uses: actions/checkout@v3
1618

1719
- name: Build project # This would actually build your project, using zip for an example artifact
1820
run: |

.github/workflows/test.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Test
2+
on:
3+
pull_request:
4+
workflow_dispatch:
5+
6+
jobs:
7+
8+
test-windows:
9+
if: true # false to skip job during debug
10+
name: Test Python set up
11+
runs-on: windows-latest
12+
steps:
13+
- uses: actions/setup-python@v3
14+
with:
15+
python-version: '3.10.4'
16+
17+
- name: Check out code
18+
uses: actions/checkout@v3
19+
20+
- name: Test
21+
run: |
22+
.\install-env.bat

install-env.bat

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,25 @@
11
@ECHO off
22

3-
SET PYTHON_REF=https://www.python.org/ftp/python/3.10.2/python-3.10.2-amd64.exe
4-
SET PYTHON=python.exe
5-
SET PIP=pip3.exe
3+
setlocal enableDelayedExpansion
64

5+
set "PYTHON_REF=https://www.python.org/ftp/python/3.10.4/python-3.10.4-amd64.exe"
6+
set PYTHON="python.exe"
7+
set PIP="pip3.exe"
8+
if "%RUNNER_TOOL_CACHE%"=="" (
9+
echo Running on a local maching builder
10+
set PYTHON="%ProgramFiles%\Python310\python.exe"
11+
)
12+
if "%RUNNER_TOOL_CACHE%"=="" (
13+
set PIP="%ProgramFiles%\Python310\Scripts\pip3.exe"
14+
)
15+
16+
echo Loading the Python installation...
717
curl %PYTHON_REF% --output python-install.exe
818
python-install.exe /quiet InstallAllUsers=1 PrependPath=1 Include_test=0 Include_launcher=0
9-
%PYTHON% -m pip install --upgrade pip
19+
%PYTHON% -m pip install --upgrade pip
20+
21+
echo Python version is:
22+
%PYTHON% --version
23+
24+
echo PIP version is:
25+
%PIP% --version

0 commit comments

Comments
 (0)