Skip to content

Commit 805b123

Browse files
Refactor CI/CD workflows for macOS and Ubuntu
- Download Lazarus source code into temp folder - Add lazbuild to the PATH variable.
1 parent be013ed commit 805b123

File tree

2 files changed

+39
-15
lines changed

2 files changed

+39
-15
lines changed

.github/workflows/cicd_macos.yaml

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,33 +16,55 @@ jobs:
1616
runs-on: macos-latest
1717
timeout-minutes: 60
1818
env:
19-
LAZBUILD_WITH_PATH: /Applications/Lazarus/lazbuild
2019
MACOS_APP: enduser/trackereditor.app
2120
PROGRAM_NAME_WITH_PATH: 'enduser/trackereditor'
2221
BUILD_WITH_CERTIFICATE: ${{ secrets.PROD_MACOS_CERTIFICATE_NAME }}
2322
PROJECT_LPI: source/project/tracker_editor/trackereditor.lpi
2423
RELEASE_DMG_FILE: trackereditor_macOS_notarized_universal_binary.dmg
24+
# Copied the latest Lazarus source code from: https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/
25+
LAZARUS_URL_TAR_GZ: "https://github.com/GerryFerdinandus/bittorrent-tracker-editor/releases/download/V1.32.0/lazarus.tar.gz"
2526

2627
steps:
2728
- uses: actions/checkout@v4
2829
with:
2930
submodules: true
3031

31-
- name: Install Lazarus IDE
32-
run: brew install --cask lazarus
32+
- name: Install Free Pascal Compiler (FPC) multi arch version for macOS x86_64 and aarch64
33+
run: brew install --cask fpc-laz
34+
shell: bash
3335

3436
- name: Install Create dmg
3537
run: brew install create-dmg
3638

39+
- name: Download Lazarus source code into temp folder
40+
run: |
41+
#Download lazarus source code. Directory 'lazarus' will be created in the temp folder.
42+
cd ${RUNNER_TEMP}
43+
curl -L -O ${{ env.LAZARUS_URL_TAR_GZ }}
44+
tar -xzf *.tar.gz
45+
shell: bash
46+
47+
- name: Build lazbuild from Lazarus source code
48+
run: |
49+
# make lazbuild and put the link with extra parameter in the temp folder.
50+
LAZARUS_DIR=${RUNNER_TEMP}/lazarus
51+
cd "$LAZARUS_DIR"
52+
make lazbuild
53+
echo "$LAZARUS_DIR/lazbuild --primary-config-path=$LAZARUS_DIR --lazarusdir=$LAZARUS_DIR \$*" > ${RUNNER_TEMP}/lazbuild
54+
chmod +x ${RUNNER_TEMP}/lazbuild
55+
# Add lazbuild to the PATH variable. So it can be used in the next steps.
56+
echo ${RUNNER_TEMP} >> $GITHUB_PATH
57+
shell: bash
58+
3759
- name: Build trackereditor app for Apple silicon (aarch64)
3860
run: |
39-
${{ env.LAZBUILD_WITH_PATH }} --build-all --build-mode=Release --widgetset=cocoa --cpu=aarch64 ${{ env.PROJECT_LPI }}
61+
lazbuild --build-all --build-mode=Release --widgetset=cocoa --cpu=aarch64 ${{ env.PROJECT_LPI }}
4062
mv ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-aarch64
4163
shell: bash
4264

4365
- name: Build trackereditor app for Intel Mac version (x86_64)
4466
run: |
45-
${{ env.LAZBUILD_WITH_PATH }} --build-all --build-mode=Release --widgetset=cocoa --cpu=x86_64 ${{ env.PROJECT_LPI }}
67+
lazbuild --build-all --build-mode=Release --widgetset=cocoa --cpu=x86_64 ${{ env.PROJECT_LPI }}
4668
mv ${{ env.PROGRAM_NAME_WITH_PATH }} ${{ env.PROGRAM_NAME_WITH_PATH }}-x86_64
4769
shell: bash
4870

.github/workflows/cicd_ubuntu.yaml

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -97,36 +97,38 @@ jobs:
9797
chmod +x linuxdeploy-*.AppImage
9898
shell: bash
9999

100-
- name: Download Lazarus source code
100+
- name: Download Lazarus source code into temp folder
101101
run: |
102-
#Download lazarus source code. Directory 'lazarus' will be created in the project folder.
102+
#Download lazarus source code. Directory 'lazarus' will be created in the temp folder.
103+
cd ${RUNNER_TEMP}
103104
curl -L -O ${{ env.LAZARUS_URL_TAR_GZ }}
104105
tar -xzf *.tar.gz
105106
shell: bash
106107

107108
- name: Build libQTpas.so
108109
if: matrix.QT_VERSION_CI != ''
109110
run: |
110-
cd "${{ github.workspace }}/lazarus/lcl/interfaces/qt${{ matrix.QT_VERSION_CI }}/cbindings/"
111+
cd "${RUNNER_TEMP}/lazarus/lcl/interfaces/qt${{ matrix.QT_VERSION_CI }}/cbindings/"
111112
/usr/lib/qt${{ matrix.QT_VERSION_CI }}/bin/qmake
112113
make -j$(nproc)
113114
sudo make install
114115
shell: bash
115116

116-
- name: Build lazbuild
117-
env:
118-
LAZARUS_DIR: "${{ github.workspace }}/lazarus"
117+
- name: Build lazbuild from Lazarus source code
119118
run: |
120-
# make lazbuild and put the link with extra parameter in project folder
119+
# make lazbuild and put the link with extra parameter in the temp folder.
120+
LAZARUS_DIR=${RUNNER_TEMP}/lazarus
121121
cd "$LAZARUS_DIR"
122122
make lazbuild
123-
echo "$LAZARUS_DIR/lazbuild --primary-config-path=$LAZARUS_DIR --lazarusdir=$LAZARUS_DIR \$*" > ${{ github.workspace }}/lazbuild
124-
chmod +x ${{ github.workspace }}/lazbuild
123+
echo "$LAZARUS_DIR/lazbuild --primary-config-path=$LAZARUS_DIR --lazarusdir=$LAZARUS_DIR \$*" > ${RUNNER_TEMP}/lazbuild
124+
chmod +x ${RUNNER_TEMP}/lazbuild
125+
# Add lazbuild to the PATH variable. So it can be used in the next steps.
126+
echo ${RUNNER_TEMP} >> $GITHUB_PATH
125127
shell: bash
126128

127129
- name: Build trackereditor
128130
# Build trackereditor project (Release mode)
129-
run: ./lazbuild --build-all --build-mode=Release ${{ matrix.LAZ_OPT }} source/project/tracker_editor/trackereditor.lpi
131+
run: lazbuild --build-all --build-mode=Release ${{ matrix.LAZ_OPT }} source/project/tracker_editor/trackereditor.lpi
130132
shell: bash
131133

132134
- name: Test if OpenSSL works on Linux CI

0 commit comments

Comments
 (0)