Skip to content

Commit 9cac695

Browse files
Fix up release builds and process: (crosswire#1020)
Pull libbiblesync.dll from system installation location Install biblesync from Fedora package repos Remove libgsf, which is no longer needed Allow building the container image to avoid re-downloading dependencies, over and over again Don't include new build files in package Upload both .tar.gz and .zip files Don't generate RPM or deb files Simplify logic for source upload, since Github Actions will detect duplicates, and only the first file will be accepted v2 of {upload,download}-artifact actions now has greatly streamlined tools so we don't have to be so uptight about how things are specified. Move to using this Update docs
1 parent 424eb02 commit 9cac695

File tree

7 files changed

+55
-70
lines changed

7 files changed

+55
-70
lines changed

.ci-build.yml

+2-11
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,8 @@ variables:
133133
before_scripts:
134134
- |
135135
START_DIR="$(pwd)"
136-
WORK_DIR="${TEMP}"
136+
WORK_DIR="/dep_build"
137+
mkdir -p "${WORK_DIR}"
137138
if [ "${DISTRO_NAME}" == "archlinux" ];then
138139
cd "${WORK_DIR}"
139140
id -u aur_install &>/dev/null || useradd -r -m -U -G wheel -k /dev/null aur_install
@@ -193,13 +194,3 @@ build_scripts:
193194
cmake -B build -DCMAKE_INSTALL_PREFIX=/usr -DGTKHTML=ON -DCMAKE_MAKE_PROGRAM=/usr/bin/make .
194195
make -C build -j$(nproc)
195196
make -C build mhelp package_source
196-
if [ "${DISTRO_NAME}" == "fedora" ]; then
197-
(cd build && cpack -G RPM)
198-
echo "::set-output name=artifact::$(ls build/*.rpm)"
199-
elif [ "${DISTRO_NAME}" == "ubuntu" ]; then
200-
(cd build && cpack -G DEB)
201-
echo "::set-output name=artifact::$(ls build/*.deb)"
202-
elif [ "${DISTRO_NAME}" == "archlinux" ]; then
203-
(cd build && cpack -G TGZ)
204-
echo "::set-output name=artifact::$(ls build/*.tar.gz)"
205-
fi

.github/workflows/builds.yml

+22-18
Original file line numberDiff line numberDiff line change
@@ -17,23 +17,22 @@ jobs:
1717
- name: checkout Xiphos
1818
uses: actions/checkout@v2
1919
with:
20-
path: xiphos
2120
fetch-depth: 0
2221
- name: fetch history
2322
run: |
24-
cd xiphos && git fetch origin +refs/tags/*:refs/tags/*
23+
git fetch origin +refs/tags/*:refs/tags/*
2524
- name: build windows targets
2625
shell: bash
2726
id: build
2827
run: |
2928
set -ex -o pipefail
30-
docker run -i --rm -v "$(pwd):/source" fedora:30 /source/xiphos/win32/xc-xiphos-win.sh ${{ matrix.version }}
31-
echo "::set-output name=artifact::$(ls xiphos/*.exe)"
29+
docker build -t xiphos win32
30+
docker run -i --rm -v "$(pwd):/source" xiphos ${{ matrix.version }}
3231
- name: upload artifact
33-
uses: actions/upload-artifact@master
32+
uses: actions/upload-artifact@v2
3433
with:
35-
name: packages
36-
path: ${{ steps.build.outputs.artifact }}
34+
name: windows-installers
35+
path: "*.exe"
3736

3837
build_linux:
3938
runs-on: ubuntu-latest
@@ -69,12 +68,16 @@ jobs:
6968
python docker-build --name ${{ matrix.distro }} -vvvv --config .ci-build.yml --build scripts
7069
env:
7170
TEMP: ${{ runner.temp }}
72-
- name: upload source artifact
73-
uses: actions/upload-artifact@master
74-
if: steps.build.outputs.artifact
71+
- name: upload source tarball
72+
uses: actions/upload-artifact@v2
7573
with:
76-
name: packages
77-
path: ${{ steps.build.outputs.artifact }}
74+
name: source
75+
path: build/*.tar.gz
76+
- name: upload source zipfile
77+
uses: actions/upload-artifact@v2
78+
with:
79+
name: source
80+
path: build/*.tar.gz
7881

7982
deploy:
8083
needs:
@@ -83,21 +86,22 @@ jobs:
8386
if: contains(github.ref, 'refs/tags/')
8487
runs-on: ubuntu-latest
8588
steps:
86-
- uses: actions/download-artifact@master
87-
with:
88-
name: packages
89+
- name: download all the artifacts
90+
uses: actions/download-artifact@v2
8991
- name: prepare for release
9092
id: release
9193
run: |
9294
set -ex
93-
cd packages
95+
ls -R
96+
cd source
9497
gunzip -k *.tar.gz
9598
xz *.tar
99+
cd ..
96100
echo ::set-output name=tag::${GITHUB_REF#refs/tags/}
97101
- name: create release
98-
uses: ncipollo/release-action@v1
102+
uses: ncipollo/release-action@v1.6.1
99103
with:
100-
artifacts: packages/*
104+
artifacts: source/*,windows-installers/*
101105
allowUpdates: true
102106
name: Release ${{ steps.release.outputs.tag }}
103107
token: ${{ secrets.GITHUB_TOKEN }}

cpack/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,13 @@ set (CPACK_SOURCE_IGNORE_FILES
150150
"/.bzrrules"
151151
"/.git/"
152152
"/.gitignore"
153+
"/.github"
153154
"/.bzrignore/"
154155
"/.bzrrules/"
155156
"/.clang-format"
156-
"/.travis.yml"
157+
"/.ci-build.yml"
158+
"/xiphos-${CPACK_PACKAGE_VERSION}-win32.exe"
159+
"/xiphos-${CPACK_PACKAGE_VERSION}-win64.exe"
157160
)
158161

159162

win32/CMakeLists.txt

+2-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ if (WIN32)
5959
DESTINATION ${CMAKE_INSTALL_BINDIR}
6060
COMPONENT binaries
6161
)
62-
elseif (EXISTS ${CMAKE_FIND_ROOT_PATH}/lib/libbiblesync.dll)
62+
elseif (EXISTS ${CMAKE_FIND_ROOT_PATH}/bin/libbiblesync.dll)
6363
install(FILES
64-
${SYS_ROOT_LIB}/libbiblesync.dll
64+
${SYS_ROOT_BIN}/libbiblesync.dll
6565
DESTINATION ${CMAKE_INSTALL_BINDIR}
6666
COMPONENT binaries
6767
)
@@ -196,7 +196,6 @@ if (WIN32)
196196
${SYS_ROOT_BIN}/libpangowin32-1.0-0.dll
197197
${SYS_ROOT_BIN}/libatk-1.0-0.dll
198198
${SYS_ROOT_BIN}/libxml2-2.dll
199-
${SYS_ROOT_BIN}/libgsf-1-114.dll
200199
${SYS_ROOT_BIN}/libbz2-1.dll
201200
${SYS_ROOT_BIN}/libgthread-2.0-0.dll
202201
${SYS_ROOT_BIN}/libgnurx-0.dll

win32/Dockerfile

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
FROM fedora:30
2+
3+
VOLUME /source
4+
5+
# Installs dependencies once and for all
6+
RUN dnf -y update --refresh && \
7+
dnf -y install cmake git fpc gettext glib2-devel itstool libxslt make yelp-tools zip && \
8+
dnf -y install mingw32-biblesync mingw32-gettext mingw32-sword mingw32-minizip mingw32-libglade2 mingw32-webkitgtk mingw32-gtk3 mingw32-libtiff mingw32-libidn mingw32-gdb mingw32-nsis mingw32-dbus-glib && \
9+
dnf -y install mingw64-biblesync mingw64-gettext mingw64-sword mingw64-minizip mingw64-libglade2 mingw64-webkitgtk mingw64-gtk3 mingw64-libtiff mingw64-libidn mingw64-gdb mingw32-nsis mingw64-dbus-glib && \
10+
dnf clean all
11+
12+
ENTRYPOINT ["/bin/bash", "/source/win32/xc-xiphos-win.sh"]
13+
14+
CMD ["-win32", "-win64"]

win32/WindowsBuildNotes.txt

+8-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,14 @@ runtime command:
1919
mkdir win
2020
cd win
2121
git clone https://github.com/crosswire/xiphos.git
22-
docker run --rm -it -v .:/source fedora:30 /source/xihpos/win32/xc-xiphos-win.sh -win32 -win64
22+
cd xiphos
23+
docker run --rm -it -v $(pwd):/source greg-hellings/xiphos
24+
25+
If you don't want to use the greg-hellings/xiphos image or it is unavailable
26+
for some reason, you can build the image yourself locally, first, like this:
27+
28+
docker build -t xiphos win32
29+
docker run --rm -it -v $(pwd):/source xiphos
2330

2431
Similar behavior can be achieved through a Fedora 30 VM, or using podman, or
2532
similar.

win32/xc-xiphos-win.sh

+3-36
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,10 @@ by running in a VM or in a container with your favorite container environment th
2424
has sudo installed. Currently it depends on a Fedora 30 environment to do the builds
2525
and won't work for later versions of Fedora because of missing dependncies. For example:
2626
27-
mkdir src && cd src
2827
git checkout https://github.com/crosswire/xiphos.git
29-
docker run -it --rm -v "$(pwd):/source" fedora:30 /source/xiphos/win32/xc-xiphos-win.sh -win32"
28+
cd xiphos
29+
docker build -t xiphos win32
30+
docker run -it --rm -v "$(pwd):/source" xiphos -win32"
3031
EOF
3132
}
3233

@@ -74,42 +75,8 @@ echo "Build for Windows 32-bit = $([ "$WIN32" -gt 0 ] && echo 'Yes' || echo '
7475
echo "Build for Windows 64-bit = $([ "$WIN64" -gt 0 ] && echo 'Yes' || echo 'No')"
7576
echo "Xiphos Source directory = ${XIPHOS_PATH}"
7677

77-
78-
7978
trap 'exit 1' ERR
8079

81-
# Update packages
82-
echo '** Upgrading packages on the system:'
83-
sudo dnf -y upgrade --refresh
84-
85-
86-
# Install build tools
87-
echo '** Installing build tools in the toolbox:'
88-
sudo dnf -y install cmake git fpc gettext glib2-devel itstool libxslt make yelp-tools zip
89-
90-
91-
# Install mingw dependencies
92-
if [ "$WIN32" -gt '0' ]; then
93-
echo '** Installing mingw32 dependencies:'
94-
sudo dnf -y install mingw32-gettext mingw32-sword mingw32-minizip mingw32-libgsf mingw32-libglade2 mingw32-webkitgtk mingw32-gtk3 mingw32-libtiff mingw32-libidn mingw32-gdb mingw32-nsis mingw32-dbus-glib
95-
fi
96-
if [ "$WIN64" -gt '0' ]; then
97-
echo '** Installing mingw64 dependencies:'
98-
sudo dnf -y install mingw64-gettext mingw64-sword mingw64-minizip mingw64-libgsf mingw64-libglade2 mingw64-webkitgtk mingw64-gtk3 mingw64-libtiff mingw64-libidn mingw64-gdb mingw32-nsis mingw64-dbus-glib
99-
fi
100-
101-
102-
# Build and install Biblesync with Mingw
103-
if [ "$WIN32" -gt '0' ]; then
104-
echo '** Installing Biblesync 32 bit:'
105-
sudo dnf -y install --enablerepo=updates-testing mingw32-biblesync
106-
fi
107-
108-
if [ "$WIN64" -gt '0' ]; then
109-
echo '** Installing Biblesync-64 bit:'
110-
sudo dnf -y install --enablerepo=updates-testing mingw64-biblesync
111-
fi
112-
11380
# Configure && build .EXE
11481
function do_build {
11582
bits="${1}"

0 commit comments

Comments
 (0)