Add files via upload #185
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Make | |
on: | |
schedule: | |
- cron: '0 0 1 * *' | |
push: | |
branches: | |
- "**" | |
pull_request: | |
branches: | |
- sources | |
- master | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
timeout-minutes: 120 | |
strategy: | |
matrix: | |
os: | |
- ubuntu-latest | |
- windows-latest | |
- macos-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
submodules: true | |
- name: Build on Linux | |
if: runner.os == 'Linux' | |
shell: bash | |
run: | | |
set -xeuo pipefail | |
sudo bash -c 'apt-get update; apt-get install -y lazarus' >/dev/null | |
declare -rx INSTANTFPCOPTIONS=-Fu/usr/lib/lazarus/*/components/lazutils | |
instantfpc '.github/workflows/make.pas' build | |
- name: Build | |
if: runner.os == 'Macos' | |
shell: python | |
run: | | |
"""https://macappstore.org/lazarus""" | |
import os | |
import sys | |
import subprocess | |
subprocess.run( | |
"openssl version -a".split(), | |
check=True, | |
) | |
OPENSSL=subprocess.run( | |
"brew --prefix openssl@1.1".split(), | |
check=True, | |
capture_output=True, | |
).stdout.decode().strip("\n") | |
os.environ["PATH"] += f":{OPENSSL}/bin" | |
os.environ["DYLD_LIBRARY_PATH"] = f"{OPENSSL}/lib" | |
subprocess.run( | |
"brew install --cask lazarus".split(), | |
check=True, | |
capture_output=True, | |
) | |
os.environ["INSTANTFPCOPTIONS"] = "-Fu/Applications/Lazarus/components/lazutils" | |
os.environ["PATH"] += ":/Applications/Lazarus" | |
subprocess.run( | |
"lazbuild -v".split(), | |
check=True, | |
) | |
os.environ["INSTANTFPCOPTIONS"] = "-Fu/Applications/Lazarus/components/lazutils" | |
sys.exit(subprocess.run( | |
"instantfpc .github/workflows/make.pas build".split(), | |
).returncode) | |
- name: Build on Windows | |
if: runner.os == 'Windows' | |
shell: powershell | |
run: | | |
New-Variable -Option Constant -Name VAR -Value @{ | |
Uri = 'https://download.lazarus-ide.org/Lazarus%20Windows%2064%20bits/Lazarus%203.6/lazarus-3.6-fpc-3.2.2-win64.exe' | |
OutFile = (New-TemporaryFile).FullName + '.exe' | |
} | |
Invoke-WebRequest @VAR | |
& $VAR.OutFile.Replace('Temp', 'Temp\.') /SP- /VERYSILENT /SUPPRESSMSGBOXES /NORESTART | Out-Null | |
$Env:PATH+=';C:\Lazarus' | |
$Env:PATH+=';C:\Lazarus\fpc\3.2.2\bin\x86_64-win64' | |
(Get-Command 'lazbuild').Source | Out-Host | |
(Get-Command 'instantfpc').Source | Out-Host | |
$Env:INSTANTFPCOPTIONS='-FuC:\Lazarus\components\lazutils' | |
instantfpc '.github\workflows\make.pas' build |