diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml index f3f22d7..d3e1b43 100644 --- a/.github/workflows/main.yaml +++ b/.github/workflows/main.yaml @@ -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 @@ -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 @@ -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: | @@ -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 @@ -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}}" + \ No newline at end of file diff --git a/Makefile b/Makefile index 453931c..96ad0f9 100644 --- a/Makefile +++ b/Makefile @@ -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' \ @@ -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 @@ -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 \