-
Notifications
You must be signed in to change notification settings - Fork 0
92 lines (78 loc) · 3.17 KB
/
Copy pathwindows.yml
File metadata and controls
92 lines (78 loc) · 3.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
name: Windows
on:
workflow_dispatch:
workflow_call:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout installer
uses: actions/checkout@v4
- name: Download compiler nightly bundle
shell: cmd
run: |
curl -L -o fpc-bundle.zip https://github.com/unleashedpascal/compiler/releases/download/nightly/windows-bundle.zip
- name: Extract compiler to C:\fpc
shell: cmd
run: |
"C:\Program Files\7-Zip\7z.exe" x -bd -y fpc-bundle.zip -oC:\ >nul
dir C:\fpc\bin\x86_64-win64
- name: Write fpc.cfg
shell: powershell
run: |
$target = "x86_64-win64"
$cfg = "C:\fpc\bin\$target\fpc.cfg"
$lines = @("# Unleashed Pascal minimal config")
foreach ($d in Get-ChildItem -Path "C:\fpc\units\$target" -Directory) {
$lines += "-Fu$($d.FullName)"
}
$lines | Set-Content -Encoding ASCII $cfg
- name: Smoke-test FPC
shell: powershell
run: |
"begin writeln('hello'); end." | Set-Content -Encoding ASCII C:\hello.pas
C:\fpc\bin\x86_64-win64\ppcx64.exe -viq C:\hello.pas
C:\hello.exe
- name: Download IDE nightly bundle
shell: cmd
run: |
curl -L -o laz-bundle.zip https://github.com/unleashedpascal/ide/releases/download/nightly/windows-bundle.zip
- name: Extract IDE to C:\laz
shell: powershell
run: |
New-Item -ItemType Directory -Force -Path C:\laz | Out-Null
& "C:\Program Files\7-Zip\7z.exe" x -bd -y laz-bundle.zip -oC:\laz | Out-Null
if (-not (Test-Path C:\laz\lazbuild.exe)) { throw "lazbuild.exe missing after extract" }
- name: Setup PATH (FPC)
shell: powershell
run: echo "C:\fpc\bin\x86_64-win64" >> $env:GITHUB_PATH
- name: Bump BuildNr to run number
shell: powershell
run: |
# Lazarus omits <BuildNr> when it equals the default 0, so the
# element may be absent in the committed .lpi. Insert it before
# </VersionInfo> when missing, otherwise replace the existing value.
$lpi = "src\installer.lpi"
$n = $env:GITHUB_RUN_NUMBER
$c = Get-Content $lpi -Raw
if ($c -match '<BuildNr Value="\d+"/>') {
$c = $c -replace '<BuildNr Value="\d+"/>', "<BuildNr Value=""$n""/>"
} else {
$c = $c -replace '</VersionInfo>', " <BuildNr Value=""$n""/>`n </VersionInfo>"
}
Set-Content -Encoding UTF8 -Path $lpi -Value $c
Select-String -Path $lpi -Pattern '<BuildNr'
- name: Build installer
shell: cmd
working-directory: ${{ github.workspace }}
run: |
C:\laz\lazbuild.exe --lazarusdir=C:\laz --build-mode=win64_release src\installer.lpi
if not exist installer_win64_x86_64.exe (echo installer_win64_x86_64.exe missing & exit /b 1)
- name: Upload installer_win64_x86_64.exe
uses: actions/upload-artifact@v4
with:
name: installer_win64_x86_64.exe
path: installer_win64_x86_64.exe
retention-days: 7