* update

* try fix

* try to fix

* Fix path

* remove ls

* print stdout and stderr of losslescut

* add tmate option
pull/2152/head
Mikael Finstad 2 years ago committed by GitHub
parent a4190662b9
commit 0499100aff
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,7 +7,12 @@ on:
schedule: schedule:
- cron: '0 10 * * *' - cron: '0 10 * * *'
workflow_dispatch: workflow_dispatch:
inputs:
tmate_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs: jobs:
release: release:
@ -24,7 +29,13 @@ jobs:
# os: [windows-latest] # os: [windows-latest]
steps: steps:
# Windows fix. See https://github.com/actions/checkout/issues/226 - name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.tmate_enabled }}
with:
detached: true
# Windows fix. See https://github.com/actions/checkout/issues/226
- run: git config --global core.autocrlf false - run: git config --global core.autocrlf false
- name: Check out Git repository - name: Check out Git repository
@ -111,20 +122,18 @@ jobs:
APPLE_API_KEY_ID: ${{ secrets.api_key_id }} APPLE_API_KEY_ID: ${{ secrets.api_key_id }}
APPLE_API_ISSUER: ${{ secrets.api_key_issuer_id }} APPLE_API_ISSUER: ${{ secrets.api_key_issuer_id }}
- run: npx tsx script/e2e.mts 'dist/mac-arm64/LosslessCut.app/Contents/MacOS/LosslessCut' screenshot-macos.jpeg - run: npx tsx script/e2e.mts 'dist/mac-arm64/LosslessCut.app/Contents/MacOS/LosslessCut' 0:none screenshot.jpeg
if: startsWith(matrix.os, 'macos') if: startsWith(matrix.os, 'macos')
# - run: npx tsx script/e2e.mts 'dist/win-x64/LosslessCut.app/Contents/MacOS/LosslessCut' screenshot-windows.jpeg - run: npx tsx script/e2e.mts 'dist\win-unpacked\LosslessCut.exe' desktop screenshot.jpeg
- run: |
dir /s
if: startsWith(matrix.os, 'windows') if: startsWith(matrix.os, 'windows')
- run: | - run: |
export DISPLAY=:0 export DISPLAY=:0
sudo Xvfb -ac :0 -screen 0 1280x1024x24 > /dev/null 2>&1 & sudo Xvfb -ac :0 -screen 0 1280x1024x24 > /dev/null 2>&1 &
sleep 1 sleep 5
ls -R dist/linux-x64 chmod +x dist/linux-unpacked/losslesscut
# npx tsx script/e2e.mts 'dist/linux-x64/LosslessCut.app/Contents/MacOS/LosslessCut' screenshot-linux.jpeg npx tsx script/e2e.mts 'dist/linux-unpacked/losslesscut' ':0.0+0,0' screenshot.jpeg
if: startsWith(matrix.os, 'ubuntu') if: startsWith(matrix.os, 'ubuntu')
- name: (MacOS) Upload to Mac App Store - name: (MacOS) Upload to Mac App Store
@ -140,7 +149,7 @@ jobs:
path: | path: |
dist/LosslessCut-mac-arm64.dmg dist/LosslessCut-mac-arm64.dmg
dist/LosslessCut-mac-x64.dmg dist/LosslessCut-mac-x64.dmg
screenshot-macos.jpeg screenshot.jpeg
- name: (Windows) Upload artifacts - name: (Windows) Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -149,7 +158,7 @@ jobs:
name: Windows name: Windows
path: | path: |
dist/LosslessCut-win-x64.7z dist/LosslessCut-win-x64.7z
screenshot-windows.jpeg screenshot.jpeg
- name: (Linux) Upload artifacts - name: (Linux) Upload artifacts
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v3
@ -160,5 +169,5 @@ jobs:
dist/LosslessCut-linux-arm64.tar.bz2 dist/LosslessCut-linux-arm64.tar.bz2
dist/LosslessCut-linux-armv7l.tar.bz2 dist/LosslessCut-linux-armv7l.tar.bz2
dist/LosslessCut-linux-x64.tar.bz2 dist/LosslessCut-linux-x64.tar.bz2
screenshot-linux.jpeg screenshot.jpeg

@ -8,7 +8,8 @@ import timers from 'node:timers/promises';
const losslessCutExePath = process.argv[2]; const losslessCutExePath = process.argv[2];
assert(losslessCutExePath); assert(losslessCutExePath);
const screenshotOutPath = process.argv[3]; const screenshotDevice = process.argv[3];
const screenshotOutPath = process.argv[4];
assert(screenshotOutPath); assert(screenshotOutPath);
@ -26,10 +27,20 @@ const client = got.extend({ prefixUrl: `http://127.0.0.1:${port}`, timeout: { re
async function captureScreenshot(outPath: string) { async function captureScreenshot(outPath: string) {
// https://trac.ffmpeg.org/wiki/Capture/Desktop#Windows // https://trac.ffmpeg.org/wiki/Capture/Desktop#Windows
const platform = os.platform();
if (platform === 'darwin') {
const { stderr } = await execa('ffmpeg', ['-f', 'avfoundation', '-list_devices', 'true', '-i', '', '-hide_banner'], { reject: false });
console.log(stderr);
}
assert(screenshotDevice);
await execa('ffmpeg', [ await execa('ffmpeg', [
...(os.platform() === 'darwin' ? ['-r', '30', '-pix_fmt', 'uyvy422', '-f', 'avfoundation', '-i', '1:none'] : []), ...(platform === 'darwin' ? ['-r', '30', '-pix_fmt', 'uyvy422', '-f', 'avfoundation'] : []),
...(os.platform() === 'win32' ? ['-f', 'gdigrab', '-framerate', '30', '-i', 'desktop'] : []), ...(platform === 'win32' ? ['-f', 'gdigrab', '-framerate', '30'] : []),
...(os.platform() === 'linux' ? ['-framerate', '25', '-f', 'x11grab', '-i', ':0.0+0,0'] : []), ...(platform === 'linux' ? ['-framerate', '25', '-f', 'x11grab'] : []),
'-i', screenshotDevice,
'-vframes', '1', outPath, '-vframes', '1', outPath,
], { timeout: 30000 }); ], { timeout: 30000 });
} }
@ -58,6 +69,9 @@ try {
console.log('Waiting for app to quit'); console.log('Waiting for app to quit');
await ps; const { stdout, stderr } = await ps;
console.log('App has quit'); console.log('App has quit');
console.log('stdout:', stdout);
console.log('stderr:', stderr);

Loading…
Cancel
Save