Skip to content

Commit

Permalink
0.3a-628eeeb pkg
Browse files Browse the repository at this point in the history
  • Loading branch information
DirtBagXon committed Nov 5, 2023
1 parent add2f7a commit 57a1b91
Show file tree
Hide file tree
Showing 5 changed files with 107 additions and 15 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
name: Build Packages

on:
pull_request:
paths-ignore:
- '**.md'
- 'Assets/**'
- 'Config/**'
- 'Docs/**'
push:
branches:
- main

jobs:
build:
strategy:
fail-fast: true
matrix:
os:
- ubuntu-latest
- windows-latest
- macos-latest
include:
- os: windows-latest
makefile: Makefile.Win32
outfile_ext: .exe
shell: msys2 {0}
archive: zip
- os: ubuntu-latest
makefile: Makefile.UNIX
shell: bash
archive: tar
- os: macos-latest
makefile: Makefile.OSX
shell: bash
archive: tar
archive_files: Frameworks/
runs-on: ${{ matrix.os }}
defaults:
run:
shell: ${{ matrix.shell }}
steps:
- uses: actions/checkout@master
- name: Install ubuntu build dependencies
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt update
sudo apt install -y libsdl2-dev libsdl2-net-dev
- name: Install macos build dependencies
if: startsWith(matrix.os, 'macos')
run: |
curl -sLo SDL2.dmg https://github.com/libsdl-org/SDL/releases/download/release-2.28.5/SDL2-2.28.5.dmg
curl -sLo SDL2_net.dmg https://github.com/libsdl-org/SDL_net/releases/download/release-2.2.0/SDL2_net-2.2.0.dmg
hdiutil attach -quiet SDL2.dmg
hdiutil attach -quiet SDL2_net.dmg
mkdir Frameworks
cp -r /Volumes/SDL2/SDL2.framework Frameworks/
cp -r /Volumes/SDL2_net/SDL2_net.framework Frameworks/
xattr -dr com.apple.quarantine Frameworks/SDL2.framework
xattr -dr com.apple.quarantine Frameworks/SDL2_net.framework
hdiutil detach -quiet /Volumes/SDL2
hdiutil detach -quiet /Volumes/SDL2_net
- name: Install windows build dependencies
if: startsWith(matrix.os, 'windows')
uses: msys2/setup-msys2@v2
with:
update: true
install: >-
make
zip
git
mingw64/mingw-w64-x86_64-gcc
mingw64/mingw-w64-x86_64-SDL2
mingw64/mingw-w64-x86_64-SDL2_net
- name: Build
run: make -f Makefiles/${{ matrix.makefile }} release NET_BOARD=1 OUTFILE=../supermodel${{ matrix.outfile_ext }}
- name: Validate
run: ./supermodel${{ matrix.outfile_ext }} -print-games
- name: Create Distributions
id: vars
run: |
ShortSHA=$(git rev-parse --short ${{ github.sha }})
echo "COMMIT_SHORT_SHA=$ShortSHA" >> $GITHUB_ENV
- name: Package
run: |
mkdir NVRAM Saves ROMs
cp Docs/LICENSE.txt Docs/README.txt .
echo "NMRAM files go here." > NVRAM/DIR.txt
echo "Save states go here." > Saves/DIR.txt
echo "Recommended (but not mandatory) location for ROM sets." > ROMs/DIR.txt
FILES="supermodel${{ matrix.outfile_ext }} LICENSE.txt README.txt Config/ Assets/ NVRAM/ Saves/ ROMs/ ${{ matrix.archive_files }}"
if [[ "${{ matrix.archive }}" == "tar" ]] ; then
tar -cvf supermodel-${{ env.COMMIT_SHORT_SHA }}.tar $FILES
elif [[ "${{ matrix.archive }}" == "zip" ]] ; then
zip -r supermodel-${{ env.COMMIT_SHORT_SHA }}.zip $FILES
fi
- uses: actions/upload-artifact@master
with:
name: supermodel-${{ runner.os }}-${{ runner.arch }}
path: supermodel-${{ env.COMMIT_SHORT_SHA }}.${{ matrix.archive }}
4 changes: 2 additions & 2 deletions Makefiles/Makefile.OSX
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ endif
# OSX-specific
#

PLATFORM_CXXFLAGS = $(SDL_CFLAGS) -DSUPERMODEL_OSX -F/Library/Frameworks/ -O3
PLATFORM_LDFLAGS = $(SDL_LIBS) -lz -lm -lstdc++ -F/Library/Frameworks/
PLATFORM_CXXFLAGS = -F./Frameworks $(SDL_CFLAGS) -DSUPERMODEL_OSX
PLATFORM_LDFLAGS = -F./Frameworks $(SDL_LIBS) -lz -lm -lstdc++ -Wl,-rpath,@executable_path/../Frameworks -Wl,-rpath,@executable_path/Frameworks


###############################################################################
Expand Down
6 changes: 3 additions & 3 deletions Makefiles/Makefile.Win32
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ endif
#
# SDL2
#
SDL2_LIBS = -lmingw32 -lSDL2main -lSDL2 -Wl,--no-undefined -lshell32 -lsetupapi -ladvapi32 -luuid -lversion -limm32 -lwinmm -lgdi32 -luser32 -lm -pipe
SDL2_CFLAGS =
SDL2_LIBS = `sdl2-config --static-libs` -lmingw32 -Wl,--no-undefined -lshell32 -lsetupapi -ladvapi32 -luuid -lversion -limm32 -lwinmm -lgdi32 -luser32 -lm -pipe -mconsole
SDL2_CFLAGS = `sdl2-config --cflags | sed 's/-Dmain=SDL_main//'`
ifeq ($(strip $(NET_BOARD)),1)
SDL2_LIBS += -lSDL2_net -liphlpapi
endif
Expand Down Expand Up @@ -127,4 +127,4 @@ clean:

$(OBJ_DIR)/SupermodelResources.o: Src/OSD/Windows/SupermodelResources.rc Src/OSD/Windows/SupermodelManifest.xml
$(info Compiling : $< -> $@)
$(SILENT)windres -i Src/OSD/Windows/SupermodelResources.rc -o $@
$(SILENT)windres -i Src/OSD/Windows/SupermodelResources.rc -o $@
10 changes: 1 addition & 9 deletions Makefiles/Rules.inc
Original file line number Diff line number Diff line change
Expand Up @@ -226,20 +226,12 @@ all: $(BIN_DIR)/$(OUTFILE)
# version number. Double-colon rules should force ordered execution.
# The automated build script relies on these -- don't modify their output!
#
.PHONY: set_version
.PHONY: print_message
.PHONY: version
release:: set_version
release:: print_message
release:: clean
release:: all
set_version:
$(eval VERSION = $(strip $(subst ',,0.3a-git-$(shell git rev-parse --short HEAD --sq))))
$(eval SUPERMODEL_BUILD_FLAGS += -DSUPERMODEL_VERSION=\"$(VERSION)\")
print_message:
$(info Building Supermodel Version $(VERSION))
version: set_version
@echo $(VERSION)
$(info Building Supermodel)

$(BIN_DIR)/$(OUTFILE): $(BIN_DIR) $(OBJ_DIR) $(OBJ_FILES)
$(info --------------------------------------------------------------------------------)
Expand Down
2 changes: 1 addition & 1 deletion supermodel3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ function sources_supermodel3() {
function build_supermodel3() {
cp Makefiles/Makefile.UNIX Makefile
make clean
make
make NET_BOARD=1
cp Docs/LICENSE.txt LICENSE
cp bin/supermodel supermodel3
md_ret_require="supermodel3"
Expand Down

1 comment on commit 57a1b91

@DirtBagXon
Copy link
Owner Author

@DirtBagXon DirtBagXon commented on 57a1b91 Nov 5, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledgement to: trzy/Supermodel#75

See GitHub Actions for compiled packages.

Please sign in to comment.