Build binaries #219
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
name: Build binaries | |
on: | |
workflow_dispatch: | |
# also test this workflow and build scripts in CI when changed | |
push: | |
paths: | |
- '.github/workflows/binaries.yaml' | |
- 'macosx/*.sh' | |
pull_request: | |
paths: | |
- '.github/workflows/binaries.yaml' | |
- 'macosx/*.sh' | |
jobs: | |
build-ubuntu: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install coreutils build-essential libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev p7zip libgtest-dev | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build RELEASE | |
run: make native CONF=RELEASE -j2 | |
- name: Run tests | |
run: make test CONF=RELEASE | |
- name: Get version | |
run: | | |
echo "POP_VERSION=`./build/linux-x86_64/poptracker --version`" >> $GITHUB_ENV | |
echo "POP_NAME=poptracker_`./build/linux-x86_64/poptracker --version | tr '.' '-'`" >> $GITHUB_ENV | |
- name: Build DIST # this builds a release ZIP, maybe .deb in the future | |
run: make CONF=DIST | |
- name: Store DIST | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ubuntu-22-04-dist | |
path: dist | |
build-appimage: | |
runs-on: ubuntu-22.04 | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo apt-get update -y -qq | |
sudo apt-get install coreutils build-essential libsdl2-dev libsdl2-image-dev libsdl2-ttf-dev p7zip wget libgtest-dev | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Get appimage-builder | |
run: | | |
wget -q -O appimage-builder https://github.com/AppImageCrafters/appimage-builder/releases/download/v1.1.0/appimage-builder-1.1.0-x86_64.AppImage | |
chmod +x appimage-builder | |
./appimage-builder --appimage-extract | |
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimage-builder | |
- name: Build AppImage | |
run: | | |
./appimage-builder --recipe linux/AppImageBuilder.yml | |
- name: Store AppImage | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AppImage | |
path: "*.AppImage" | |
if-no-files-found: error | |
build-macos: | |
runs-on: macos-13 | |
steps: | |
- name: Install dependencies | |
run: | | |
brew install coreutils SDL2 sdl2_ttf sdl2_image openssl@1.1 automake libtool autoconf googletest || true | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build RELEASE | |
run: make native CONF=RELEASE -j3 | |
- name: Run tests | |
run: make test CONF=RELEASE | |
- name: Get version | |
run: | | |
echo "POP_VERSION=`./build/darwin-x86_64/poptracker --version`" >> $GITHUB_ENV | |
echo "POP_NAME=poptracker_`./build/darwin-x86_64/poptracker --version | tr '.' '-'`" >> $GITHUB_ENV | |
- name: Build DIST # this builds the app bundle, zips it and maybe .dmg in the future | |
run: make CONF=DIST | |
- name: Check DIST | |
run: | | |
du -sh ./build/darwin-x86_64/poptracker.app | |
cd ./build/darwin-x86_64/poptracker.app/Contents/MacOS | |
otool -L ./poptracker | |
./poptracker --version | |
./poptracker --list-packs | |
- name: Store app bundle | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.POP_NAME }}_macos | |
path: build/darwin-x86_64/poptracker.app | |
- name: Store ZIP/DMG | |
uses: actions/upload-artifact@v4 | |
with: | |
name: macos-dist | |
path: dist | |
build-msys: | |
runs-on: windows-latest | |
steps: | |
- uses: msys2/setup-msys2@v2 | |
with: | |
update: true | |
install: >- | |
base-devel | |
coreutils | |
make | |
mingw-w64-x86_64-toolchain | |
mingw64/mingw-w64-x86_64-SDL2 | |
mingw64/mingw-w64-x86_64-SDL2_image | |
mingw64/mingw-w64-x86_64-SDL2_ttf | |
mingw64/mingw-w64-x86_64-freetype | |
mingw64/mingw-w64-x86_64-openssl | |
mingw64/mingw-w64-x86_64-gtest | |
p7zip | |
- name: Fix dependencies | |
shell: msys2 {0} | |
run: | | |
# static svt-av1 2.3.0-1 lib seems to be currently broken | |
wget https://quantum-mirror.hu/mirrors/pub/msys2/mingw/mingw64/mingw-w64-x86_64-svt-av1-2.2.1-1-any.pkg.tar.zst | |
pacman -U --noconfirm mingw-w64-x86_64-svt-av1-2.2.1-1-any.pkg.tar.zst | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Build RELEASE | |
shell: msys2 {0} | |
run: make native CONF=RELEASE -j2 | |
- name: Run tests | |
shell: msys2 {0} | |
run: make test CONF=RELEASE | |
- name: Get version | |
shell: msys2 {0} | |
run: | | |
echo "POP_VERSION=`./build/win64/poptracker --version`" >> $GITHUB_ENV | |
echo "POP_NAME=poptracker_`./build/win64/poptracker --version | tr '.' '-'`" >> $GITHUB_ENV | |
- name: Build DIST # this builds a release ZIP | |
shell: msys2 {0} | |
run: make CONF=DIST | |
- name: Store DIST | |
uses: actions/upload-artifact@v4 | |
with: | |
name: win64-msys-dist | |
path: dist | |
- name: Build DEBUG | |
shell: msys2 {0} | |
run: | | |
make clean | |
make native CONF=DEBUG -j2 | |
7z a -mx=9 dist/poptracker-win64-debug.zip build/win64/poptracker.exe | |
- name: Store DEBUG | |
uses: actions/upload-artifact@v4 | |
with: | |
name: win64-msys-debug | |
path: dist/poptracker-win64-debug.zip |