-
Notifications
You must be signed in to change notification settings - Fork 76
131 lines (112 loc) · 4.97 KB
/
build.yml
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
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 }}