Skip to content

Commit e9ae761

Browse files
authored
Add new build targets & update workflows (#33)
1 parent 99b2412 commit e9ae761

File tree

3 files changed

+42
-16
lines changed

3 files changed

+42
-16
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,14 @@ jobs:
3535

3636
- name: Build Linux
3737
run: |
38-
sudo make -C build/unix package
39-
38+
sudo make -C build/unix unixpackage
4039
4140
- name: Build Windows
4241
run: |
43-
sudo make -C build/unix cleandirs
44-
sudo make -C build/unix CC=x86_64-w64-mingw32-gcc WIN=1 package || exit 1
42+
sudo make -C build/unix winpackage
4543
4644
- name: Results
4745
run: |
48-
md5sum build/unix/toolshed-*.tgz
49-
ls build/unix/toolshed-*.tgz | xargs -I {} bash -c 'ls -al --color=auto {}; tar tzvf {}'
46+
[ -f build/unix/toolshed-*.tgz ] && ls build/unix/toolshed-*.tgz | xargs -I {} bash -c 'echo; md5sum {}; ls -al --color=auto {}; tar tzvf {}'
47+
[ -f build/unix/toolshed-*.zip ] && ls build/unix/toolshed-*.zip | xargs -I {} bash -c 'echo; md5sum {}; ls -al --color=auto {}; unzip -l -v {}'
5048

.github/workflows/release.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,20 +18,32 @@ jobs:
1818
runs-on: ubuntu-latest
1919

2020
steps:
21+
- name: Setup Requirements
22+
run: |
23+
sudo apt-get install mingw-w64 markdown libfuse-dev
24+
2125
- name: Checkout
2226
uses: actions/checkout@v4
2327

24-
- name: Build
28+
- name: Build Linux
2529
run: |
26-
sudo apt-get install mingw-w64 markdown libfuse-dev
27-
sudo make -C build/unix package
28-
sudo make -C build/unix cleandirs
29-
sudo make -C build/unix CC=x86_64-w64-mingw32-gcc WIN=1 package
30+
sudo make -C build/unix unixpackage
31+
32+
- name: Build Windows
33+
run: |
34+
sudo make -C build/unix winpackage
35+
36+
- name: Results
37+
run: |
38+
[ -f build/unix/toolshed-*.tgz ] && ls build/unix/toolshed-*.tgz | xargs -I {} bash -c 'echo; md5sum {}; ls -al --color=auto {}; tar tzvf {}'
39+
[ -f build/unix/toolshed-*.zip ] && ls build/unix/toolshed-*.zip | xargs -I {} bash -c 'echo; md5sum {}; ls -al --color=auto {}; unzip -l -v {}'
3040
3141
- name: Release
3242
uses: softprops/action-gh-release@v1
3343
env:
3444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
3545
with:
36-
files: "build/unix/toolshed-*.tgz"
46+
files: |
47+
"build/unix/toolshed-*.tgz"
48+
"build/unix/toolshed-*.zip"
3749

build/unix/Makefile

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@ include rules.mak
44

55
vpath %.c ../../mamou:../../os9
66

7-
PACKAGENAME = toolshed-unix64-$(VERSION).tgz
7+
PACKAGENAME_UNIX = toolshed-unix64-$(VERSION).tgz
8+
PACKAGENAME_WIN = toolshed-win64-$(VERSION).zip
9+
810
ifneq ($(DESTDIR),)
911
INSTALLDIR = $(DESTDIR)/usr/bin
1012
DOCDIR = $(DESTDIR)/usr/share/doc/toolshed
@@ -20,8 +22,11 @@ DIRS = libtoolshed libnative libcecb librbf libcoco libdecb libmisc libsys \
2022
doc
2123

2224
ifneq ($(WIN),)
23-
PACKAGENAME = toolshed-win64-$(VERSION).tgz
25+
PACKAGENAME = $(PACKAGENAME_WIN)
26+
MAKEPACKAGE = zip -9
2427
else
28+
PACKAGENAME = $(PACKAGENAME_UNIX)
29+
MAKEPACKAGE = tar czvf
2530
DIRS := $(DIRS) cocofuse lst2cmt unittest
2631
APPS := $(APPS) cocofuse
2732
endif
@@ -39,11 +44,22 @@ install: all
3944
package: INSTALLDIR=toolshed-$(VERSION)
4045
package: DOCDIR = $(INSTALLDIR)
4146
package: install
42-
tar czvf $(PACKAGENAME) toolshed-$(VERSION)
47+
$(MAKEPACKAGE) $(PACKAGENAME) toolshed-$(VERSION)/*
4348
rm -rf toolshed-$(VERSION)
4449

4550
cleandirs:
4651
$(foreach dir, $(DIRS), (cd $(dir); $(MAKE) clean);)
4752

4853
clean: cleandirs
49-
$(RM) $(PACKAGENAME)
54+
$(RM) $(PACKAGENAME_WIN) $(PACKAGENAME_UNIX)
55+
56+
unixpackage:
57+
$(MAKE) -f ./Makefile package
58+
59+
winpackage:
60+
$(MAKE) -f ./Makefile cleandirs
61+
$(MAKE) -f ./Makefile CC=x86_64-w64-mingw32-gcc WIN=1 package
62+
63+
allpackages: clean unixpackage winpackage
64+
65+

0 commit comments

Comments
 (0)