Skip to content

Release TMX for Tiled 1.10 #61

Release TMX for Tiled 1.10

Release TMX for Tiled 1.10 #61

Workflow file for this run

name: Release
on:
push:
tags:
- tmx_** # Releases
env:
# Latest (2.9.10): https://gitlab.gnome.org/GNOME/libxml2/-/issues/154
libxml2_ver: v2.9.9
LIBXML2_CONFIGURE_FLAGS: '--without-c14n --without-catalog --without-debug --without-docbook --without-ftp
--without-http --without-html --without-xpath --without-xptr --without-xinclude --without-iconv --without-icu
--without-iso8859x --without-zlib --without-lzma --without-mem_debug --without-run_debug --without-schemas
--without-schematron --without-regexps --without-modules --without-pattern --without-push --without-valid
--without-sax1 --without-legacy --without-output --without-python
--with-tree --with-writer --with-reader
--disable-shared --enable-static'
zlib_ver: v1.2.11
jobs:
linux64:
name: Linux 64 Build
runs-on: ubuntu-20.04
steps:
# context expressions lack the most basic string manipulation functions...
- name: Create distribution folder
run: |
ARTIFACT_NAME=${GITHUB_REF:10}-linux
DIST_PATH=${GITHUB_WORKSPACE}/${ARTIFACT_NAME}
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "DIST_PATH=${DIST_PATH}" >> $GITHUB_ENV
mkdir "${DIST_PATH}"
# Build and install zlib
- name: Checkout zlib
uses: actions/checkout@v3
with:
repository: madler/zlib
path: zlib
ref: ${{ env.zlib_ver }}
- name: Build and Install zlib
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=Off -DCMAKE_INSTALL_PREFIX="${DIST_PATH}" &&
make -j2 && make install
working-directory: zlib
# Build and install libxml2
- name: Checkout libxml2
uses: actions/checkout@v3
with:
repository: GNOME/libxml2
path: libxml2
ref: ${{ env.libxml2_ver }}
- name: Build and Install libxml2
run: |
./autogen.sh --prefix="${DIST_PATH}" ${LIBXML2_CONFIGURE_FLAGS} &&
make -j2 && make install-strip
working-directory: libxml2
# Clean-up
- name: Clean-up
run: |
rm -rf "${DIST_PATH}/bin" "${DIST_PATH}/share"
find "${DIST_PATH}/lib/" -iname '*.so*' -delete
rm -f "${DIST_PATH}/lib/libxml2.la" "${DIST_PATH}/lib/xml2Conf.sh"
# Build and install libTMX
- name: Checkout libTMX
uses: actions/checkout@v3
with:
path: tmx
- name: Build and Install libTMX
run: |
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${DIST_PATH}" -DCMAKE_PREFIX_PATH="${DIST_PATH}" &&
make -j2 && make install
working-directory: tmx
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_PATH }}
html5:
name: HTML5 Build
runs-on: ubuntu-latest
steps:
- name: Create distribution folder
run: |
ARTIFACT_NAME=${GITHUB_REF:10}-html5
DIST_PATH=${GITHUB_WORKSPACE}/${ARTIFACT_NAME}
echo "ARTIFACT_NAME=${ARTIFACT_NAME}" >> $GITHUB_ENV
echo "DIST_PATH=${DIST_PATH}" >> $GITHUB_ENV
mkdir "${DIST_PATH}"
# Build and install emscripten
- name: Checkout emsdk
uses: actions/checkout@v3
with:
repository: emscripten-core/emsdk
path: emsdk
- name: Install emscripten
run: |
./emsdk install latest &&
./emsdk activate latest
working-directory: emsdk
# Libraries are compiled with flag -flto to generate LLVM bytecode (to later benefit from LTO)
# See: https://emscripten.org/docs/optimizing/Optimizing-Code.html#lto
# Build and install libxml2
- name: Checkout libxml2
uses: actions/checkout@v3
with:
repository: GNOME/libxml2
path: libxml2
ref: ${{ env.libxml2_ver }}
- name: Build and Install libxml2
run: |
. ${GITHUB_WORKSPACE}/emsdk/emsdk_env.sh
emconfigure ./autogen.sh --prefix="${DIST_PATH}" ${LIBXML2_CONFIGURE_FLAGS} &&
emmake make -j2 CFLAGS='-flto' && make install
working-directory: libxml2
# Clean-up
- name: Clean-up
run: rm -rf "${DIST_PATH}/bin" "${DIST_PATH}/share" "${DIST_PATH}/lib/libxml2.la" "${DIST_PATH}/lib/xml2Conf.sh"
# Build and install libTMX
- name: Checkout libTMX
uses: actions/checkout@v3
with:
path: tmx
- name: Build and Install libTMX
run: |
. ${GITHUB_WORKSPACE}/emsdk/emsdk_env.sh
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${DIST_PATH}" \
-DCMAKE_PREFIX_PATH="${DIST_PATH}" -DCMAKE_FIND_ROOT_PATH="${DIST_PATH}" \
-DCMAKE_C_FLAGS='-flto' &&
make -j2 && make install
working-directory: tmx
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_PATH }}
windows:
name: Windows Build
runs-on: windows-2019
steps:
- name: Create distribution folder
run: |
$ARTIFACT_NAME=$($Env:GITHUB_REF).substring(10) + "-win"
echo "ARTIFACT_NAME=$ARTIFACT_NAME" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
$DIST_PATH="$($Env:GITHUB_WORKSPACE)\$ARTIFACT_NAME"
echo "DIST_PATH=$DIST_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
mkdir "$DIST_PATH"
# Build and install zlib
- name: Checkout zlib
uses: actions/checkout@v3
with:
repository: madler/zlib
path: zlib
ref: ${{ env.zlib_ver }}
- name: Build and Install zlib
run: |
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=Off `
-DCMAKE_INSTALL_PREFIX="$($Env:DIST_PATH)" &&
mingw32-make -j2 && mingw32-make install
working-directory: zlib
# Build and install libxml2
- name: Checkout libxml2
uses: actions/checkout@v3
with:
repository: GNOME/libxml2
path: libxml2
ref: ${{ env.libxml2_ver }}
- name: Build and Install libxml2
run: |
cscript configure.js prefix="$($Env:DIST_PATH)" compiler=mingw `
c14n=no catalog=no debug=no docb=no ftp=no http=no html=no xpath=no xptr=no xinclude=no iconv=no `
icu=no iso8859x=no zlib=no lzma=no xml_debug=no mem_debug=no run_debug=no schemas=no schematron=no `
regexps=no modules=no pattern=no valid=no sax1=no legacy=no python=no walker=no `
push=yes tree=yes output=yes writer=yes reader=yes &&
mingw32-make -f Makefile.mingw -j2 &&
Move-Item -Path bin.mingw\libxml2.a -Destination "$($Env:DIST_PATH)\lib" &&
New-Item -Path "$($Env:DIST_PATH)\include" -Name "libxml2" -ItemType "directory" &&
New-Item -Path "$($Env:DIST_PATH)\include\libxml2" -Name "libxml" -ItemType "directory" &&
Move-Item -Path "..\include\libxml\*.h" -Destination "$($Env:DIST_PATH)\include\libxml2\libxml"
working-directory: libxml2/win32
# Clean-up
- name: Clean-up
run: |
Remove-Item -Path "$($Env:DIST_PATH)/share" -Recurse
Remove-Item -Path "$($Env:DIST_PATH)/bin" -Recurse
Remove-Item -Path "$($Env:DIST_PATH)/lib/libzlib.dll.a"
# Build and install libTMX
- name: Checkout libTMX
uses: actions/checkout@v3
with:
path: tmx
- name: Build and Install libTMX
run: |
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$($Env:DIST_PATH)" `
-DCMAKE_PREFIX_PATH="$($Env:DIST_PATH)" &&
mingw32-make -j2 && mingw32-make install
working-directory: tmx
# Upload
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: ${{ env.ARTIFACT_NAME }}
path: ${{ env.DIST_PATH }}