Skip to content

Commit 5f0be34

Browse files
committed
Update the deploy scripts
1 parent 6e7382a commit 5f0be34

File tree

8 files changed

+491
-462
lines changed

8 files changed

+491
-462
lines changed

.github/workflows/release.yml

+8-5
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
matrix:
1818
os_name: ['bullseye', 'bookworm', 'trixie']
1919
container:
20+
# https://en.wikipedia.org/wiki/Debian_version_history
2021
# https://hub.docker.com/_/debian
2122
image: debian:${{matrix.os_name}}
2223
steps:
@@ -31,7 +32,7 @@ jobs:
3132
3233
- name: 'Build'
3334
shell: bash
34-
run: install/deb-build.sh -s debian-${{matrix.os_name}} -v ${{ github.ref_name }}
35+
run: install/build-deb.sh -s debian-${{matrix.os_name}} -v ${{ github.ref_name }}
3536

3637
- name: 'Upload debian packages'
3738
uses: actions/upload-artifact@v4
@@ -44,8 +45,9 @@ jobs:
4445
strategy:
4546
fail-fast: false
4647
matrix:
47-
os_name: ['focal', 'jammy', 'mantic', 'noble']
48+
os_name: ['focal', 'jammy', 'noble']
4849
container:
50+
# https://en.wikipedia.org/wiki/Ubuntu_version_history
4951
# https://hub.docker.com/_/ubuntu
5052
image: ubuntu:${{matrix.os_name}}
5153
steps:
@@ -59,7 +61,7 @@ jobs:
5961
6062
- name: 'Build'
6163
shell: bash
62-
run: install/deb-build.sh -s ubuntu-${{matrix.os_name}} -v ${{ github.ref_name }}
64+
run: install/build-deb.sh -s ubuntu-${{matrix.os_name}} -v ${{ github.ref_name }}
6365

6466
- name: 'Upload ubuntu packages'
6567
uses: actions/upload-artifact@v4
@@ -72,7 +74,7 @@ jobs:
7274
strategy:
7375
fail-fast: false
7476
matrix:
75-
msystem: ['mingw64', 'mingw32']
77+
msystem: ['mingw64']
7678
defaults:
7779
run:
7880
shell: msys2 {0}
@@ -102,11 +104,12 @@ jobs:
102104
pacboy: >-
103105
gcc:p
104106
nsis:p
107+
ntldd:p
105108
qt5-static:p
106109
openssl:p
107110
108111
- name: 'Build'
109-
run: install/win-msys2-build.sh -s windows -v ${{ github.ref_name }} -q /${{matrix.msystem}}/qt5-static/bin/qmake.exe
112+
run: install/build-win-msys2.sh -s windows -v ${{ github.ref_name }} -q /${{matrix.msystem}}/qt5-static/bin/qmake.exe
110113

111114
- name: 'Upload windows installers'
112115
uses: actions/upload-artifact@v4

INSTALL.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ make -j $(nproc)
4747
Run script:
4848

4949
```sh
50-
install/deb-build.sh
50+
install/build-deb.sh
5151
```
5252

5353
The script creates a .deb package in the current folder and does not require
@@ -104,7 +104,7 @@ make -j $(nproc)
104104
Run script:
105105

106106
```sh
107-
install/win-msys2-build.sh
107+
install/build-win-msys2.sh
108108
```
109109

110110
The script creates a .exe installer in the current folder.

install/build-deb.sh

+74
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
#!/usr/bin/env sh
2+
3+
set -e
4+
5+
#MODE_NO_CLEAN=1
6+
7+
PACKAGE_ARCH=$(dpkg --print-architecture)
8+
PACKAGE_INSTALL_PREFIX=/usr
9+
10+
SCRIPT_DIR=$(realpath "$(dirname "$0")")
11+
SOURCE_DIR=$(realpath "$SCRIPT_DIR"/../)
12+
13+
clean()
14+
{
15+
if [ -f "${PACKAGE_FILE_NAME}.deb" ]; then
16+
echo "Remove the old package ${PACKAGE_FILE_NAME}.deb"
17+
rm "${PACKAGE_FILE_NAME}.deb"
18+
fi
19+
20+
if [ -d "${PACKAGE_DIR}/DEBIAN" ]; then
21+
echo "Remove ${PACKAGE_DIR}/DEBIAN"
22+
rm -r "${PACKAGE_DIR}/DEBIAN"
23+
fi
24+
}
25+
26+
pre_build()
27+
{
28+
QMAKE_OPTIONS="$QMAKE_OPTIONS PREFIX=$PACKAGE_INSTALL_PREFIX"
29+
echo "$QMAKE -r $QMAKE_OPTIONS ${SOURCE_DIR}"
30+
$QMAKE -r $QMAKE_OPTIONS ${SOURCE_DIR}
31+
}
32+
33+
build() {
34+
make -j $MAKE_JOBS
35+
}
36+
37+
i18n()
38+
{
39+
make -j $MAKE_JOBS i18n
40+
}
41+
42+
deploy()
43+
{
44+
make INSTALL_ROOT="$PACKAGE_DIR" install
45+
}
46+
47+
package()
48+
{
49+
mkdir -p "$PACKAGE_DIR"/DEBIAN
50+
51+
get_deb_dependencies "${PACKAGE_DIR}/${PACKAGE_INSTALL_PREFIX}/bin"
52+
53+
# https://www.debian.org/doc/debian-policy/ch-controlfields.html
54+
cat <<EOF > "$PACKAGE_DIR"/DEBIAN/control
55+
Package: $PACKAGE_NAME
56+
Version: $PACKAGE_VERSION
57+
Description: GCodeWorkShop is a text editor for CNC programmers.
58+
Section: devel
59+
Priority: optional
60+
Architecture: $PACKAGE_ARCH
61+
Depends: $PACKAGE_DEPENDS
62+
Maintainer: Nick Egorrov <[email protected]>
63+
Installed-Size: $(du -s "$PACKAGE_DIR" | awk '{print $1}')
64+
EOF
65+
66+
title2 "Run dpkg-deb"
67+
echo "dpkg-deb --build $PACKAGE_DIR ${PACKAGE_FILE_NAME}.deb"
68+
dpkg-deb --build "$PACKAGE_DIR" "${PACKAGE_FILE_NAME}.deb"
69+
}
70+
71+
__NESTED__=1
72+
. ${SCRIPT_DIR}/build-helper.sh
73+
74+
create package

0 commit comments

Comments
 (0)