Skip to content

Commit

Permalink
added macos arm64
Browse files Browse the repository at this point in the history
Signed-off-by: aspel <[email protected]>
  • Loading branch information
aspel committed Jun 15, 2024
1 parent 20b4055 commit dd15f54
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 8 deletions.
48 changes: 44 additions & 4 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- cron: '30 13 * * 5'
jobs:
build-linux-amd64:
runs-on: ubuntu-22.04
runs-on: ubuntu-latest
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- id: time
Expand Down Expand Up @@ -36,7 +36,7 @@ jobs:
curl -X POST -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GIT_TOKEN}" \
https://api.github.com/repos/aspel/pobfrontend/issues/${pull_number}/comments \
-d "{\"body\":\"![Screenshot Linux](${IMG_URL})\n${GITHUB_SHA} : Linux\"}"
-d "{\"body\":\"![Screenshot Linux](${IMG_URL})\n${GITHUB_SHA} : Linux amd64\"}"
popd
echo $IMG_URL
- run: tar -tvf PathOfBuilding.linux.amd64.tar.xz
Expand All @@ -59,7 +59,7 @@ jobs:
tag: PathOfBuilding
body: "${{steps.time.outputs.time}}"
build-macos-amd64:
runs-on: macos-12
runs-on: macos-13
steps:
- id: time
run: |
Expand All @@ -85,7 +85,7 @@ jobs:
curl -X POST -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GIT_TOKEN}" \
https://api.github.com/repos/aspel/pobfrontend/issues/${pull_number}/comments \
-d "{\"body\":\"![Screenshot MacOS](${IMG_URL})\n${GITHUB_SHA} : MacOS\"}"
-d "{\"body\":\"![Screenshot MacOS](${IMG_URL})\n${GITHUB_SHA} : MacOS amd64\"}"
echo $IMG_URL
- run: tar -tvf PathOfBuilding.darwin.amd64.tar.xz
- name: Upload MacOS artifacts into Github
Expand All @@ -98,3 +98,43 @@ jobs:
tag: PathOfBuilding
body: "${{steps.time.outputs.time}}"

build-macos-arm64:
runs-on: macos-latest
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
- run: make
- name: Package tar.xz archive
run: tar -cf - PathOfBuilding.app | xz -c > PathOfBuilding.darwin.arm64.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 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")
curl -X POST -H "Accept: application/vnd.github.v3+json" \
-H "Authorization: token ${GIT_TOKEN}" \
https://api.github.com/repos/aspel/pobfrontend/issues/${pull_number}/comments \
-d "{\"body\":\"![Screenshot MacOS](${IMG_URL})\n${GITHUB_SHA} : MacOS arm64\"}"
echo $IMG_URL
- run: tar -tvf PathOfBuilding.darwin.arm64.tar.xz
- name: Upload MacOS artifacts into Github
if: github.ref == 'refs/heads/master'
uses: ncipollo/release-action@v1
with:
artifacts: "PathOfBuilding.darwin.arm64.tar.xz"
token: ${{ secrets.GITHUB_TOKEN }}
allowUpdates: true
tag: PathOfBuilding
body: "${{steps.time.outputs.time}}"

21 changes: 17 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
DIR := ${CURDIR}
SHELL := /bin/bash
OS_NAME := $(shell uname -s)
OS_ARCH := $(shell uname -m)
OS_ALL := ${OS_NAME}_${OS_ARCH}
.ONESHELL: # Applies to every targets in the file!
.SHELLFLAGS := -o pipefail -eucx

# Build based on OS name
all: $(OS_NAME)
all: $(OS_ALL)

Darwin: pob
Darwin_arm64: pob
LDFLAGS='-L/opt/homebrew/opt/qt@5/lib' \
CPPFLAGS='-I/opt/homebrew/opt/qt@5/include' \
PKG_CONFIG_PATH='/opt/homebrew/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
/opt/homebrew/opt/qt@5/bin/macdeployqt ${DIR}/PathOfBuilding.app
cp ${DIR}/Info.plist.sh ${DIR}/PathOfBuilding.app/Contents/Info.plist
echo "Finished $(OS_NAME)"

Darwin_x86_64: 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' \
Expand All @@ -18,7 +31,7 @@ Darwin: pob
cp ${DIR}/Info.plist.sh ${DIR}/PathOfBuilding.app/Contents/Info.plist
echo "Finished $(OS_NAME)"

Linux: pob
Linux_x86_64: pob
meson setup --buildtype=release --prefix=${DIR}/linux --bindir='' build
meson compile -C build
meson install -C build
Expand Down Expand Up @@ -52,7 +65,7 @@ clear:
rm -rf PathOfBuilding PathOfBuilding.app Lua-cURLv3 lcurl.so build

tools_Darwin:
brew install jq qt5 luajit zlib meson curl dylibbundler
brew install jq qt@5 luajit zlib meson curl dylibbundler

tools_Linux:
sudo apt update && sudo apt -y install qtbase5-dev qt5-qmake \
Expand Down

0 comments on commit dd15f54

Please sign in to comment.