-
Notifications
You must be signed in to change notification settings - Fork 0
65 lines (65 loc) · 2.69 KB
/
Copy pathlinux-build.yml
File metadata and controls
65 lines (65 loc) · 2.69 KB
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
name: Build LaTeX Editor for Linux
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Install Qt
uses: jurplel/install-qt-action@v3
with:
version: '6.2.4'
host: 'linux'
target: 'desktop'
arch: 'gcc_64'
dir: '${{ github.workspace }}/qt/'
install-deps: 'true'
- name: Install additional dependencies
run: |
sudo apt-get update
sudo apt-get install -y libgl1-mesa-dev
- name: List Qt installation directory
run: |
echo "Listing Qt directory:"
ls -R ${{ github.workspace }}/qt/
- name: Create Build Environment
run: cmake -E make_directory ${{github.workspace}}/build
- name: Configure CMake
shell: bash
working-directory: ${{github.workspace}}/build
run: |
cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH=${{ env.Qt6_DIR }}
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: cmake --build . --config Release
- name: List build directory
run: ls -R ${{github.workspace}}/build
- name: Find and copy Qt libraries
run: |
mkdir -p ${{github.workspace}}/deploy/lib
cp ${{github.workspace}}/build/LaTeXEditor ${{github.workspace}}/deploy/
find ${{ env.Qt6_DIR }} -name "libQt6Core.so*" -exec cp -L {} ${{github.workspace}}/deploy/lib/ \;
find ${{ env.Qt6_DIR }} -name "libQt6Gui.so*" -exec cp -L {} ${{github.workspace}}/deploy/lib/ \;
find ${{ env.Qt6_DIR }} -name "libQt6Widgets.so*" -exec cp -L {} ${{github.workspace}}/deploy/lib/ \;
find ${{ env.Qt6_DIR }} -name "plugins" -type d -exec cp -r {} ${{github.workspace}}/deploy/ \;
- name: Create launch script
run: |
echo '#!/bin/bash' > ${{github.workspace}}/deploy/run_LaTeXEditor.sh
echo 'DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"' >> ${{github.workspace}}/deploy/run_LaTeXEditor.sh
echo 'export LD_LIBRARY_PATH="$DIR/lib:$LD_LIBRARY_PATH"' >> ${{github.workspace}}/deploy/run_LaTeXEditor.sh
echo 'export QT_PLUGIN_PATH="$DIR/plugins"' >> ${{github.workspace}}/deploy/run_LaTeXEditor.sh
echo '"$DIR/LaTeXEditor"' >> ${{github.workspace}}/deploy/run_LaTeXEditor.sh
chmod +x ${{github.workspace}}/deploy/run_LaTeXEditor.sh
- name: Create tarball
run: tar -czvf LaTeXEditor-linux.tar.gz -C ${{github.workspace}}/deploy .
- name: Upload artifact
uses: actions/upload-artifact@v2
with:
name: LaTeXEditor-linux-latest
path: ${{github.workspace}}/LaTeXEditor-linux.tar.gz