Skip to content

Commit 2d165f5

Browse files
authored
[!] introduce Powershell scripts (#85)
* [!] introduce Powershell scripts * [*] use `clean.ps1` in `Start-Bootstrapping`
1 parent 8f7336e commit 2d165f5

File tree

11 files changed

+209
-184
lines changed

11 files changed

+209
-184
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ jobs:
1818
uses: actions/checkout@v4
1919

2020
- name: Build project # This would actually build your project, using zip for an example artifact
21+
shell: pwsh
2122
run: |
22-
.\make.bat
23+
.\make.ps1
2324
2425
- name: Create Release
2526
id: create_release

.github/workflows/test.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77

88
test-windows:
99
if: true # false to skip job during debug
10-
name: Test Python set up
10+
name: Build assets
1111
runs-on: windows-latest
1212
steps:
1313
- uses: actions/setup-python@v5
@@ -18,5 +18,6 @@ jobs:
1818
uses: actions/checkout@v4
1919

2020
- name: Test
21+
shell: pwsh
2122
run: |
22-
.\install-env.bat
23+
.\make.ps1

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
/pgsql*
2-
/etcd*
3-
/pes*
1+
pes
42
*.zip
53
*.exe

clean.bat

Lines changed: 0 additions & 4 deletions
This file was deleted.

clean.ps1

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Set the environment variables
2+
. .\env.ps1
3+
4+
Remove-Item -Recurse -Force "$MD", "patroni" -ErrorAction SilentlyContinue
5+
Remove-Item -Force `
6+
"*.zip", `
7+
"*.exe", `
8+
"$env:TEMP\etcd.zip", `
9+
"$env:TEMP\pes.zip", `
10+
"$env:TEMP\micro.zip", `
11+
"$env:TEMP\vip.zip", `
12+
"$env:TEMP\pgsql.zip", `
13+
"$env:TEMP\patroni.zip" `
14+
-ErrorAction SilentlyContinue

env.ps1

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
$MD = "PES"
2+
$VCREDIST_REF = "https://aka.ms/vs/17/release/vc_redist.x64.exe"
3+
$ETCD_REF = "https://github.com/etcd-io/etcd/releases/download/v3.5.16/etcd-v3.5.16-windows-amd64.zip"
4+
$PATRONI_REF = "https://github.com/patroni/patroni/archive/refs/tags/v4.0.2.zip"
5+
$MICRO_REF = "https://github.com/zyedidia/micro/releases/download/v2.0.14/micro-2.0.14-win64.zip"
6+
$WINSW_REF = "https://github.com/winsw/winsw/releases/download/v2.12.0/WinSW.NET461.exe"
7+
$VIP_REF = "https://github.com/cybertec-postgresql/vip-manager/releases/download/v2.6.0/vip-manager_2.6.0_Windows_x86_64.zip"
8+
$PGSQL_REF = "https://get.enterprisedb.com/postgresql/postgresql-16.4-1-windows-x64-binaries.zip"
9+
$PYTHON_REF = "https://www.python.org/ftp/python/3.12.5/python-3.12.5-amd64.exe"
10+
# one should change python version in github action workflows when changed here
11+
12+
$SEVENZIP = "C:\Program Files\7-Zip\7z.exe"
13+
14+
$INNOTOOL = "C:\Program Files (x86)\Inno Setup 6"
15+
$ISCC = Join-Path $INNOTOOL "iscc.exe"
16+
$ISSFile = "installer\patroni.iss"

install-env.bat

Lines changed: 0 additions & 29 deletions
This file was deleted.

install-python.ps1

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Set the environment variables
2+
. .\env.ps1
3+
4+
$PYTHON = "python.exe"
5+
$PIP = "pip3.exe"
6+
7+
if (-Not $env:RUNNER_TOOL_CACHE) {
8+
Write-Host "Running on a local machine builder" -ForegroundColor Yellow
9+
$PYTHON = "$env:ProgramFiles\Python312\python.exe"
10+
$PIP = "$env:ProgramFiles\Python312\Scripts\pip3.exe"
11+
}
12+
13+
Write-Host "Loading the Python installation..." -ForegroundColor Blue
14+
Invoke-WebRequest -Uri $PYTHON_REF -OutFile "python-install.exe"
15+
Start-Process -FilePath "python-install.exe" -ArgumentList "/quiet InstallAllUsers=1 PrependPath=1 Include_test=0 Include_launcher=0" -Wait
16+
17+
& $PYTHON -m pip install --upgrade pip
18+
19+
Write-Host "Python version is:" -ForegroundColor Green
20+
& $PYTHON --version
21+
22+
Write-Host "PIP version is:" -ForegroundColor Green
23+
& $PIP --version
24+
25+
$global:PYTHON = $PYTHON
26+
$global:PIP = $PIP

make-installer.bat

Lines changed: 0 additions & 11 deletions
This file was deleted.

make.bat

Lines changed: 0 additions & 134 deletions
This file was deleted.

0 commit comments

Comments
 (0)