Skip to content

Commit 96f6a6d

Browse files
authored
Refactor GitHub Actions workflow for builds
1 parent dc3b0d0 commit 96f6a6d

File tree

1 file changed

+39
-35
lines changed

1 file changed

+39
-35
lines changed

.github/workflows/make.yml

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
---
21
name: Make
32

43
on:
54
schedule:
6-
- cron: '0 0 1 * *'
5+
- cron: '0 0 1 * *'
76
push:
87
branches:
98
- "**"
@@ -27,36 +26,41 @@ jobs:
2726
- windows-latest
2827

2928
steps:
30-
- name: Checkout
31-
uses: actions/checkout@v4
32-
with:
33-
submodules: true
34-
35-
- name: Build on Linux
36-
if: runner.os == 'Linux'
37-
shell: bash
38-
run: |
39-
set -xeuo pipefail
40-
sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null
41-
instantfpc -Fu/usr/lib/lazarus/*/components/lazutils \
42-
-B '.github/workflows/make.pas'
43-
44-
- name: Build on Windows
45-
if: runner.os == 'Windows'
46-
shell: powershell
47-
run: |
48-
$ErrorActionPreference = 'stop'
49-
Set-PSDebug -Strict
50-
New-Variable -Option Constant -Name VAR -Value @{
51-
Uri =
52-
'https://fossies.org/windows/misc/lazarus-3.8-fpc-3.2.2-win64.exe'
53-
OutFile = (New-TemporaryFile).FullName + '.exe'
54-
}
55-
Invoke-WebRequest @VAR
56-
& $VAR.OutFile.Replace('Temp', 'Temp\.') /SP- /VERYSILENT /NORESTART `
57-
/SUPPRESSMSGBOXES | Out-Null
58-
$Env:PATH+=';C:\Lazarus'
59-
$Env:PATH+=';C:\Lazarus\fpc\3.2.2\bin\x86_64-win64'
60-
'lazbuild', 'instantfpc' | % { (Get-Command $_).Source } | Out-Host
61-
instantfpc -FuC:\Lazarus\components\lazutils `
62-
-B '.github/workflows/make.pas'
29+
- name: Checkout
30+
uses: actions/checkout@v4
31+
with:
32+
submodules: true
33+
34+
- name: Build on Linux
35+
if: runner.os == 'Linux'
36+
shell: bash
37+
run: |
38+
set -xeuo pipefail
39+
sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null
40+
instantfpc -Fu/usr/lib/lazarus/*/components/lazutils .github/workflows/make.pas
41+
42+
- name: Build on Windows
43+
if: runner.os == 'Windows'
44+
shell: powershell
45+
run: |
46+
$ErrorActionPreference = 'stop'
47+
Set-PSDebug -Strict
48+
49+
Write-Host "Installing Lazarus and OpenSSL 1.1 via Chocolatey..."
50+
choco upgrade chocolatey -y
51+
choco install lazarus -y
52+
choco install openssl.light --version=1.1.1.20181020 -y
53+
54+
Write-Host "Verifying installed packages..."
55+
choco list
56+
57+
# Lazarus installs to C:\Lazarus by default
58+
# Add Lazarus and OpenSSL paths for instantfpc
59+
$env:Path += ';C:\Lazarus;C:\Lazarus\fpc\3.2.2\bin\x86_64-win64;C:\ProgramData\chocolatey\lib\openssl.light\tools'
60+
61+
Write-Host "Checking lazbuild and instantfpc availability..."
62+
Get-Command lazbuild
63+
Get-Command instantfpc
64+
65+
Write-Host "Building make.pas..."
66+
instantfpc '-FuC:\Lazarus\components\lazutils' .github/workflows/make.pas

0 commit comments

Comments
 (0)