Repository navigation
123 lines (109 loc) · 4.87 KB
/
Copy pathappimage.yml
File metadata and controls
123 lines (109 loc) · 4.87 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
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
# Builds the AppImage for Linux.
#
# It runs when a tag starting with v is pushed (git tag v1.0.0 && git push
# origin v1.0.0), and attaches the AppImage to a release of that name. It can
# also be run by hand from the Actions tab of the repository, in which case
# the AppImage is only kept as an artifact of the run to download.
name: AppImage
on:
push:
tags: ["v*"]
workflow_dispatch:
permissions:
# To make the release.
contents: write
env:
# The Qt that is built with and put in the AppImage. It is Qt's own build,
# as the bindings (qute) are made from the headers of Qt 6.12 and build
# with nothing older, and the Qt of Ubuntu 22.04 is 6.2. (6.9 is also the
# first which can give a window its icon under Wayland, where a window
# otherwise only has the icon of an installed desktop file, which an
# AppImage does not have.)
QT_VERSION: "6.12.0"
QT_ROOT: /opt/qt/6.12.0/gcc_64
jobs:
appimage:
runs-on: ubuntu-latest
# An AppImage runs on systems as new as the one it was built on, or
# newer. Ubuntu 22.04 has glibc 2.35, which is the oldest to support.
container: ubuntu:22.04
steps:
# Besides the tools, these are the system libraries Qt's own build
# uses, most of which go into the AppImage with it.
- name: Install what building needs
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install -y --no-install-recommends \
build-essential pkg-config git curl ca-certificates file python3-pip \
libgl1-mesa-dev libegl1 libglib2.0-0 libdbus-1-3 libfontconfig1 libfreetype6 \
libxkbcommon0 libxkbcommon-x11-0 libxcb-cursor0 libxcb-icccm4 libxcb-image0 \
libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 libxcb-shm0 \
libxcb-sync1 libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libx11-xcb1 \
libwayland-client0 libwayland-cursor0 libwayland-egl1
- uses: actions/cache@v4
id: qt
with:
path: /opt/qt
key: qt-${{ env.QT_VERSION }}-linux_gcc_64-waylandcompositor
- name: Install Qt
if: steps.qt.outputs.cache-hit != 'true'
run: |
pip3 install aqtinstall
aqt install-qt linux desktop "$QT_VERSION" linux_gcc_64 --outputdir /opt/qt --modules qtwaylandcompositor
# Where the compiler, the bundling tool and the program itself find
# that Qt.
- name: Use that Qt
run: |
echo "$QT_ROOT/bin" >> "$GITHUB_PATH"
echo "PKG_CONFIG_PATH=$QT_ROOT/lib/pkgconfig" >> "$GITHUB_ENV"
echo "LD_LIBRARY_PATH=$QT_ROOT/lib" >> "$GITHUB_ENV"
echo "QMAKE=$QT_ROOT/bin/qmake" >> "$GITHUB_ENV"
# The linker is told where the libraries are outright as well, so
# that it does not depend on what was compiled by an earlier run
# remembering the place of another version.
echo "CGO_LDFLAGS=-L$QT_ROOT/lib" >> "$GITHUB_ENV"
# What the build is told about Qt, to read if it fails.
PKG_CONFIG_PATH="$QT_ROOT/lib/pkgconfig" pkg-config --modversion --cflags --libs Qt6Widgets
- uses: actions/checkout@v4
with:
# Every commit and tag, so that the script can find the tag the
# build is or follows, for the about box.
fetch-depth: 0
# In a container the files belong to another user than the one that
# runs the steps, which git refuses to work with unless told to, and
# Go asks git for the version it builds.
- name: Let git read the repository
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
# What is compiled is kept by the step below instead.
cache: false
# The Qt bindings take minutes to compile, so what is compiled is
# kept from one run to the next. It is kept for one version of Qt, as
# what was compiled for another names the place that one was in.
- name: Say where compiled code is kept
run: echo "GOCACHE=/opt/go-build" >> "$GITHUB_ENV"
- uses: actions/cache@v4
with:
path: /opt/go-build
key: go-build-qt-${{ env.QT_VERSION }}-${{ hashFiles('go.sum') }}
# It is built in a folder of its own in /tmp, and the AppImage is left
# in the folder of the repository.
- name: Build the AppImage
env:
VERSION: ${{ github.ref_type == 'tag' && github.ref_name || github.sha }}
run: packaging/appimage.sh
- uses: actions/upload-artifact@v4
with:
name: TriggerAPI-AppImage
path: "*.AppImage"
if-no-files-found: error
- name: Attach it to the release
if: github.ref_type == 'tag'
uses: softprops/action-gh-release@v2
with:
files: "*.AppImage"
generate_release_notes: true