Skip to content

Commit

Permalink
Merge pull request #1 from bernhardfritz/migrating-from-travis-ci-to-…
Browse files Browse the repository at this point in the history
…github-actions

Migrating from Travis CI to GitHub Actions
  • Loading branch information
bernhardfritz authored Apr 5, 2023
2 parents 83f99d7 + 6f69c34 commit ee40b12
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 98 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: ci
on: push
jobs:
build-OSX:
runs-on: macos-10.15
env:
LDFLAGS: -L/usr/local/opt/qt@5/lib
CPPFLAGS: -I/usr/local/opt/qt@5/include
PKG_CONFIG_PATH: /usr/local/opt/qt@5/lib/pkgconfig
HOMEBREW_CURLRC: 1
steps:
- run: echo "/usr/local/opt/qt@5/bin" >> $GITHUB_PATH
- uses: actions/checkout@v3
- run: brew install make
- run: brew install ninja
- run: echo insecure >> ~/.curlrc
- run: make -f Makefile.darwin clean
- run: make -f Makefile.darwin tools
- run: make -f Makefile.darwin
- run: tar -cf - PathOfBuilding.app | xz -c > PathOfBuilding.darwin.tar.xz
- uses: actions/upload-artifact@v3
with:
name: build
path: PathOfBuilding.darwin.tar.xz
build-Linux:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- run: sudo apt-get install -y build-essential
- run: sudo apt-get install -y ninja-build
- run: make -f Makefile.linux clean
- run: make -f Makefile.linux tools
- run: make -f Makefile.linux
- run: tar -cf - PathOfBuilding | xz -c > PathOfBuilding.linux.tar.xz
- run: tar -cf - -C ${GITHUB_WORKSPACE}/PathOfBuilding/ $(ls -A ${GITHUB_WORKSPACE}"/PathOfBuilding/") | xz -c > PathOfBuilding.linux.tar.xz
- uses: actions/upload-artifact@v3
with:
name: build
path: PathOfBuilding.linux.tar.xz
deploy:
runs-on: ubuntu-latest
needs: [build-OSX, build-Linux]
steps:
- uses: actions/download-artifact@v3
- uses: softprops/action-gh-release@v1
if: startsWith(github.ref, 'refs/tags/')
with:
files: |
build/PathOfBuilding.darwin.tar.xz
build/PathOfBuilding.linux.tar.xz
71 changes: 0 additions & 71 deletions .travis.yml

This file was deleted.

11 changes: 9 additions & 2 deletions Makefile.darwin
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@ load_pob:
luacurl:
git clone --depth 1 https://github.com/Lua-cURL/Lua-cURLv3.git; \
pushd Lua-cURLv3; \
sed -i '' 's/\?= lua/\?= luajit/' Makefile; \
sed -i '' 's/\?= lua$$/\?= luajit/' Makefile; \
sed -i '' 's@shell .* --libs libcurl@shell PKG_CONFIG_PATH=\$$\$$(brew --prefix --installed curl)/lib/pkgconfig \$$(PKG_CONFIG) --libs libcurl@' Makefile; \
make; \
mv lcurl.so ../lcurl.so; \
popd

tools: qt lua zlib meson
tools: qt lua zlib meson curl dylibbundler

qt:
brew install qt5
Expand All @@ -50,5 +51,11 @@ zlib:
meson:
brew install meson

curl:
brew install curl

dylibbundler:
brew install dylibbundler

clean:
rm -rf PathOfBuilding PathOfBuilding.app Lua-cURLv3 lcurl.so build
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
Path of Building Community Fork for Linux :penguin: and macOS :apple:.

Releases:
* [Linux](https://github.com/bernhardfritz/pobfrontend/releases/download/PathOfBuilding/PathOfBuilding.linux.tar.xz)
* [macOS](https://github.com/bernhardfritz/pobfrontend/releases/download/PathOfBuilding/PathOfBuilding.darwin.tar.xz)
* [Linux](https://github.com/bernhardfritz/pobfrontend/releases/latest/download/PathOfBuilding.linux.tar.xz)
* [macOS](https://github.com/bernhardfritz/pobfrontend/releases/latest/download/PathOfBuilding.darwin.tar.xz)
12 changes: 0 additions & 12 deletions github.sh

This file was deleted.

6 changes: 6 additions & 0 deletions main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1760,6 +1760,12 @@ int main(int argc, char **argv)
}
lua_setglobal(L, "arg");

std::string basePath = pobwindow->basePath.toStdString();
std::string extraPathCommand = "package.path = package.path .. \";"
+ basePath
+ "/runtime/lua/?.lua\"";
luaL_dostring(L, extraPathCommand.c_str());

int result = luaL_dofile(L, "Launch.lua");
if (result != 0) {
lua_error(L);
Expand Down
17 changes: 12 additions & 5 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ lua_dep = dependency('luajit')
# LDFLAGS="-pagezero_size 10000 -image_base 100000000" meson pobfrontend build
if build_machine.system() == 'darwin'
gl_dep = dependency('appleframeworks', modules: ['OpenGL'])
curl_dep = dependency('libcurl')
else
gl_dep = dependency('gl')
endif
Expand All @@ -16,11 +17,17 @@ zlib_dep = dependency('zlib')
qt5 = import('qt5')
prep = qt5.preprocess(moc_headers : ['subscript.hpp', 'pobwindow.hpp'])

executable('PathOfBuilding',
sources : ['main.cpp', prep],
dependencies : [qt5_dep, gl_dep, zlib_dep, lua_dep],
install : true)

if build_machine.system() == 'darwin'
executable('PathOfBuilding',
sources : ['main.cpp', prep],
dependencies : [qt5_dep, gl_dep, zlib_dep, lua_dep, curl_dep],
install : true)
else
executable('PathOfBuilding',
sources : ['main.cpp', prep],
dependencies : [qt5_dep, gl_dep, zlib_dep, lua_dep],
install : true)
endif

if build_machine.system() == 'darwin'
install_data('pobLogo.icns', install_dir : 'Contents/Resources')
Expand Down
8 changes: 2 additions & 6 deletions mesonInstaller.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,5 @@ cp -r ${MESON_SOURCE_ROOT}/PathOfBuilding/* ${MESON_INSTALL_PREFIX}/Contents/Mac

mkdir -p ${MESON_INSTALL_PREFIX}/Contents/Frameworks

#cp -R /usr/local/opt/qt5/Frameworks/* \
# ${MESON_INSTALL_PREFIX}/Contents/Frameworks

#install_name_tool -change @rpath/SDL2.framework/Versions/A/SDL2 \
# @executable_path/../FrameWorks/SDL2.framework/Versions/A/SDL2 \
# ${MESON_INSTALL_PREFIX}/Contents/MacOS/myapp
cd "${MESON_INSTALL_PREFIX}/Contents"
dylibbundler --overwrite-dir --create-dir --bundle-deps --fix-file MacOS/lcurl.so

0 comments on commit ee40b12

Please sign in to comment.