Commit 64ca5ee6caaab61eb767032a1372bf90197fa337
1 parent
26bc621c
Exists in
develop
Uploading zipfile to release.
Showing
2 changed files
with
83 additions
and
31 deletions
Show diff stats
win/bundle.common
... | ... | @@ -2,20 +2,20 @@ |
2 | 2 | # |
3 | 3 | # SPDX-License-Identifier: LGPL-3.0-or-later |
4 | 4 | # |
5 | -# Copyright (C) 2021 Perry Werneck <perry.werneck@gmail.com> | |
5 | +# Copyright (C) 2023 Perry Werneck <perry.werneck@gmail.com> | |
6 | 6 | # |
7 | -# This program is free software: you can redistribute it and/or modify | |
8 | -# it under the terms of the GNU Lesser General Public License as published | |
9 | -# by the Free Software Foundation, either version 3 of the License, or | |
10 | -# (at your option) any later version. | |
7 | +# This program is free software: you can redistribute it and/or modify | |
8 | +# it under the terms of the GNU Lesser General Public License as published | |
9 | +# by the Free Software Foundation, either version 3 of the License, or | |
10 | +# (at your option) any later version. | |
11 | 11 | # |
12 | -# This program is distributed in the hope that it will be useful, | |
13 | -# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | -# GNU General Public License for more details. | |
12 | +# This program is distributed in the hope that it will be useful, | |
13 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 | +# GNU General Public License for more details. | |
16 | 16 | # |
17 | -# You should have received a copy of the GNU Lesser General Public License | |
18 | -# along with this program. If not, see <https://www.gnu.org/licenses/>. | |
17 | +# You should have received a copy of the GNU Lesser General Public License | |
18 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. | |
19 | 19 | # |
20 | 20 | |
21 | 21 | # |
... | ... | @@ -47,6 +47,20 @@ if [ -z ${PKG_CONFIG} ]; then |
47 | 47 | PKG_CONFIG=${MINGW_PREFX}/bin/pkg-config |
48 | 48 | fi |
49 | 49 | |
50 | +PACKAGE_NAME=$(grep AC_INIT configure.ac | cut -d[ -f2 | cut -d] -f1) | |
51 | +if [ -z ${PACKAGE_NAME} ]; then | |
52 | + echo "Cant determine package name" | |
53 | + exit -1 | |
54 | +fi | |
55 | + | |
56 | +PACKAGE_VERSION=$(grep AC_INIT configure.ac | cut -d[ -f3 | cut -d] -f1) | |
57 | +if [ -z ${PACKAGE_VERSION} ]; then | |
58 | + echo "Cant determine package name" | |
59 | + exit -1 | |
60 | +fi | |
61 | + | |
62 | + | |
63 | + | |
50 | 64 | GTK_PREFIX=$(${PKG_CONFIG} --variable=prefix gtk+-3.0) |
51 | 65 | GTK_BINARY_VERSION=$(${PKG_CONFIG} --variable=gtk_binary_version gtk+-3.0) |
52 | 66 | GTK_LIBDIR=$(echo $(${PKG_CONFIG} --variable=libdir gtk+-3.0) | sed "s@^C:/@/c/@g") |
... | ... | @@ -354,5 +368,34 @@ argument() { |
354 | 368 | return 2 |
355 | 369 | } |
356 | 370 | |
371 | +make_zip() { | |
372 | + | |
373 | + cd ${buildroot}${MINGW_PREFIX} | |
374 | + if [ "$?" != "0" ]; then | |
375 | + exit -1 | |
376 | + fi | |
377 | + | |
378 | + rm -f ${srcdir}/${MINGW_PACKAGE_PREFIX}-${PACKAGE_NAME}-${PACKAGE_VERSION}.bundle.zip | |
379 | + | |
380 | + zip -9 -r ${srcdir}/${MINGW_PACKAGE_PREFIX}-${PACKAGE_NAME}-${PACKAGE_VERSION}.bundle.zip . | |
381 | + if [ "$?" != "0" ]; then | |
382 | + exit -1 | |
383 | + fi | |
384 | + | |
385 | + cd ${srcdir} | |
386 | + if [ "$?" != "0" ]; then | |
387 | + exit -1 | |
388 | + fi | |
389 | + | |
390 | + if [ -z $(which gh) ]; then | |
391 | + return 0 | |
392 | + fi | |
393 | + | |
394 | + argument "upload" > /dev/null | |
395 | + if [ "$?" == "0" ]; then | |
396 | + gh release upload --clobber "${PACKAGE_VERSION}" ${srcdir}/${MINGW_PACKAGE_PREFIX}-${PACKAGE_NAME}-${PACKAGE_VERSION}.bundle.zip | |
397 | + fi | |
398 | + | |
399 | +} | |
357 | 400 | |
358 | 401 | ... | ... |
win/bundle.cross
... | ... | @@ -88,31 +88,38 @@ else |
88 | 88 | packages="${packages} pw3270" |
89 | 89 | fi |
90 | 90 | |
91 | -echo "Packages: ${packages}" | |
92 | -for package in ${packages} | |
93 | -do | |
94 | - PACKAGE_NAME=$(rpm -qa | grep "${MINGW_PACKAGE_PREFIX}-${package}" | grep -v devel | head --lines=1) | |
95 | - echo "Copy ${PACKAGE_NAME}" | |
96 | - for FILE in $(rpm -ql "${PACKAGE_NAME}") | |
97 | - do | |
98 | - if [ ! -d ${FILE} ]; then | |
91 | +unpack_rpm() { | |
99 | 92 | |
100 | - FILEPATH="${buildroot}${FILE}" | |
101 | - mkdir -p "$(dirname ${FILEPATH})" | |
102 | - if [ "$?" != "0" ]; then | |
103 | - exit -1 | |
93 | + local package | |
94 | + local PACKAGE_NAME | |
95 | + | |
96 | + echo "Packages: ${packages}" | |
97 | + for package in ${packages} | |
98 | + do | |
99 | + PACKAGE_NAME=$(rpm -qa | grep "${MINGW_PACKAGE_PREFIX}-${package}" | grep -v devel | head --lines=1) | |
100 | + echo "Copy ${PACKAGE_NAME}" | |
101 | + for FILE in $(rpm -ql "${PACKAGE_NAME}") | |
102 | + do | |
103 | + if [ ! -d ${FILE} ]; then | |
104 | + | |
105 | + FILEPATH="${buildroot}${FILE}" | |
106 | + mkdir -p "$(dirname ${FILEPATH})" | |
107 | + if [ "$?" != "0" ]; then | |
108 | + exit -1 | |
109 | + fi | |
110 | + | |
111 | + cp "${FILE}" "${FILEPATH}" | |
112 | + if [ "$?" != "0" ]; then | |
113 | + echo "Cant copy '${FILE}' from '${PACKAGE_NAME}'" | |
114 | + exit -1 | |
115 | + fi | |
104 | 116 | fi |
117 | + done | |
105 | 118 | |
106 | - cp "${FILE}" "${FILEPATH}" | |
107 | - if [ "$?" != "0" ]; then | |
108 | - echo "Cant copy '${FILE}' from '${PACKAGE_NAME}'" | |
109 | - exit -1 | |
110 | - fi | |
111 | - fi | |
112 | 119 | done |
120 | +} | |
113 | 121 | |
114 | -done | |
115 | - | |
122 | +unpack_rpm | |
116 | 123 | install_loaders |
117 | 124 | install_bin |
118 | 125 | install_locale |
... | ... | @@ -120,5 +127,7 @@ install_schemas |
120 | 127 | install_theme "Adwaita" |
121 | 128 | install_icons "Adwaita" |
122 | 129 | |
130 | +make_zip | |
131 | + | |
123 | 132 | echo "Bundle build complete" |
124 | 133 | ... | ... |