Repository navigation
199 lines (180 loc) · 7.71 KB
/
Copy pathrelease.yml
File metadata and controls
199 lines (180 loc) · 7.71 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
# Builds NixSCP packages (.deb / .rpm) inside each target distribution's own
# container, so libraries and package dependencies match that distribution,
# and attaches them to the GitHub release of the pushed version tag.
# Packages use the desktop icon theme (NIXSCP_WINSCP_ICONS=OFF).
name: Release packages
on:
push:
tags: ['v*']
workflow_dispatch:
permissions:
contents: write
jobs:
package:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
container: ${{ matrix.image }}
strategy:
fail-fast: false
matrix:
include:
- name: Ubuntu 26.04 (.deb)
image: ubuntu:26.04
family: debian
generator: DEB
suffix: ubuntu26.04
- name: Debian 13 (.deb)
image: debian:trixie
family: debian
generator: DEB
suffix: debian13
- name: Fedora 42 (.rpm)
image: fedora:42
family: fedora
generator: RPM
suffix: fc42
- name: Fedora 43 (.rpm)
image: fedora:43
family: fedora
generator: RPM
suffix: fc43
steps:
- name: Install build dependencies (Debian/Ubuntu)
if: matrix.family == 'debian'
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install -y --no-install-recommends build-essential cmake pkgconf \
qt6-base-dev libssh-dev libssl-dev dpkg-dev file git ca-certificates \
qt6-svg-plugins xdg-utils fonts-dejavu-core openssh-client
- name: Install build dependencies (Fedora)
if: matrix.family == 'fedora'
run: |
dnf install -y shadow-utils util-linux gcc-c++ cmake pkgconf qt6-qtbase-devel libssh-devel \
openssl-devel rpm-build file git qt6-qtsvg xdg-utils \
dejavu-sans-fonts openssh-clients
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Configure
run: |
cmake -S . -B build -DCMAKE_BUILD_TYPE=Release \
-DNIXSCP_WINSCP_ICONS=OFF \
-DNIXSCP_PACKAGE_SUFFIX=${{ matrix.suffix }} \
-DCPACK_GENERATOR=${{ matrix.generator }}
- name: Build
run: cmake --build build -j"$(nproc)"
- name: Test (offline suites; server suites skip themselves)
env:
QT_QPA_PLATFORM: offscreen
# As a normal user: root ignores the file permissions that the tests of a
# failed save rely on
run: |
useradd -m tester
chown -R tester build
su tester -c "ctest --test-dir build --output-on-failure --timeout 600"
- name: Package
run: |
cd build
cpack -G ${{ matrix.generator }}
ls -l *.deb *.rpm 2>/dev/null || true
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nixscp-${{ matrix.suffix }}
path: |
build/*.deb
build/*.rpm
if-no-files-found: error
# AppImage for other distributions: built on the oldest base it supports
# (Ubuntu 24.04, glibc 2.39) with Qt from the Qt binaries and OpenSSL 3.2+ /
# libssh 0.11+ built from source, all bundled into the image
appimage:
name: AppImage (x86_64)
runs-on: ubuntu-latest
container: ubuntu:24.04
env:
QT_VERSION: 6.8.3
OPENSSL_VERSION: 3.5.9
OPENSSL_SHA256: 603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a
LIBSSH_VERSION: 0.11.5
LIBSSH_SHA256: 6898ba9dd836d618b71dc7a4bb786a502c173cef5cafbf20fe5e0567ba4ea30c
DEPS: /opt/nixscp-deps
steps:
- name: Install build tools
env:
DEBIAN_FRONTEND: noninteractive
run: |
apt-get update
apt-get install -y --no-install-recommends build-essential cmake ninja-build pkgconf perl \
python3 python3-venv curl ca-certificates file git xz-utils zlib1g-dev \
libgl-dev libegl-dev libfontconfig1 libfreetype6 libdbus-1-3 libglib2.0-0t64 \
libxkbcommon0 libxkbcommon-x11-0 libx11-xcb1 libxcb1 libxcb-cursor0 libxcb-icccm4 \
libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-shape0 \
libxcb-xfixes0 libxcb-xinerama0 libxcb-xkb1 libxcb-sync1 libxcb-shm0 libxcb-util1 \
libwayland-client0 libwayland-cursor0 libwayland-egl1
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Qt ${{ env.QT_VERSION }}
run: |
python3 -m venv /opt/aqt
/opt/aqt/bin/pip install --quiet aqtinstall==3.3.0
/opt/aqt/bin/aqt install-qt linux desktop "$QT_VERSION" linux_gcc_64 -O /opt/qt
echo "QT_DIR=/opt/qt/$QT_VERSION/gcc_64" >> "$GITHUB_ENV"
- name: OpenSSL ${{ env.OPENSSL_VERSION }} and libssh ${{ env.LIBSSH_VERSION }}
run: |
mkdir -p /tmp/src && cd /tmp/src
curl -fsSL -o openssl.tar.gz "https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz"
curl -fsSL -o libssh.tar.xz "https://www.libssh.org/files/${LIBSSH_VERSION%.*}/libssh-$LIBSSH_VERSION.tar.xz"
echo "$OPENSSL_SHA256 openssl.tar.gz" | sha256sum -c -
echo "$LIBSSH_SHA256 libssh.tar.xz" | sha256sum -c -
tar xf openssl.tar.gz && tar xf libssh.tar.xz
(cd "openssl-$OPENSSL_VERSION" && ./Configure --prefix="$DEPS" --libdir=lib shared no-tests no-docs \
&& make -j"$(nproc)" >/dev/null && make install_sw >/dev/null)
cmake -S "libssh-$LIBSSH_VERSION" -B libssh-build -G Ninja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX="$DEPS" -DCMAKE_INSTALL_LIBDIR=lib -DOPENSSL_ROOT_DIR="$DEPS" \
-DWITH_EXAMPLES=OFF -DUNIT_TESTING=OFF -DCLIENT_TESTING=OFF -DWITH_GSSAPI=OFF
cmake --build libssh-build && cmake --install libssh-build
- name: Build the AppImage
run: |
export PKG_CONFIG_PATH="$DEPS/lib/pkgconfig"
export LD_LIBRARY_PATH="$DEPS/lib:$QT_DIR/lib"
export QMAKE="$QT_DIR/bin/qmake"
export EXTRA_PLATFORM_PLUGINS="libqwayland-generic.so"
export EXTRA_QT_PLUGINS="svg;wayland-shell-integration;wayland-decoration-client;wayland-graphics-integration-client"
export CMAKE_ARGS="-G Ninja -DCMAKE_PREFIX_PATH=$QT_DIR -DNIXSCP_WINSCP_ICONS=OFF -DNIXSCP_BUILD_TESTS=OFF"
packaging/build-appimage.sh "$PWD/appimage"
ls -l appimage
- name: Smoke test
env:
APPIMAGE_EXTRACT_AND_RUN: 1
QT_QPA_PLATFORM: offscreen
run: |
AppImage="$(ls appimage/NixSCP-*.AppImage)"
chmod +x "$AppImage"
"$AppImage" --appimage-extract >/dev/null
squashfs-root/usr/bin/nixscp-cli /help | head -1
! ldd squashfs-root/usr/bin/nixscp | grep "not found"
- uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
with:
name: nixscp-appimage
path: appimage/*.AppImage
if-no-files-found: error
macos:
uses: ./.github/workflows/macos.yml
release:
name: Publish release
needs: [package, appimage, macos]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
with:
path: packages
merge-multiple: true
- uses: softprops/action-gh-release@3bb12739c298aeb8a4eeaf626c5b8d85266b0e65 # v2.6.2
with:
name: NixSCP ${{ github.ref_name }}
generate_release_notes: true
files: |
packages/*.deb
packages/*.rpm
packages/*.AppImage
packages/*.dmg