Skip to content

Lape update (wip)

Lape update (wip) #909

Workflow file for this run

name: build
on:
push:
branches:
- '**'
pull_request:
branches:
- '**'
jobs:
build:
name: ${{ matrix.config.name }}
runs-on: ${{ matrix.config.runs-on }}
defaults:
run:
shell: bash
strategy:
fail-fast: false
matrix:
config:
- name: Windows 64
runs-on: windows-latest
build-mode: WIN64
binary: Simba-Win64.exe
test: Simba-Win64.exe
- name: Windows 32
runs-on: windows-latest
build-mode: WIN32
binary: Simba-Win32.exe
test: Simba-Win32.exe
- name: Linux 64
runs-on: ubuntu-22.04
build-mode: LINUX64
binary: Simba-Linux64
test: Simba-Linux64
- name: MacOS 64
runs-on: macos-13
build-mode: MACOS64
binary: Simba-MacOS.dmg
test: Simba
- name: MacOS AArch64
runs-on: macos-13
build-mode: MACOS-AARCH64
binary: Simba-MacOS-AArch64.dmg
#test: Simba MatchTemplateMask test fails, investigate later
steps:
- uses: actions/[email protected]
with:
submodules: true
- name: Install Lazarus (MacOS)
if: startsWith(matrix.config.name, 'MacOS') == true
uses: ollydev/[email protected]
with:
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%203.6/Lazarus-3.6-macosx-x86_64.pkg
fpc-url: |
https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%203.6/fpc-3.2.2.intelarm64-macosx.dmg
https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%203.6/fpc-src-3.2.2-20210709-macosx.dmg
- name: Install Lazarus (Linux)
if: startsWith(matrix.config.name, 'Linux') == true
uses: ollydev/[email protected]
with:
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.6/lazarus-project_3.6.0-0_amd64.deb
fpc-url: |
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.6/fpc-laz_3.2.2-210709_amd64.deb
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.6/fpc-src_3.2.2-210709_amd64.deb
- name: Install Lazarus (Windows 32)
if: startsWith(matrix.config.name, 'Windows 32') == true
uses: ollydev/[email protected]
with:
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%203.6/lazarus-3.6-fpc-3.2.2-win32.exe
- name: Install Lazarus (Windows 64)
if: startsWith(matrix.config.name, 'Windows 64') == true
uses: ollydev/[email protected]
with:
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%203.6/lazarus-3.6-fpc-3.2.2-win64.exe
- name: Build Simba
run: |
export GITHUB_SHORT_SHA=$(git rev-parse --short HEAD)
lazbuild --build-mode=${{ matrix.config.build-mode }} "Source/Simba.lpi"
- name: Create MacOS Image
if: startsWith(matrix.config.name, 'MacOS') == true
env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
# echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output certificate.p12
# security create-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security default-keychain -s build.keychain
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" build.keychain
# security import certificate.p12 -k build.keychain -P "$P12_PASSWORD" -T /usr/bin/codesign
# security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k "$KEYCHAIN_PASSWORD" build.keychain
# codesign --deep --sign "7ACAD7EE0AA3A0783CE9592567098A3F08FC0B0B" Simba.app
# codesign -v Simba.app
brew install create-dmg
for i in {1..10};
do
create-dmg --window-size 500 330 --icon-size 48 --icon "Simba.app" 130 135 --app-drop-link 380 135 --background "Source/macosbundle/installer.tff" "${{ matrix.config.binary }}" "Simba.app" && break || sleep 15;
done
- name: Test Simba
if: matrix.config.test != ''
run: |
if [[ "${{ matrix.config.runs-on }}" == ubuntu* ]]; then
export DISPLAY=:1
Xvfb :1 & sleep 2
fi
chmod +x ${{ matrix.config.test }}
./${{ matrix.config.test }} --run "Tests/RunTests/tester.simba"
- name: Upload Simba Binary
uses: actions/[email protected]
with:
name: ${{ matrix.config.binary }}
path: ${{ matrix.config.binary }}