Skip to content

Commit 945c859

Browse files
committed
start using CLI
1 parent 4f08206 commit 945c859

1 file changed

Lines changed: 7 additions & 31 deletions

File tree

.github/workflows/workflow-native.yml

Lines changed: 7 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ jobs:
237237
238238
send-to-pixel-eagle:
239239
name: Send screenshots to Pixel Eagle
240-
runs-on: macos-14
240+
runs-on: ubuntu-latest
241241
needs: [take-screenshots]
242242
strategy:
243243
fail-fast: false
@@ -267,45 +267,21 @@ jobs:
267267
- name: Send to Pixel Eagle
268268
if: steps.gather-examples.outcome == 'success'
269269
run: |
270-
run=`curl https://pixel-eagle.com/${{ inputs.pixeleagle_project }}/runs --json '{"os":"${{ matrix.os }}", "gitref": "${{ inputs.gitref }}", "branch": "${{ inputs.branch }}"}' --oauth2-bearer ${{ secrets.PIXELEAGLE }} | jq '.id'`
270+
curl -O https://pixel-eagle.com/assets/pixeleagle
271+
chmod 755 pixeleagle
271272
272-
SAVEIFS=$IFS
273+
run=`./pixeleagle new-run --metadata '{"os":"${{ matrix.os }}", "gitref": "${{ inputs.gitref }}", "branch": "${{ inputs.branch }}"}'`
273274
274275
cd screenshots-${{ matrix.os }}
275276
276-
IFS=$'\n'
277-
278-
# Build a json array of screenshots and their hashes
279-
hashes='[';
280-
for screenshot in $(find . -type f -name "*.png");
281-
do
282-
name=${screenshot:2}
283-
echo $name
284-
hash=`shasum -a 256 $screenshot | awk '{print $1}'`
285-
hashes="$hashes [\"$name\",\"$hash\"],"
286-
done
287-
hashes=`echo $hashes | rev | cut -c 2- | rev`
288-
hashes="$hashes]"
289-
290-
IFS=$SAVEIFS
291-
292-
# Upload screenshots with unknown hashes
293-
curl https://pixel-eagle.com/${{ inputs.pixeleagle_project }}/runs/$run/hashes --json "$hashes" --oauth2-bearer ${{ secrets.PIXELEAGLE }} | jq '.[]|[.name] | @tsv' |
294-
while IFS=$'\t' read -r name; do
295-
name=`echo $name | tr -d '"'`
296-
echo "Uploading $name"
297-
curl https://pixel-eagle.com/${{ inputs.pixeleagle_project }}/runs/$run/screenshots -F "data=@./$name" -F "screenshot=$name" --oauth2-bearer ${{ secrets.PIXELEAGLE }}
298-
echo
299-
done
300-
301-
IFS=$SAVEIFS
302-
303-
cd ..
277+
./pixeleagle upload-screenshots $run */*.png
304278
305279
curl https://pixel-eagle.com/${{ inputs.pixeleagle_project }}/runs/$run/compare/auto --json '{"os":"<equal>", "branch": "main"}' --oauth2-bearer ${{ secrets.PIXELEAGLE }} | jq '{project_id: .project_id, from: .from, to: .to}' > pixeleagle-${{ matrix.os }}.json
306280
cat pixeleagle-${{ matrix.os }}.json
307281
308282
echo "created run $run"
283+
env:
284+
PIXEL_EAGLE_TOKEN: ${{ secrets.PIXELEAGLE }}
309285

310286
- name: Upload Pixel Eagle status
311287
uses: actions/upload-artifact@v5

0 commit comments

Comments
 (0)