Skip to content

Commit e824b61

Browse files
authored
Merge pull request #12 from PerryWerneck/develop
Updating publish action.
2 parents 7082d10 + d858729 commit e824b61

File tree

5 files changed

+106
-43
lines changed

5 files changed

+106
-43
lines changed

.github/workflows/codeql.yml

-2
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ on:
44
push:
55
branches:
66
- develop
7-
pull_request:
8-
branches:
97
- master
108
jobs:
119
analyze:

.github/workflows/publish.yml

+14-15
Original file line numberDiff line numberDiff line change
@@ -18,30 +18,29 @@ jobs:
1818
- uses: oprypin/find-latest-tag@v1
1919
id: gettag
2020
with:
21-
repository: PerryWerneck/libhllapi # The repository to scan.
22-
releases-only: true # We know that all relevant tags have a GitHub release for them.
21+
repository: PerryWerneck/libhllapi
22+
releases-only: true
2323
- uses: msys2/setup-msys2@v2
2424
with:
2525
msystem: mingw64
2626
update: true
27-
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
27+
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
2828
- uses: robinraju/release-downloader@v1.7
2929
with:
3030
repository: "PerryWerneck/lib3270"
3131
latest: true
32-
fileName: "mingw-w64-x86_64-lib3270.tar.xz"
32+
fileName: "mingw-w64-x86_64-lib3270-5.4-0-x86_64.pkg.tar.zst"
3333
- uses: robinraju/release-downloader@v1.7
3434
with:
3535
repository: "PerryWerneck/libipc3270"
3636
latest: true
37-
fileName: "mingw-w64-x86_64-libipc3270.tar.xz"
37+
fileName: "mingw-w64-x86_64-libipc3270-5.5-0-x86_64.pkg.tar.zst"
3838
- name: CI-Build
39-
run: |
40-
./win/ci-build.sh
39+
run: ./win/ci-build.sh
4140
- uses: ncipollo/release-action@v1
4241
with:
4342
tag: ${{ steps.gettag.outputs.tag }}
44-
artifacts: "*-hllapi.tar.xz"
43+
artifacts: "*-libhllapi-*.pkg.tar.zst"
4544
allowUpdates: true
4645
draft: false
4746
makeLatest: true
@@ -50,30 +49,30 @@ jobs:
5049
replacesArtifacts: true
5150
msvc-pack:
5251
runs-on: windows-latest
53-
name: Publish MSVC Library
52+
name: Publish MSVC 64
5453
steps:
5554
- uses: actions/checkout@v3
5655
- uses: oprypin/find-latest-tag@v1
5756
id: gettag
5857
with:
59-
repository: PerryWerneck/libhllapi # The repository to scan.
60-
releases-only: true # We know that all relevant tags have a GitHub release for them.
58+
repository: PerryWerneck/libhllapi
59+
releases-only: true
6160
- uses: ilammy/msvc-dev-cmd@v1.4.1
6261
- uses: robinraju/release-downloader@v1.7
6362
with:
6463
repository: "PerryWerneck/libipc3270"
6564
latest: true
66-
fileName: "msvc-libipc3270.zip"
65+
fileName: "msvc-libipc3270-x86_64.zip"
6766
- name: Extract libipc3270
68-
run: 7z x msvc-libipc3270.zip -y -oipc3270
67+
run: 7z x msvc-libipc3270-x86_64.zip -y -oipc3270
6968
- name: Build
7069
run: nmake /f win\Makefile-ci.msc LIB3270_SDK_PATH=ipc3270 DESTDIR=hllapi.msvc install
7170
- name: pack
72-
run: 7z a msvc-hllapi.zip .\hllapi.msvc\*
71+
run: 7z a msvc-hllapi-x86_64.zip .\hllapi.msvc\*
7372
- uses: ncipollo/release-action@v1
7473
with:
7574
tag: ${{ steps.gettag.outputs.tag }}
76-
artifacts: "msvc-hllapi.zip"
75+
artifacts: "*-hllapi-*.zip"
7776
allowUpdates: true
7877
draft: false
7978
makeLatest: true

PKGBUILD.mingw

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Maintainer: Perry Werneck <perry.werneck@gmail.com>
2+
# References: https://www.msys2.org/wiki/Creating-Packages/
3+
4+
# SPDX-License-Identifier: LGPL-3.0-or-later
5+
#
6+
# Copyright (C) 2008 Banco do Brasil S.A.
7+
#
8+
# This program is free software: you can redistribute it and/or modify
9+
# it under the terms of the GNU Lesser General Public License as published
10+
# by the Free Software Foundation, either version 3 of the License, or
11+
# (at your option) any later version.
12+
#
13+
# This program is distributed in the hope that it will be useful,
14+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
15+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16+
# GNU General Public License for more details.
17+
#
18+
# You should have received a copy of the GNU Lesser General Public License
19+
# along with this program. If not, see <https://www.gnu.org/licenses/>.
20+
21+
_realname=$(grep AC_INIT "${startdir}/configure.ac" | cut -d[ -f2 | cut -d] -f1)
22+
23+
pkgname=${MINGW_PACKAGE_PREFIX}-${_realname}
24+
source=()
25+
26+
pkgver=$(grep AC_INIT "${startdir}/configure.ac" | cut -d[ -f3 | cut -d] -f1 | cut -d. -f1-2)
27+
pkgrel=0
28+
pkgdesc="IPC client library for lib3270/pw3270"
29+
url="https://github.com/PerryWerneck/${_realname}"
30+
arch=(i686 x86_64)
31+
license=(LGPL-3.0-or-later)
32+
depends=(${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-libipc3270)
33+
makedepends=(autoconf automake make libtool gzip dos2unix ${MINGW_PACKAGE_PREFIX}-lib3270 ${MINGW_PACKAGE_PREFIX}-libipc3270)
34+
checkdepends=()
35+
36+
provides=($pkgname)
37+
conflicts=($pkgname)
38+
39+
prepare() {
40+
rm -fr "$srcdir/$pkgname"
41+
ln -snf "$startdir" "$srcdir/$pkgname"
42+
}
43+
44+
build() {
45+
cd $pkgname
46+
./autogen.sh \
47+
--prefix=${MINGW_PREFIX} \
48+
--build=${MINGW_CHOST} \
49+
--host=${MINGW_CHOST} \
50+
--target=${MINGW_CHOST}
51+
52+
make all
53+
}
54+
55+
package() {
56+
cd $pkgname
57+
make DESTDIR="${pkgdir}" install
58+
install \
59+
-Dm644 \
60+
"LICENSE" \
61+
"${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
62+
}

configure.ac

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ AC_PREREQ(2.59)
2323

2424
dnl Initialise automake with the package name, version and
2525
dnl bug-reporting address.
26-
AC_INIT([libhllapi], [5.4.1], [perry.werneck@gmail.com], [libhllapi], [https://github.com/PerryWerneck/libhllapi])
26+
AC_INIT([libhllapi], [5.5.0], [perry.werneck@gmail.com], [libhllapi], [https://github.com/PerryWerneck/libhllapi])
2727

2828
dnl Place auxilliary scripts here.
2929
AC_CONFIG_AUX_DIR([scripts])

win/ci-build.sh

+29-25
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,53 @@
1-
#!/bin/bash -x
1+
#!/bin/bash
2+
#
3+
# SPDX-License-Identifier: LGPL-3.0-or-later
4+
#
5+
# Copyright (C) 2008 Banco do Brasil S.A.
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.
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.
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/>.
19+
220
#
321
# References:
422
#
523
# * https://www.msys2.org/docs/ci/
624
#
7-
#
25+
826
echo "Running ${0}"
927

1028
LOGFILE=build.log
1129
rm -f ${LOGFILE}
1230

1331
die ( ) {
32+
[ -s $LOGFILE ] && tail $LOGFILE
1433
[ "$1" ] && echo "$*"
1534
exit -1
1635
}
1736

18-
myDIR=$(dirname $(dirname $(readlink -f ${0})))
19-
20-
cd ${myDIR}
21-
rm -fr ./.build
22-
mkdir -p ./.build
23-
24-
#
25-
# Unpack LIB3270
26-
#
27-
echo "Unpacking lib3270"
28-
tar -C / -Jxvf ${MINGW_PACKAGE_PREFIX}-lib3270.tar.xz
37+
cd $(dirname $(dirname $(readlink -f ${0})))
2938

3039
#
31-
# Unpack LIBIPC3270
40+
# Install pre-reqs
3241
#
33-
echo "Unpacking libipc3270"
34-
tar -C / -Jxvf ${MINGW_PACKAGE_PREFIX}-libipc3270.tar.xz
42+
echo "Installing pre-reqs..."
43+
pacman -U --noconfirm *.pkg.tar.zst || die "pacman failure"
3544

3645
#
37-
# Build HLLAPI
46+
# Build
3847
#
39-
echo "Building HLLAPI"
40-
./autogen.sh || die "Autogen failure"
41-
./configure || die "Configure failure"
42-
make clean || die "Make clean failure"
43-
make all || die "Make failure"
44-
45-
make DESTDIR=.bin/package install || die "Install failure"
46-
tar --create --xz --file=${MINGW_PACKAGE_PREFIX}-hllapi.tar.xz --directory=.bin/package --verbose . || die "Package failure"
48+
echo "Building package..."
49+
dos2unix PKGBUILD.mingw || die "dos2unix failure"
50+
makepkg BUILDDIR=/tmp/pkg -p PKGBUILD.mingw || die "makepkg failure"
4751

4852
echo "Build complete"
4953

0 commit comments

Comments
 (0)