From 64ca5ee6caaab61eb767032a1372bf90197fa337 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 12 Apr 2023 07:36:23 -0300 Subject: [PATCH] Uploading zipfile to release. --- win/bundle.common | 65 ++++++++++++++++++++++++++++++++++++++++++++++++++++++----------- win/bundle.cross | 49 +++++++++++++++++++++++++++++-------------------- 2 files changed, 83 insertions(+), 31 deletions(-) diff --git a/win/bundle.common b/win/bundle.common index 78c3c2d..2119c51 100644 --- a/win/bundle.common +++ b/win/bundle.common @@ -2,20 +2,20 @@ # # SPDX-License-Identifier: LGPL-3.0-or-later # -# Copyright (C) 2021 Perry Werneck +# Copyright (C) 2023 Perry Werneck # -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Lesser General Public License as published -# by the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License as published +# by the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. # -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. # -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . # # @@ -47,6 +47,20 @@ if [ -z ${PKG_CONFIG} ]; then PKG_CONFIG=${MINGW_PREFX}/bin/pkg-config fi +PACKAGE_NAME=$(grep AC_INIT configure.ac | cut -d[ -f2 | cut -d] -f1) +if [ -z ${PACKAGE_NAME} ]; then + echo "Cant determine package name" + exit -1 +fi + +PACKAGE_VERSION=$(grep AC_INIT configure.ac | cut -d[ -f3 | cut -d] -f1) +if [ -z ${PACKAGE_VERSION} ]; then + echo "Cant determine package name" + exit -1 +fi + + + GTK_PREFIX=$(${PKG_CONFIG} --variable=prefix gtk+-3.0) GTK_BINARY_VERSION=$(${PKG_CONFIG} --variable=gtk_binary_version gtk+-3.0) GTK_LIBDIR=$(echo $(${PKG_CONFIG} --variable=libdir gtk+-3.0) | sed "s@^C:/@/c/@g") @@ -354,5 +368,34 @@ argument() { return 2 } +make_zip() { + + cd ${buildroot}${MINGW_PREFIX} + if [ "$?" != "0" ]; then + exit -1 + fi + + rm -f ${srcdir}/${MINGW_PACKAGE_PREFIX}-${PACKAGE_NAME}-${PACKAGE_VERSION}.bundle.zip + + zip -9 -r ${srcdir}/${MINGW_PACKAGE_PREFIX}-${PACKAGE_NAME}-${PACKAGE_VERSION}.bundle.zip . + if [ "$?" != "0" ]; then + exit -1 + fi + + cd ${srcdir} + if [ "$?" != "0" ]; then + exit -1 + fi + + if [ -z $(which gh) ]; then + return 0 + fi + + argument "upload" > /dev/null + if [ "$?" == "0" ]; then + gh release upload --clobber "${PACKAGE_VERSION}" ${srcdir}/${MINGW_PACKAGE_PREFIX}-${PACKAGE_NAME}-${PACKAGE_VERSION}.bundle.zip + fi + +} diff --git a/win/bundle.cross b/win/bundle.cross index 4a18131..bee4661 100755 --- a/win/bundle.cross +++ b/win/bundle.cross @@ -88,31 +88,38 @@ else packages="${packages} pw3270" fi -echo "Packages: ${packages}" -for package in ${packages} -do - PACKAGE_NAME=$(rpm -qa | grep "${MINGW_PACKAGE_PREFIX}-${package}" | grep -v devel | head --lines=1) - echo "Copy ${PACKAGE_NAME}" - for FILE in $(rpm -ql "${PACKAGE_NAME}") - do - if [ ! -d ${FILE} ]; then +unpack_rpm() { - FILEPATH="${buildroot}${FILE}" - mkdir -p "$(dirname ${FILEPATH})" - if [ "$?" != "0" ]; then - exit -1 + local package + local PACKAGE_NAME + + echo "Packages: ${packages}" + for package in ${packages} + do + PACKAGE_NAME=$(rpm -qa | grep "${MINGW_PACKAGE_PREFIX}-${package}" | grep -v devel | head --lines=1) + echo "Copy ${PACKAGE_NAME}" + for FILE in $(rpm -ql "${PACKAGE_NAME}") + do + if [ ! -d ${FILE} ]; then + + FILEPATH="${buildroot}${FILE}" + mkdir -p "$(dirname ${FILEPATH})" + if [ "$?" != "0" ]; then + exit -1 + fi + + cp "${FILE}" "${FILEPATH}" + if [ "$?" != "0" ]; then + echo "Cant copy '${FILE}' from '${PACKAGE_NAME}'" + exit -1 + fi fi + done - cp "${FILE}" "${FILEPATH}" - if [ "$?" != "0" ]; then - echo "Cant copy '${FILE}' from '${PACKAGE_NAME}'" - exit -1 - fi - fi done +} -done - +unpack_rpm install_loaders install_bin install_locale @@ -120,5 +127,7 @@ install_schemas install_theme "Adwaita" install_icons "Adwaita" +make_zip + echo "Bundle build complete" -- libgit2 0.21.2