From 9677075f54768387f7a01cac40366de059975ec3 Mon Sep 17 00:00:00 2001 From: Lin Xiaodong Date: Tue, 11 Jun 2024 11:03:46 +0800 Subject: [PATCH] feat: build release (#7) Co-authored-by: linxiaodong --- .github/workflows/release.yml | 31 +++++++++++++++++++++++++++++++ main/helpers/ffmpeg.ts | 2 +- 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..4951f99 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,31 @@ +name: Build/release + +on: push + +jobs: + release: + runs-on: ${{ matrix.os }} + + strategy: + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + + - name: Install Node.js, NPM and Yarn + uses: actions/setup-node@v1 + with: + node-version: 20 + + - name: Build/release Electron app + uses: samuelmeuli/action-electron-builder@v1 + with: + # GitHub token, automatically provided to the action + # (No need to define this secret in the repo settings) + github_token: ${{ secrets.TOKEN }} + + # If the commit is tagged with a version (e.g. "v1.0.0"), + # release the app after building + release: ${{ startsWith(github.ref, 'refs/tags/v') }} diff --git a/main/helpers/ffmpeg.ts b/main/helpers/ffmpeg.ts index c83f6f5..3f6efe2 100644 --- a/main/helpers/ffmpeg.ts +++ b/main/helpers/ffmpeg.ts @@ -20,7 +20,7 @@ export const extractAudio = (videoPath, audioPath) => { console.log('转换任务开始~', str); }) .on('progress', function (progress) { - console.log('进行中,完成' + progress.percent + '%'); + console.log('进行中,完成' + (progress.percent || 0) + '%'); }) .on('end', function (str) { console.log('转换任务完成!');