forked from ManWithBear/pobfrontend
-
Notifications
You must be signed in to change notification settings - Fork 4
168 lines (144 loc) · 6.31 KB
/
main.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
name: CI
on:
push:
branches: [ master ]
pull_request:
schedule:
- cron: '30 13 * * 5'
jobs:
build-linux-amd64:
runs-on: ubuntu-latest
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}/linux $(ls -A ${GITHUB_WORKSPACE}"/linux") | 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}/linux
Xvfb :10 -screen 0 1024x768x24 &
sleep 15
./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 amd64\"}"
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: |
rm -rf PathOfBuilding.app/Contents/MacOS/spec
codesign --force --deep --sign - PathOfBuilding.app
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 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 amd64\"}"
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}}"
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: |
rm -rf PathOfBuilding.app/Contents/MacOS/spec
codesign --force --deep --sign - PathOfBuilding.app
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}}"