forked from ManWithBear/pobfrontend
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: aspel <[email protected]>
- Loading branch information
Showing
10 changed files
with
151 additions
and
203 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 |
---|---|---|
|
@@ -6,30 +6,28 @@ on: | |
schedule: | ||
- cron: '30 13 * * 5' | ||
jobs: | ||
build-linux: | ||
runs-on: ubuntu-latest | ||
build-linux-amd64: | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- id: time | ||
run: | | ||
time=nightly-$(date +'%Y/%m/%d') | ||
echo "time=${time}" >> $GITHUB_OUTPUT | ||
- uses: actions/checkout@v4 | ||
- run: sudo apt-get install xvfb build-essential ninja-build x11-apps imagemagick libcurl4-openssl-dev | ||
- run: make -f Makefile.linux clean | ||
- run: make -f Makefile.linux tools | ||
- run: make -f Makefile.linux | ||
- run: make | ||
- name: Package tar.xz archive | ||
run: tar -cf - -C ${GITHUB_WORKSPACE}/PathOfBuilding/src $(ls -A ${GITHUB_WORKSPACE}"/PathOfBuilding/src") | xz -c > PathOfBuilding.linux.tar.xz | ||
run: tar -cf - -C ${GITHUB_WORKSPACE}/PathOfBuilding $(ls -A ${GITHUB_WORKSPACE}"/PathOfBuilding") | xz -c > PathOfBuilding.linux.amd64.tar.xz | ||
- name: Cheking GUI | ||
env: | ||
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }} | ||
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | ||
DISPLAY: :10 | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
pushd ${GITHUB_WORKSPACE}/PathOfBuilding/src | ||
pushd ${GITHUB_WORKSPACE}/PathOfBuilding | ||
Xvfb :10 -screen 0 1024x768x24 & | ||
sleep 10 | ||
sleep 15 | ||
./PathOfBuilding & | ||
sleep 10 | ||
xwd -root -silent -display :10 | convert xwd:- png:/tmp/sl.png | ||
|
@@ -41,48 +39,46 @@ jobs: | |
-d "{\"body\":\"![Screenshot Linux](${IMG_URL})\n${GITHUB_SHA} : Linux\"}" | ||
popd | ||
echo $IMG_URL | ||
if: github.ref != 'refs/heads/master' | ||
- run: tar -tvf PathOfBuilding.linux.tar.xz | ||
- run: tar -tvf PathOfBuilding.linux.amd64.tar.xz | ||
- name: Update release tag | ||
if: github.ref == 'refs/heads/master' | ||
run: | | ||
git config --local user.name "${GITHUB_ACTOR}" | ||
git config --local user.email "[email protected]" | ||
git tag -f PathOfBuilding | ||
git remote add gh https://$GITHUB_ACTOR:[email protected]/$GITHUB_REPOSITORY.git | ||
git push -f gh PathOfBuilding | ||
git remote remove gh | ||
if: github.ref == 'refs/heads/master' | ||
- name: Upload Linux artifacts into Github | ||
if: github.ref == 'refs/heads/master' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "PathOfBuilding.linux.tar.xz" | ||
artifacts: "PathOfBuilding.linux.amd64.tar.xz" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
allowUpdates: true | ||
removeArtifacts: true | ||
tag: PathOfBuilding | ||
body: "${{steps.time.outputs.time}}" | ||
if: github.ref == 'refs/heads/master' | ||
build-macos: | ||
runs-on: macos-latest | ||
build-macos-amd64: | ||
runs-on: macos-12 | ||
steps: | ||
- id: time | ||
run: | | ||
time=nightly-$(date +'%Y/%m/%d') | ||
echo "time=${time}" >> $GITHUB_OUTPUT | ||
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | ||
- uses: actions/checkout@v4 | ||
- run: brew install make ninja | ||
- run: make -f Makefile.darwin clean | ||
- run: make -f Makefile.darwin tools | ||
- run: make -f Makefile.darwin | ||
- run: brew install make | ||
- run: make | ||
- name: Package tar.xz archive | ||
run: tar -cf - PathOfBuilding.app | xz -c > PathOfBuilding.darwin.tar.xz | ||
run: tar -cf - PathOfBuilding.app | xz -c > PathOfBuilding.darwin.amd64.tar.xz | ||
- name: Cheking GUI | ||
env: | ||
IMGUR_CLIENT_ID: ${{ secrets.IMGUR_CLIENT_ID }} | ||
GIT_TOKEN: ${{ secrets.GIT_TOKEN }} | ||
if: github.ref != 'refs/heads/master' | ||
run: | | ||
./PathOfBuilding.app/Contents/MacOS/pobWrapper.sh & | ||
sleep 10 | ||
sleep 15 | ||
screencapture /tmp/sl.png | ||
export IMG_URL=`curl -L -X POST https://api.imgur.com/3/image -H "Authorization: Client-ID ${IMGUR_CLIENT_ID}" -F image=@/tmp/sl.png | jq '.data | .link' | tr -d '"'` | ||
pull_number=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") | ||
|
@@ -91,15 +87,14 @@ jobs: | |
https://api.github.com/repos/aspel/pobfrontend/issues/${pull_number}/comments \ | ||
-d "{\"body\":\"![Screenshot MacOS](${IMG_URL})\n${GITHUB_SHA} : MacOS\"}" | ||
echo $IMG_URL | ||
if: github.ref != 'refs/heads/master' | ||
- run: tar -tvf PathOfBuilding.darwin.tar.xz | ||
- run: tar -tvf PathOfBuilding.darwin.amd64.tar.xz | ||
- name: Upload MacOS artifacts into Github | ||
if: github.ref == 'refs/heads/master' | ||
uses: ncipollo/release-action@v1 | ||
with: | ||
artifacts: "PathOfBuilding.darwin.tar.xz" | ||
artifacts: "PathOfBuilding.darwin.amd64.tar.xz" | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
allowUpdates: true | ||
removeArtifacts: true | ||
tag: PathOfBuilding | ||
body: "${{steps.time.outputs.time}}" | ||
if: github.ref == 'refs/heads/master' | ||
|
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,60 @@ | ||
DIR := ${CURDIR} | ||
SHELL := /bin/bash | ||
OS_NAME := $(shell uname -s) | ||
.ONESHELL: # Applies to every targets in the file! | ||
.SHELLFLAGS := -o pipefail -eucx | ||
|
||
# Build based on OS name | ||
all: $(OS_NAME) | ||
|
||
Darwin: pob | ||
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' \ | ||
meson setup --buildtype=release --prefix=${DIR}/PathOfBuilding.app --bindir=Contents/MacOS build | ||
meson compile -C build | ||
meson install -C build | ||
/usr/local/opt/qt@5/bin/macdeployqt ${DIR}/PathOfBuilding.app | ||
cp ${DIR}/Info.plist.sh ${DIR}/PathOfBuilding.app/Contents/Info.plist | ||
echo "Finished $(OS_NAME)" | ||
|
||
Linux: pob | ||
meson setup --buildtype=release build | ||
meson compile -C build | ||
mv build/PathOfBuilding PathOfBuilding/ | ||
echo "Finished $(OS_NAME)" | ||
|
||
pob: clear tools_$(OS_NAME) load_pob luacurl | ||
pushd PathOfBuilding && \ | ||
unzip runtime-win32.zip lua/xml.lua lua/base64.lua lua/sha1.lua && \ | ||
mv lua/*.lua . && \ | ||
rmdir lua && \ | ||
cp ../lcurl.so . && \ | ||
mv src/* . && \ | ||
rmdir src && \ | ||
popd | ||
|
||
load_pob: | ||
git clone --branch dev --single-branch --depth 1 https://github.com/PathOfBuildingCommunity/PathOfBuilding.git PathOfBuilding && \ | ||
pushd PathOfBuilding && \ | ||
rm -rf .git && \ | ||
popd | ||
|
||
luacurl: | ||
git clone --branch v0.3.13 --single-branch --depth 1 https://github.com/Lua-cURL/Lua-cURLv3.git Lua-cURLv3 && \ | ||
pushd Lua-cURLv3 && \ | ||
sed -i -e 's/\?= lua$$/\?= luajit/' Makefile && \ | ||
make && \ | ||
mv lcurl.so ../lcurl.so && \ | ||
popd | ||
|
||
clear: | ||
rm -rf PathOfBuilding PathOfBuilding.app Lua-cURLv3 lcurl.so build | ||
|
||
tools_Darwin: | ||
brew install jq qt5 luajit zlib meson curl dylibbundler | ||
|
||
tools_Linux: | ||
sudo apt update && sudo apt -y install qtbase5-dev qt5-qmake \ | ||
qtcreator luajit libluajit-5.1-dev zlib1g zlib1g-dev meson \ | ||
xvfb build-essential ninja-build x11-apps imagemagick libcurl4-openssl-dev |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.