Skip to content

Commit 2ec6c8d

Browse files
committed
Update build action
1 parent e015237 commit 2ec6c8d

File tree

1 file changed

+52
-47
lines changed

1 file changed

+52
-47
lines changed

.github/workflows/build.yml

Lines changed: 52 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build
1+
name: build
22

33
on:
44
push:
@@ -7,86 +7,91 @@ on:
77
pull_request:
88
branches:
99
- '**'
10-
11-
env:
12-
FPC_VER: release_3_2_2
13-
LAZ_VER: lazarus_2_2_4
1410

1511
jobs:
1612
build:
1713
name: ${{ matrix.config.name }}
18-
runs-on: ${{ matrix.config.os }}
14+
runs-on: ${{ matrix.config.runs-on }}
15+
defaults:
16+
run:
17+
shell: bash
1918
strategy:
2019
fail-fast: false
21-
matrix:
22-
config:
20+
matrix:
21+
config:
2322
- name: Windows 64
24-
os: windows-latest
23+
runs-on: windows-latest
2524
build-mode: WIN64
2625
binary: libsimpleocr64.dll
2726

2827
- name: Windows 32
29-
os: windows-latest
28+
runs-on: windows-latest
3029
build-mode: WIN32
3130
binary: libsimpleocr32.dll
3231

3332
- name: Linux 64
34-
os: ubuntu-latest
33+
runs-on: ubuntu-22.04
3534
build-mode: LINUX64
3635
binary: libsimpleocr64.so
37-
38-
- name: Linux AArch64
39-
os: ubuntu-latest
40-
build-mode: LINUX-AARCH64
41-
binary: libsimpleocr64.so.aarch64
4236

4337
- name: MacOS 64
44-
os: macos-latest
38+
runs-on: macos-13
4539
build-mode: MACOS
4640
binary: libsimpleocr64.dylib
4741

4842
- name: MacOS AArch64
49-
os: macos-latest
43+
runs-on: macos-13
5044
build-mode: MACOS-AARCH64
5145
binary: libsimpleocr64.dylib.aarch64
5246

5347
steps:
54-
- uses: actions/[email protected]
55-
56-
- name: Install Lazarus
57-
uses: ollydev/[email protected]
48+
- uses: actions/[email protected]
49+
with:
50+
submodules: true
51+
52+
- name: Install Lazarus (MacOS)
53+
if: startsWith(matrix.config.name, 'MacOS') == true
54+
uses: ollydev/[email protected]
5855
with:
59-
laz: ${{ env.LAZ_VER }}
60-
fpc: ${{ env.FPC_VER }}
61-
62-
- name: Build SimpleOCR
63-
run: |
64-
lazbuild --build-mode=${{ matrix.config.build-mode }} SimpleOCR.lpi
56+
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%203.6/Lazarus-3.6-macosx-x86_64.pkg
57+
fpc-url: |
58+
https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%203.6/fpc-3.2.2.intelarm64-macosx.dmg
59+
https://sourceforge.net/projects/lazarus/files/Lazarus%20macOS%20x86-64/Lazarus%203.6/fpc-src-3.2.2-20210709-macosx.dmg
6560
66-
- name: Upload Binary
67-
uses: actions/[email protected]
61+
- name: Install Lazarus (Linux)
62+
if: startsWith(matrix.config.name, 'Linux') == true
63+
uses: ollydev/[email protected]
6864
with:
69-
name: ${{ matrix.config.binary }}
70-
path: ${{ matrix.config.binary }}
65+
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.6/lazarus-project_3.6.0-0_amd64.deb
66+
fpc-url: |
67+
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.6/fpc-laz_3.2.2-210709_amd64.deb
68+
https://sourceforge.net/projects/lazarus/files/Lazarus%20Linux%20amd64%20DEB/Lazarus%203.6/fpc-src_3.2.2-210709_amd64.deb
7169
72-
testing:
73-
runs-on: windows-latest
74-
needs: build
75-
steps:
76-
- uses: actions/[email protected]
70+
- name: Install Lazarus (Windows 32)
71+
if: startsWith(matrix.config.name, 'Windows 32') == true
72+
uses: ollydev/[email protected]
73+
with:
74+
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%203.6/lazarus-3.6-fpc-3.2.2-win32.exe
7775

78-
- name: Install Lazarus
79-
uses: ollydev/[email protected]
76+
- name: Install Lazarus (Windows 64)
77+
if: startsWith(matrix.config.name, 'Windows 64') == true
78+
uses: ollydev/[email protected]
8079
with:
81-
laz: ${{ env.LAZ_VER }}
82-
fpc: ${{ env.FPC_VER }}
80+
laz-url: https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%203.6/lazarus-3.6-fpc-3.2.2-win64.exe
81+
82+
- name: Build SimpleOCR
83+
run: lazbuild --build-mode=${{ matrix.config.build-mode }} SimpleOCR.lpi
8384

8485
- name: Build Tester
85-
run: |
86-
cd tester
87-
lazbuild tester.lpi
86+
working-directory: tester
87+
run: lazbuild tester.lpi
8888

8989
- name: Run Tests
90-
run: |
91-
cd tester
92-
./tester.exe
90+
working-directory: tester
91+
run: ./tester
92+
93+
- name: Upload Binary
94+
uses: actions/[email protected]
95+
with:
96+
name: ${{ matrix.config.binary }}
97+
path: ${{ matrix.config.binary }}

0 commit comments

Comments
 (0)