Oops. #80
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: Continuous Integration | |
on: [push, pull_request] | |
jobs: | |
linux_build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install SDL | |
run: | | |
sudo apt update | |
sudo apt -q install libsdl2-dev | |
- name: autogen | |
run: ./autogen.sh | |
- name: configure | |
run: ./configure | |
- name: make | |
run: make -j4 | |
- name: make check | |
run: make check | |
- name: autotools dist check | |
run: | | |
# This checks we can go through the entire process of generating | |
# a distribution package with autotools, and that the package can | |
# be built and installed successfully. | |
make distdir distdir=distdir | |
cd distdir | |
./configure | |
make -j4 | |
make install DESTDIR=/tmp/asdfghj | |
macos_build: | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install SDL | |
run: brew install sdl2 autoconf automake libtool pandoc | |
- name: Find Git version | |
id: version | |
run: | | |
if git describe --exact-match --tags >/dev/null; then | |
VERSION=$(git describe --exact-match --tags) | |
VERSION=${VERSION/#sdl-sopwith-/} | |
else | |
VERSION=$(git rev-parse --short HEAD) | |
fi | |
echo "VERSION=$VERSION-macos" >> $GITHUB_OUTPUT | |
# Patch the version in configure.ac: | |
sed -i.old "s/\(AC_INIT([^,]*, \)\[[^]]*\], /\1[$VERSION], /" \ | |
configure.ac | |
- name: autogen | |
run: ./autogen.sh | |
- name: configure | |
run: ./configure | |
- name: make | |
run: make -j4 | |
- name: Make package | |
run: | | |
cd pkg/macos | |
make PACKAGE_VERSION=${{steps.version.outputs.VERSION}} \ | |
PACKAGE_STRING="Sopwith build ${{steps.version.outputs.VERSION}}" | |
- name: Upload build | |
uses: actions/upload-artifact@v1 | |
with: | |
path: "pkg/macos/sdl-sopwith-${{steps.version.outputs.VERSION}}.dmg" | |
name: sdl-sopwith-${{steps.version.outputs.VERSION}} | |
emscripten_build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install Emscripten | |
run: | | |
sudo apt update | |
sudo apt -q install emscripten | |
- name: Find Git version | |
id: version | |
run: | | |
if git describe --exact-match --tags >/dev/null; then | |
VERSION=$(git describe --exact-match --tags) | |
VERSION=${VERSION/#sdl-sopwith-/} | |
else | |
VERSION=$(git rev-parse --short HEAD) | |
fi | |
echo "VERSION=$VERSION-js" >> $GITHUB_OUTPUT | |
# Patch the version in configure.ac: | |
sed -i "s/\(AC_INIT([^,]*, \)\[[^]]*\], /\1[$VERSION], /" \ | |
configure.ac | |
- name: build | |
run: ./embuild.sh | |
- name: make pkg | |
run: | | |
make -C pkg/emscripten | |
- name: Upload build | |
uses: actions/upload-artifact@v1 | |
with: | |
path: "pkg/emscripten/page" | |
name: sdl-sopwith-${{steps.version.outputs.VERSION}} | |
- name: Deploy | |
if: ${{ github.ref == 'refs/heads/trunk' }} | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
folder: "pkg/emscripten/page" | |
repository-name: "fragglet/sdl-sopwith-latest" | |
token: "${{secrets.SDL_SOPWITH_LATEST_SECRET}}" | |
clean: true | |
commit-message: "Build from fragglet/sdl-sopwith@${{github.sha}}" | |
# TODO: Windows crossbuild is in the process of being deprecated in favour | |
# of MSYS2 (below): | |
windows_crossbuild: | |
strategy: | |
matrix: | |
host: [i686-w64-mingw32, x86_64-w64-mingw32] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Find Git version | |
id: version | |
run: | | |
if git describe --exact-match --tags >/dev/null; then | |
VERSION=$(git describe --exact-match --tags) | |
VERSION=${VERSION/#sdl-sopwith-/} | |
else | |
VERSION=$(git rev-parse --short HEAD) | |
fi | |
if [[ ${{ matrix.host }} = x86_64-w64-mingw32 ]]; then | |
VERSION=$VERSION-win64 | |
else | |
VERSION=$VERSION-win32 | |
fi | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
# Patch the version in configure.ac: | |
sed -i "s/\(AC_INIT([^,]*, \)\[[^]]*\], /\1[$VERSION], /" \ | |
configure.ac | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt -q install mingw-w64 pandoc | |
- name: Build SDL | |
run: | | |
git clone -b SDL2 --depth 1 https://github.com/libsdl-org/SDL.git | |
pushd SDL | |
mv .git .gitz | |
export AUTOTOOLS_BUILD_PATH=build-artifacts | |
./configure --host=${{ matrix.host }} --prefix=$PWD/../inst \ | |
--disable-alsa \ | |
--disable-altivec \ | |
--disable-arm-neon \ | |
--disable-arm-simd \ | |
--disable-arts \ | |
--disable-dbus \ | |
--disable-diskaudio \ | |
--disable-esd \ | |
--disable-fcitx \ | |
--disable-fusionsound \ | |
--disable-hidapi-joystick \ | |
--disable-hidapi-libusb \ | |
--disable-ibus \ | |
--disable-ime \ | |
--disable-jack \ | |
--disable-lasx \ | |
--disable-libdecor \ | |
--disable-libsamplerate \ | |
--disable-libudev \ | |
--disable-lsx \ | |
--disable-nas \ | |
--disable-oss \ | |
--disable-pipewire \ | |
--disable-pulseaudio \ | |
--disable-render-metal \ | |
--disable-sndio \ | |
--disable-video-cocoa \ | |
--disable-video-directfb \ | |
--disable-video-kmsdrm \ | |
--disable-video-metal \ | |
--disable-video-rpi \ | |
--disable-video-vivante \ | |
--disable-video-vulkan \ | |
--disable-video-wayland \ | |
--disable-video-x11 | |
make -j8 | |
make install | |
popd | |
- name: autogen | |
run: | | |
export PKG_CONFIG_PATH=$PWD/inst/lib/pkgconfig | |
./autogen.sh --host=${{ matrix.host }} | |
- name: make | |
run: make -j8 | |
- name: make package | |
run: | | |
export PATH=$PATH:$PWD/inst/bin | |
pushd pkg/win32 | |
make | |
popd | |
- name: Upload build | |
uses: actions/upload-artifact@v1 | |
with: | |
path: "pkg/win32/staging" | |
name: sdl-sopwith-${{steps.version.outputs.VERSION}} | |
# TODO: This will eventually replace the Linux-based MINGW crossbuild above. | |
msys2_x86_build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Install pandoc | |
shell: cmd | |
run: choco install pandoc | |
- name: Set up MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW32 | |
path-type: inherit | |
update: true | |
# TODO: 64-bit build: | |
install: >- | |
autotools | |
base-devel | |
dos2unix | |
git | |
zip | |
mingw-w64-i686-gcc | |
mingw-w64-i686-python | |
mingw-w64-i686-SDL2 | |
- uses: actions/checkout@v3 | |
- name: Find Git version | |
id: version | |
run: | | |
if git describe --exact-match --tags >/dev/null; then | |
VERSION=$(git describe --exact-match --tags) | |
VERSION=${VERSION/#sdl-sopwith-/} | |
else | |
VERSION=$(git rev-parse --short HEAD) | |
fi | |
VERSION=$VERSION-msys2-win32 | |
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT | |
# Patch the version in configure.ac: | |
sed -i "s/\(AC_INIT([^,]*, \)\[[^]]*\], /\1[$VERSION], /" \ | |
configure.ac | |
- name: autogen | |
run: | | |
./autogen.sh | |
- name: make | |
run: make -j8 | |
- name: make package | |
run: | | |
cd pkg/win32 | |
make | |
- name: Upload build | |
uses: actions/upload-artifact@v1 | |
with: | |
path: "pkg/win32/staging" | |
name: sdl-sopwith-${{steps.version.outputs.VERSION}} |