ci: fix darwin #133
Workflow file for this run
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
name: CI | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
schedule: | |
- cron: '30 13 * * 5' | |
jobs: | |
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: make | |
- name: Package tar.xz archive | |
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 | |
Xvfb :10 -screen 0 1024x768x24 & | |
sleep 10 | |
./PathOfBuilding & | |
sleep 10 | |
xwd -root -silent -display :10 | convert xwd:- png:/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 Linux](${IMG_URL})\n${GITHUB_SHA} : Linux\"}" | |
popd | |
echo $IMG_URL | |
- 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 | |
- name: Upload Linux artifacts into Github | |
if: github.ref == 'refs/heads/master' | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "PathOfBuilding.linux.amd64.tar.xz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
tag: PathOfBuilding | |
body: "${{steps.time.outputs.time}}" | |
build-macos-amd64: | |
runs-on: macos-13 | |
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.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 | |
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\"}" | |
echo $IMG_URL | |
- 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.amd64.tar.xz" | |
token: ${{ secrets.GITHUB_TOKEN }} | |
allowUpdates: true | |
tag: PathOfBuilding | |
body: "${{steps.time.outputs.time}}" | |