Skip to content

Commit

Permalink
Circleci fix (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
kometbomb committed Aug 22, 2019
1 parent 486b838 commit 9bd643d
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 3 deletions.
78 changes: 78 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
version: 2
jobs:
build:
docker:
- image: minextu/sdl2-cross-platform
steps:
- checkout
- run:
name: Init
command: |
echo 'export EXECNAME=${CIRCLE_PROJECT_REPONAME}' >> $BASH_ENV
echo 'export BASENAME=${CIRCLE_PROJECT_REPONAME}-$(git describe --tags --always | sed -e 's/^v//')' >> $BASH_ENV
mkdir artifacts
- run:
name: Build (Linux)
command: make linux OUTPUT=${EXECNAME}
- run:
name: Store binary
command: |
zip -r artifacts/${BASENAME}-linux.zip ${EXECNAME} assets
zip -j artifacts/${BASENAME}-linux.zip \
LICENSE
make -f Makefile.linux clean OUTPUT=${EXECNAME}
- run:
name: Build (Windows 32-bit)
command: |
PATH="/usr/i686-w64-mingw32/bin:$PATH"
make linux CC=i686-w64-mingw32-g++ OUTPUT=${EXECNAME}.exe
- run:
name: Store binary
command: |
zip -r artifacts/${BASENAME}-win32.zip ${EXECNAME}.exe assets
zip -j artifacts/${BASENAME}-win32.zip \
LICENSE \
/usr/i686-w64-mingw32/bin/SDL2.dll \
/usr/i686-w64-mingw32/bin/SDL2_image.dll \
/usr/i686-w64-mingw32/bin/libpng16-16.dll \
/usr/i686-w64-mingw32/bin/zlib1.dll
make -f Makefile.linux clean OUTPUT=${EXECNAME}.exe
- persist_to_workspace:
root: .
paths:
- artifacts
publish-github-release:
docker:
- image: cibuilds/github:0.10
steps:
- checkout
- attach_workspace:
at: .
- run:
name: "Publish Release on GitHub"
command: |
VERSION=$(git describe --tags --always)
ghr -t ${GITHUB_TOKEN} -u ${CIRCLE_PROJECT_USERNAME} -r ${CIRCLE_PROJECT_REPONAME} -c ${CIRCLE_SHA1} -delete ${VERSION} ./artifacts/
workflows:
version: 2
test:
jobs:
- build:
filters:
branches:
ignore: master
tags:
ignore: /.*/
build-and-release:
jobs:
- build:
filters: &release-filters
branches:
ignore: /.*/
tags:
only: /^v\d+\.\d+\.\d+$/
- publish-github-release:
requires:
- build
filters: *release-filters
5 changes: 3 additions & 2 deletions Makefile.chip8
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@ SRC=src/*.cpp

$(OUTPUT): $(SRC) src/*.h
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



clean:
rm $(OUTPUT)
6 changes: 5 additions & 1 deletion Makefile.linux
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
CC=g++
OUTPUT=prototracker
SRC=src/*.cpp

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

clean:
rm $(OUTPUT)
3 changes: 3 additions & 0 deletions Makefile.mingw
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,6 @@ SRC=src/*.cpp

$(OUTPUT): $(SRC) src/*.h
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

clean:
rm $(OUTPUT)

0 comments on commit 9bd643d

Please sign in to comment.