From f64f9749d83bfa890282fc2c8fd8c29c37c65c04 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 5 Apr 2023 21:04:55 -0300 Subject: [PATCH] Publishing zip file for msvc builds. --- .github/workflows/publish.yml | 37 +++++++++++++++++++++++++++++++++++-- win/ci-build.sh | 53 ----------------------------------------------------- win/mingw-build.sh | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ win/msvc-build.sh | 35 +++++++++++++++++++++++++++++++++++ 4 files changed, 123 insertions(+), 55 deletions(-) delete mode 100755 win/ci-build.sh create mode 100755 win/mingw-build.sh create mode 100644 win/msvc-build.sh diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index f96b7ef..5e5660a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -3,9 +3,12 @@ on: pull_request: branches: - master + push: + branches: + - develop jobs: msys2-mingw: - name: Publish for Windows 64 + name: Publish for MinGW 64 runs-on: windows-latest defaults: run: @@ -23,7 +26,7 @@ jobs: update: true install: dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool - name: CI-Build - run: ./win/ci-build.sh + run: ./win/mingw-build.sh - uses: ncipollo/release-action@v1 with: tag: ${{ steps.gettag.outputs.tag }} @@ -34,6 +37,36 @@ jobs: omitBody: true omitPrereleaseDuringUpdate: true replacesArtifacts: true + msys2-msvc: + name: Publish for MSVC 64 + runs-on: windows-latest + defaults: + run: + shell: msys2 {0} + steps: + - uses: actions/checkout@v3 + - uses: oprypin/find-latest-tag@v1 + id: gettag + with: + repository: PerryWerneck/lib3270 + releases-only: true + - uses: msys2/setup-msys2@v2 + with: + msystem: mingw64 + update: true + install: zip dos2unix mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool + - name: CI-Build + run: ./win/msvc-build.sh + - uses: ncipollo/release-action@v1 + with: + tag: ${{ steps.gettag.outputs.tag }} + artifacts: "*-lib3270-*.zip" + allowUpdates: true + draft: false + makeLatest: true + omitBody: true + omitPrereleaseDuringUpdate: true + replacesArtifacts: true macos: name: Publish for macos runs-on: macos-latest diff --git a/win/ci-build.sh b/win/ci-build.sh deleted file mode 100755 index ed7005a..0000000 --- a/win/ci-build.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/bin/bash -# -# SPDX-License-Identifier: LGPL-3.0-or-later -# -# Copyright (C) 2008 Banco do Brasil S.A. -# -# 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. -# -# You should have received a copy of the GNU Lesser General Public License -# along with this program. If not, see . - -# -# References: -# -# * https://www.msys2.org/docs/ci/ -# - -echo "Running ${0}" - -LOGFILE=build.log -rm -f ${LOGFILE} - -die ( ) { - [ -s $LOGFILE ] && tail $LOGFILE - [ "$1" ] && echo "$*" - exit -1 -} - -cd $(dirname $(dirname $(readlink -f ${0}))) - -# -# Install pre-reqs -# -#echo "Installing pre-reqs..." -#pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure" - -# -# Build -# -echo "Building package..." -dos2unix PKGBUILD.mingw || die "dos2unix failure" -makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw || die "makepkg failure" - -echo "Build complete" - diff --git a/win/mingw-build.sh b/win/mingw-build.sh new file mode 100755 index 0000000..ed7005a --- /dev/null +++ b/win/mingw-build.sh @@ -0,0 +1,53 @@ +#!/bin/bash +# +# SPDX-License-Identifier: LGPL-3.0-or-later +# +# Copyright (C) 2008 Banco do Brasil S.A. +# +# 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. +# +# You should have received a copy of the GNU Lesser General Public License +# along with this program. If not, see . + +# +# References: +# +# * https://www.msys2.org/docs/ci/ +# + +echo "Running ${0}" + +LOGFILE=build.log +rm -f ${LOGFILE} + +die ( ) { + [ -s $LOGFILE ] && tail $LOGFILE + [ "$1" ] && echo "$*" + exit -1 +} + +cd $(dirname $(dirname $(readlink -f ${0}))) + +# +# Install pre-reqs +# +#echo "Installing pre-reqs..." +#pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure" + +# +# Build +# +echo "Building package..." +dos2unix PKGBUILD.mingw || die "dos2unix failure" +makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw || die "makepkg failure" + +echo "Build complete" + diff --git a/win/msvc-build.sh b/win/msvc-build.sh new file mode 100644 index 0000000..706e25c --- /dev/null +++ b/win/msvc-build.sh @@ -0,0 +1,35 @@ +#!/bin/bash +# +# References: +# +# * https://www.msys2.org/docs/ci/ +# +# +echo "Running ${0}" + +LOGFILE=build.log +rm -f ${LOGFILE} + +die ( ) { + [ -s $LOGFILE ] && tail $LOGFILE + [ "$1" ] && echo "$*" + exit -1 +} + +cd $(dirname $(dirname $(readlink -f ${0}))) + +# +# Build LIB3270 +# +echo "Building lib3270" +./autogen.sh > $LOGFILE 2>&1 || die "Autogen failure" +./configure > $LOGFILE 2>&1 || die "Configure failure" +make clean > $LOGFILE 2>&1 || die "Make clean failure" +make all > $LOGFILE 2>&1 || die "Make failure" +make DESTDIR=.bin/package install > $LOGFILE 2>&1 || die "Install failure" + +cd .bin/package${MINGW_PREFIX} +zip -9 -r ../../../${MINGW_PACKAGE_PREFIX}-lib3270.zip * > $LOGFILE 2>&1 || die "Zip failure" + + + -- libgit2 0.21.2