github workflows: try to upload win32 binaries

This commit is contained in:
Thomas Bernard 2020-11-05 13:24:59 +01:00
parent f2485c5a6b
commit 1756c9259a
No known key found for this signature in database
GPG Key ID: DB511043A31ACAAF
2 changed files with 30 additions and 6 deletions

View File

@ -26,4 +26,10 @@ jobs:
run: sudo apt-get install gcc-mingw-w64-i686 mingw-w64-tools
- name: build miniupnpc for win32
run: make -C miniupnpc -f Makefile.mingw DLLWRAP=i686-w64-mingw32-dllwrap CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar
run: make -C miniupnpc -f Makefile.mingw DLLWRAP=i686-w64-mingw32-dllwrap CC=i686-w64-mingw32-gcc AR=i686-w64-mingw32-ar all dist
- name: upload binaries
uses: actions/upload-artifact@v2
with:
name: win32-binaries
path: miniupnpc/*.zip

View File

@ -1,7 +1,7 @@
# $Id: Makefile.mingw,v 1.21 2015/09/18 12:45:16 nanard Exp $
# Miniupnp project.
# http://miniupnp.free.fr/ or https://miniupnp.tuxfamily.org/
# (c) 2005-2018 Thomas Bernard
# (c) 2005-2020 Thomas Bernard
# This Makefile is made for MinGW
#
# To cross compile on a *nix machine :
@ -11,6 +11,7 @@ CC ?= gcc
SETUP_COMPILER_FLAG?=
DLLWRAP = dllwrap
SH = /bin/sh
ZIP = zip
ifeq ($(OS),Windows_NT)
RM = del
else
@ -28,9 +29,22 @@ OBJS=miniwget.o minixml.o igd_desc_parse.o minisoap.o \
connecthostport.o portlistingparse.o receivedata.o \
upnpdev.o addr_is_reserved.o
OBJSDLL=$(addprefix dll-, $(OBJS))
BINARIES=upnpc-static.exe upnpc-shared.exe \
listdevices-static.exe listdevices-shared.exe \
miniupnpc.dll libminiupnpc.a \
testminixml.exe
ifneq ($(GITHUB_SHA),)
COMMITREF=$(GITHUB_SHA)
else
COMMITREF=$(shell git rev-parse --short HEAD)
endif
DISTFILE:=$(shell echo "miniupnpc-bin-win32-`cat VERSION`-$(COMMITREF).zip")
all: upnpc-static.exe upnpc-shared.exe testminixml.exe libminiupnpc.a \
miniupnpc.dll listdevices-static.exe listdevices-shared.exe
.PHONY: all dist clean
all: $(BINARIES)
dist: $(DISTFILE)
clean:
$(RM) miniupnpcstrings.h
@ -39,6 +53,9 @@ clean:
$(RM) miniupnpc.dll miniupnpc.lib miniupnpc.dll.def
$(RM) libminiupnpc.a
$(DISTFILE): $(BINARIES)
$(ZIP) $@ *.exe *.dll *.lib *.def *.a LICENSE README Changelog.txt
libminiupnpc.a: $(OBJS)
$(AR) cr $@ $?
@ -86,6 +103,9 @@ miniupnpcstrings.h: miniupnpcstrings.h.in VERSION
sed 's|MINIUPNPC_VERSION_STRING ".*"|MINIUPNPC_VERSION_STRING "$(shell cat VERSION)"|' > $@
endif
testminixml.exe: testminixml.o minixml.o igd_desc_parse.o
$(CC) -static -o $@ $^
minixml.o: minixml.c minixml.h
upnpc.o: miniwget.h minisoap.h miniupnpc.h igd_desc_parse.h
@ -100,8 +120,6 @@ miniupnpc.o: miniupnpc.c miniupnpc.h minisoap.h miniwget.h minixml.h \
igd_desc_parse.o: igd_desc_parse.c igd_desc_parse.h
testminixml.exe: minixml.o igd_desc_parse.o testminixml.c
upnpreplyparse.o: upnpreplyparse.c upnpreplyparse.h minixml.h
upnpcommands.o: upnpcommands.c upnpcommands.h upnpreplyparse.h miniupnpc.h portlistingparse.h