Skip to content

Commit 9bd643d

Browse files
committed
Circleci fix (#18)
1 parent 486b838 commit 9bd643d

4 files changed

Lines changed: 89 additions & 3 deletions

File tree

.circleci/config.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
version: 2
2+
jobs:
3+
build:
4+
docker:
5+
- image: minextu/sdl2-cross-platform
6+
steps:
7+
- checkout
8+
- run:
9+
name: Init
10+
command: |
11+
echo 'export EXECNAME=${CIRCLE_PROJECT_REPONAME}' >> $BASH_ENV
12+
echo 'export BASENAME=${CIRCLE_PROJECT_REPONAME}-$(git describe --tags --always | sed -e 's/^v//')' >> $BASH_ENV
13+
mkdir artifacts
14+
- run:
15+
name: Build (Linux)
16+
command: make linux OUTPUT=${EXECNAME}
17+
- run:
18+
name: Store binary
19+
command: |
20+
zip -r artifacts/${BASENAME}-linux.zip ${EXECNAME} assets
21+
zip -j artifacts/${BASENAME}-linux.zip \
22+
LICENSE
23+
make -f Makefile.linux clean OUTPUT=${EXECNAME}
24+
- run:
25+
name: Build (Windows 32-bit)
26+
command: |
27+
PATH="/usr/i686-w64-mingw32/bin:$PATH"
28+
make linux CC=i686-w64-mingw32-g++ OUTPUT=${EXECNAME}.exe
29+
- run:
30+
name: Store binary
31+
command: |
32+
zip -r artifacts/${BASENAME}-win32.zip ${EXECNAME}.exe assets
33+
zip -j artifacts/${BASENAME}-win32.zip \
34+
LICENSE \
35+
/usr/i686-w64-mingw32/bin/SDL2.dll \
36+
/usr/i686-w64-mingw32/bin/SDL2_image.dll \
37+
/usr/i686-w64-mingw32/bin/libpng16-16.dll \
38+
/usr/i686-w64-mingw32/bin/zlib1.dll
39+
make -f Makefile.linux clean OUTPUT=${EXECNAME}.exe
40+
- persist_to_workspace:
41+
root: .
42+
paths:
43+
- artifacts
44+
publish-github-release:
45+
docker:
46+
- image: cibuilds/github:0.10
47+
steps:
48+
- checkout
49+
- attach_workspace:
50+
at: .
51+
- run:
52+
name: "Publish Release on GitHub"
53+
command: |
54+
VERSION=$(git describe --tags --always)
55+
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
56+
57+
workflows:
58+
version: 2
59+
test:
60+
jobs:
61+
- build:
62+
filters:
63+
branches:
64+
ignore: master
65+
tags:
66+
ignore: /.*/
67+
build-and-release:
68+
jobs:
69+
- build:
70+
filters: &release-filters
71+
branches:
72+
ignore: /.*/
73+
tags:
74+
only: /^v\d+\.\d+\.\d+$/
75+
- publish-github-release:
76+
requires:
77+
- build
78+
filters: *release-filters

Makefile.chip8

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,6 @@ SRC=src/*.cpp
88

99
$(OUTPUT): $(SRC) src/*.h
1010
g++ -Wformat -s -std=c++11 -o $@ $(SRC) -lSDL2_image -lSDL2main `sdl2-config --cflags --libs` -march=armv7-a -mtune=cortex-a7 -ffast-math -Ofast -DSCALE=1 -DOVERSAMPLE=0 -DFULLSCREEN=1 -DSAMPLERATE=22050
11-
12-
11+
12+
clean:
13+
rm $(OUTPUT)

Makefile.linux

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1+
CC=g++
12
OUTPUT=prototracker
23
SRC=src/*.cpp
34

45
$(OUTPUT): $(SRC) src/*.h
5-
g++ -O3 -Wformat -std=c++11 -o $@ $(SRC) -lSDL2_image -lSDL2main `sdl2-config --cflags --libs` -s -DSCALE=2
6+
$(CC) -O3 -Wformat -std=c++11 -o $@ $(SRC) -lSDL2_image -lSDL2main `sdl2-config --cflags --libs` -s -DSCALE=2
7+
8+
clean:
9+
rm $(OUTPUT)

Makefile.mingw

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,6 @@ SRC=src/*.cpp
33

44
$(OUTPUT): $(SRC) src/*.h
55
g++ -DSCALE=2 -O3 -Wformat -std=c++11 -o $@ $(SRC) -lmingw32 -lSDL2_image -lSDL2main -lSDL2 -Ic:/mingw/include/SDL2 -Ic:/tdm-gcc-32/include/SDL2 -s -DENABLE_AUDIO_QUEUE=1
6+
7+
clean:
8+
rm $(OUTPUT)

0 commit comments

Comments
 (0)