Skip to content

Commit

Permalink
Use Rocky8-based Docker image for Linux builds (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
lighterowl authored Aug 21, 2024
1 parent 6a5f5a5 commit 3b92840
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 86 deletions.
21 changes: 21 additions & 0 deletions .github/build_linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env bash

set -xe

readonly build=$(git rev-list --abbrev-commit --max-count=1 HEAD)
sed -i "s/@GIT_COMMIT@/$build/" buildinfo.pas

pushd test
lazbuild transguitest.lpi "--lazarusdir=${TRANSGUI_LAZARUS_DIR}"
./units/transguitest -a
popd

lazbuild transgui.lpi --ws=qt5 --build-mode=Release "--lazarusdir=${TRANSGUI_LAZARUS_DIR}"
cd units

readonly app_ver=$(xmllint --xpath 'string(//StringTable/@ProductVersion)' ../transgui.lpi)
LINUXDEPLOY_OUTPUT_VERSION=$app_ver linuxdeploy-x86_64.AppImage \
-e transgui --create-desktop-file --appdir AppDir \
--output appimage -i ../transgui.png --plugin qt
sha256sum transgui-${app_ver}-x86_64.AppImage
mv transgui-${app_ver}-x86_64.AppImage transgui-x86_64.AppImage
74 changes: 0 additions & 74 deletions .github/build_ubuntu.sh

This file was deleted.

20 changes: 9 additions & 11 deletions .github/workflows/ubuntu.yml → .github/workflows/linux.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ubuntu Build
name: Linux Build

on:
push:
Expand All @@ -7,23 +7,21 @@ on:
branches: [main, develop]

jobs:
build-ubuntu:
build-linux:

runs-on: ubuntu-22.04
runs-on: ubuntu-latest
container: lighterowl/transgui-sdk:1.0

steps:
- uses: actions/checkout@v1
with:
submodules: recursive

- uses: actions/cache@v4
with:
path: |
~/.transgui_sdk/lazarus
~/.transgui_sdk/fpc-3.2.4-rc1
key: ubuntu-fpc-lazarus

- run: .github/build_ubuntu.sh
- run: |
git config --global --add safe.directory /__w/transgui/transgui
export HOME=/root
source /root/.transgui_sdk/source.me
./.github/build_linux.sh
- uses: actions/upload-artifact@v4
with:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ cd transgui
lazbuild transgui.lpi
```

If you hit trouble, have a look at `build_` scripts in the `.github` folder. They are used to build the project for each of the supported platforms in GitHub Actions.
If you hit trouble, have a look at `build_` scripts in the `.github` folder. They are used to build the project for each of the supported platforms in GitHub Actions. If you can run Docker containers, you might find it easier to just use [`lighterowl/transgui-sdk`](https://hub.docker.com/r/lighterowl/transgui-sdk/) which includes the proper versions of FPC and Lazarus.

Due to issues with fpc 3.2.2 mentioned below, it is recommended to build transgui with a development version of the Free Pascal compiler. The `build_` scripts include necessary code that downloads and compiles the development version from source.

Expand Down

0 comments on commit 3b92840

Please sign in to comment.