diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index e376613..ef6d747 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -4,8 +4,6 @@ on: push: branches: - develop - pull_request: - branches: - master jobs: analyze: diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 158125d..3947383 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -18,30 +18,29 @@ jobs: - uses: oprypin/find-latest-tag@v1 id: gettag with: - repository: PerryWerneck/libhllapi # The repository to scan. - releases-only: true # We know that all relevant tags have a GitHub release for them. + repository: PerryWerneck/libhllapi + releases-only: true - uses: msys2/setup-msys2@v2 with: msystem: mingw64 update: true - install: xz mingw-w64-x86_64-gcc automake autoconf make git pkgconf mingw-w64-x86_64-gettext gettext-devel mingw-w64-x86_64-openssl libtool zip + 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 zip - uses: robinraju/release-downloader@v1.7 with: repository: "PerryWerneck/lib3270" latest: true - fileName: "mingw-w64-x86_64-lib3270.tar.xz" + fileName: "mingw-w64-x86_64-lib3270-5.4-0-x86_64.pkg.tar.zst" - uses: robinraju/release-downloader@v1.7 with: repository: "PerryWerneck/libipc3270" latest: true - fileName: "mingw-w64-x86_64-libipc3270.tar.xz" + fileName: "mingw-w64-x86_64-libipc3270-5.5-0-x86_64.pkg.tar.zst" - name: CI-Build - run: | - ./win/ci-build.sh + run: ./win/ci-build.sh - uses: ncipollo/release-action@v1 with: tag: ${{ steps.gettag.outputs.tag }} - artifacts: "*-hllapi.tar.xz" + artifacts: "*-libhllapi-*.pkg.tar.zst" allowUpdates: true draft: false makeLatest: true @@ -50,30 +49,30 @@ jobs: replacesArtifacts: true msvc-pack: runs-on: windows-latest - name: Publish MSVC Library + name: Publish MSVC 64 steps: - uses: actions/checkout@v3 - uses: oprypin/find-latest-tag@v1 id: gettag with: - repository: PerryWerneck/libhllapi # The repository to scan. - releases-only: true # We know that all relevant tags have a GitHub release for them. + repository: PerryWerneck/libhllapi + releases-only: true - uses: ilammy/msvc-dev-cmd@v1.4.1 - uses: robinraju/release-downloader@v1.7 with: repository: "PerryWerneck/libipc3270" latest: true - fileName: "msvc-libipc3270.zip" + fileName: "msvc-libipc3270-x86_64.zip" - name: Extract libipc3270 - run: 7z x msvc-libipc3270.zip -y -oipc3270 + run: 7z x msvc-libipc3270-x86_64.zip -y -oipc3270 - name: Build run: nmake /f win\Makefile-ci.msc LIB3270_SDK_PATH=ipc3270 DESTDIR=hllapi.msvc install - name: pack - run: 7z a msvc-hllapi.zip .\hllapi.msvc\* + run: 7z a msvc-hllapi-x86_64.zip .\hllapi.msvc\* - uses: ncipollo/release-action@v1 with: tag: ${{ steps.gettag.outputs.tag }} - artifacts: "msvc-hllapi.zip" + artifacts: "*-hllapi-*.zip" allowUpdates: true draft: false makeLatest: true diff --git a/PKGBUILD.mingw b/PKGBUILD.mingw new file mode 100644 index 0000000..47e9aae --- /dev/null +++ b/PKGBUILD.mingw @@ -0,0 +1,62 @@ +# Maintainer: Perry Werneck +# References: https://www.msys2.org/wiki/Creating-Packages/ + +# 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 . + +_realname=$(grep AC_INIT "${startdir}/configure.ac" | cut -d[ -f2 | cut -d] -f1) + +pkgname=${MINGW_PACKAGE_PREFIX}-${_realname} +source=() + +pkgver=$(grep AC_INIT "${startdir}/configure.ac" | cut -d[ -f3 | cut -d] -f1 | cut -d. -f1-2) +pkgrel=0 +pkgdesc="IPC client library for lib3270/pw3270" +url="https://github.com/PerryWerneck/${_realname}" +arch=(i686 x86_64) +license=(LGPL-3.0-or-later) +depends=(${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-libipc3270) +makedepends=(autoconf automake make libtool gzip dos2unix ${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-libipc3270) +checkdepends=() + +provides=($pkgname) +conflicts=($pkgname) + +prepare() { + rm -fr "$srcdir/$pkgname" + ln -snf "$startdir" "$srcdir/$pkgname" +} + +build() { + cd $pkgname + ./autogen.sh \ + --prefix=${MINGW_PREFIX} \ + --build=${MINGW_CHOST} \ + --host=${MINGW_CHOST} \ + --target=${MINGW_CHOST} + + make all +} + +package() { + cd $pkgname + make DESTDIR="${pkgdir}" install + install \ + -Dm644 \ + "LICENSE" \ + "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE" +} diff --git a/configure.ac b/configure.ac index 21f902d..afe3b8a 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ AC_PREREQ(2.59) dnl Initialise automake with the package name, version and dnl bug-reporting address. -AC_INIT([libhllapi], [5.4.1], [perry.werneck@gmail.com], [libhllapi], [https://github.com/PerryWerneck/libhllapi]) +AC_INIT([libhllapi], [5.5.0], [perry.werneck@gmail.com], [libhllapi], [https://github.com/PerryWerneck/libhllapi]) dnl Place auxilliary scripts here. AC_CONFIG_AUX_DIR([scripts]) diff --git a/win/ci-build.sh b/win/ci-build.sh index 660a6e0..2d066fe 100644 --- a/win/ci-build.sh +++ b/win/ci-build.sh @@ -1,49 +1,53 @@ -#!/bin/bash -x +#!/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 } -myDIR=$(dirname $(dirname $(readlink -f ${0}))) - -cd ${myDIR} -rm -fr ./.build -mkdir -p ./.build - -# -# Unpack LIB3270 -# -echo "Unpacking lib3270" -tar -C / -Jxvf ${MINGW_PACKAGE_PREFIX}-lib3270.tar.xz +cd $(dirname $(dirname $(readlink -f ${0}))) # -# Unpack LIBIPC3270 +# Install pre-reqs # -echo "Unpacking libipc3270" -tar -C / -Jxvf ${MINGW_PACKAGE_PREFIX}-libipc3270.tar.xz +echo "Installing pre-reqs..." +pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure" # -# Build HLLAPI +# Build # -echo "Building HLLAPI" -./autogen.sh || die "Autogen failure" -./configure || die "Configure failure" -make clean || die "Make clean failure" -make all || die "Make failure" - -make DESTDIR=.bin/package install || die "Install failure" -tar --create --xz --file=${MINGW_PACKAGE_PREFIX}-hllapi.tar.xz --directory=.bin/package --verbose . || die "Package failure" +echo "Building package..." +dos2unix PKGBUILD.mingw || die "dos2unix failure" +makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw || die "makepkg failure" echo "Build complete"