Skip to content

Commit 3adb1d2

Browse files
Merge pull request #390 from Wuerfel21/W21-linux-ci
Rework CI ZIPs and add Linux binaries
2 parents 9624172 + e740fb0 commit 3adb1d2

File tree

2 files changed

+41
-34
lines changed

2 files changed

+41
-34
lines changed

.github/workflows/build_n_test.yml

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,30 @@ jobs:
1818
- uses: actions/checkout@v3
1919
with:
2020
fetch-depth: 0
21-
- run: make zip
22-
- name: Rename ZIPs
21+
- run: make zip CROSS=win32
22+
- name: Rename ZIP
2323
run: |
2424
mv flexptools.zip "flexptools-win32-`git describe --tags --always`.zip"
25-
mv spin2cpp.zip "spin2cpp-win32-`git describe --tags --always`.zip"
2625
- uses: actions/upload-artifact@v3
2726
with:
2827
name: release_zips_win32
2928
path: "./*.zip"
29+
build_linux_amd64:
30+
runs-on: ubuntu-20.04
31+
steps:
32+
- name: Install musl-gcc
33+
run: "sudo apt-get install musl-tools"
34+
- uses: actions/checkout@v3
35+
with:
36+
fetch-depth: 0
37+
- run: make zip CROSS=linux-musl
38+
- name: Rename ZIP
39+
run: |
40+
mv flexptools.zip "flexptools-linux-amd64-`git describe --tags --always`.zip"
41+
- uses: actions/upload-artifact@v3
42+
with:
43+
name: release_zips_linux_amd64
44+
path: "./*.zip"
3045
test_offline:
3146
runs-on: ubuntu-20.04
3247
steps:

Makefile

Lines changed: 23 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -55,27 +55,31 @@ ifeq ($(CROSS),win32)
5555
# CC=i586-mingw32msvc-gcc
5656
CC=i686-w64-mingw32-gcc -Wl,--stack -Wl,8000000 -O
5757
EXT=.exe
58-
BUILD=./build-win32
58+
BUILD=build-win32
5959
else ifeq ($(CROSS),rpi)
6060
CC=arm-linux-gnueabihf-gcc -O
6161
EXT=
62-
BUILD=./build-rpi
62+
BUILD=build-rpi
6363
else ifeq ($(CROSS),linux32)
6464
CC=gcc -m32
6565
EXT=
66-
BUILD=./build-linux32
66+
BUILD=build-linux32
6767
else ifeq ($(CROSS),macosx)
6868
CC=o64-clang -DMACOSX -O
6969
EXT=
70-
BUILD=./build-macosx
70+
BUILD=build-macosx
7171
else ifeq ($(OS),Windows_NT)
7272
CC=gcc
7373
EXT=.exe
74-
BUILD=./build
74+
BUILD=build
75+
else ifeq ($(CROSS),linux-musl)
76+
CC=musl-gcc -static -fno-pie
77+
EXT=
78+
BUILD=build
7579
else
7680
CC=gcc
7781
EXT=
78-
BUILD=./build
82+
BUILD=build
7983
endif
8084

8185
INC=-I. -I./backends -I./frontends -I$(BUILD)
@@ -263,35 +267,23 @@ sys/%.bas.h: sys/%.bas
263267
#
264268
-include $(SPINOBJS:.o=.d)
265269

266-
#
267-
# targets to build a .zip file for a release
268-
#
269-
spin2cpp.exe: .PHONY
270-
$(MAKE) CROSS=win32
271-
cp build-win32/spin2cpp.exe .
272-
273-
flexspin.exe: .PHONY
274-
$(MAKE) CROSS=win32
275-
cp build-win32/flexspin.exe .
276-
277-
flexcc.exe: .PHONY
278-
$(MAKE) CROSS=win32
279-
cp build-win32/flexcc.exe .
280-
281-
spin2cpp.linux: .PHONY
282-
$(MAKE) CROSS=linux32
283-
cp build-linux32/spin2cpp ./spin2cpp.linux
284270

285271
COMMONDOCS=COPYING Changelog.txt doc
286272
ALLDOCS=README.md Flexspin.md $(COMMONDOCS)
287273

288-
zip: flexcc.exe flexspin.exe spin2cpp.exe
289-
$(SIGN) flexspin
290-
mv flexspin.signed.exe flexspin.exe
291-
$(SIGN) flexcc
292-
mv flexcc.signed.exe flexcc.exe
293-
zip -r spin2cpp.zip $(ALLDOCS) spin2cpp.exe flexspin.exe flexcc.exe
294-
zip -r flexptools.zip flexcc.exe flexspin.exe Flexspin.md doc include
274+
zip: all
275+
276+
ifeq ($(CROSS),win32)
277+
$(SIGN) $(BUILD)/flexspin
278+
mv $(BUILD)/flexspin.signed.exe $(BUILD)/flexspin.exe
279+
$(SIGN) $(BUILD)/flexcc
280+
mv $(BUILD)/flexcc.signed.exe $(BUILD)/flexcc.exe
281+
endif
282+
zip -r flexptools.zip $(BUILD)/spin2cpp$(EXT) $(BUILD)/flexcc$(EXT) $(BUILD)/flexspin$(EXT) $(ALLDOCS) include
283+
# I could not make this work in one command idk
284+
printf "@ $(BUILD)/spin2cpp$(EXT)\n@=bin/spin2cpp$(EXT)\n" | zipnote -w flexptools.zip
285+
printf "@ $(BUILD)/flexcc$(EXT)\n@=bin/flexcc$(EXT)\n" | zipnote -w flexptools.zip
286+
printf "@ $(BUILD)/flexspin$(EXT)\n@=bin/flexspin$(EXT)\n" | zipnote -w flexptools.zip
295287

296288
#
297289
# target to build a windows spincvt GUI

0 commit comments

Comments
 (0)