-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
add2f7a
commit 57a1b91
Showing
5 changed files
with
107 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57a1b91
There was a problem hiding this comment.
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.