From 6a924c74e74f680c4f7441b0fcdf831015ab7b3d Mon Sep 17 00:00:00 2001 From: Mikael Finstad Date: Wed, 1 Apr 2020 02:17:38 +0800 Subject: [PATCH] use custom ffmpeg for mac --- .github/workflows/build.yml | 13 ++++++++----- package.json | 5 +++-- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca6fa3c7..2ab0eb77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -6,9 +6,8 @@ jobs: release: runs-on: ${{ matrix.os }} -# TODO -# env: -# is_tag: ${{ startsWith(github.ref, 'refs/tags/v') }} + env: + is_tag: ${{ startsWith(github.ref, 'refs/tags/v') }} strategy: matrix: @@ -38,6 +37,10 @@ jobs: mkdir -p ~/private_keys/ echo '${{ secrets.api_key }}' > ~/private_keys/AuthKey_${{ secrets.api_key_id }}.p8 + - name: Download custom ffmpeg for Mac + if: startsWith(matrix.os, 'macos') + run: npm run download-ffmpeg + - name: Build/release Electron app uses: samuelmeuli/action-electron-builder@v1 with: @@ -47,7 +50,7 @@ jobs: # 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') }} + release: ${{ env.is_tag == 'true' }} mac_certs: ${{ secrets.mac_certs }} mac_certs_password: ${{ secrets.mac_certs_password }} @@ -61,7 +64,7 @@ jobs: API_KEY_ISSUER_ID: ${{ secrets.api_key_issuer_id }} - name: Upload to Mac App Store - if: startsWith(matrix.os, 'macos') && startsWith(github.ref, 'refs/tags/v') + if: startsWith(matrix.os, 'macos') && env.is_tag == 'true' run: | mkdir -p ~/.appstoreconnect/private_keys/ echo '${{ secrets.api_key }}' > ~/.appstoreconnect/private_keys/AuthKey_${{ secrets.api_key_id }}.p8 diff --git a/package.json b/package.json index f991681b..43c709e0 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "scripts": { "start": "concurrently -k \"BROWSER=none PORT=3001 react-scripts start\" \"wait-on http://localhost:3001 && electron .\"", "icon-gen": "mkdirp icon-build && svg2png src/icon.svg -o ./icon-build/app-512.png -w 512 -h 512 && mkdirp icns-build && icon-gen -i src/icon.svg -o ./icns-build --icns --icns-sizes 512,1024 && mkdirp build-resources/appx && npx svg2png src/icon.svg --output=build-resources/appx/StoreLogo.png --width=50 --height=50 && npx svg2png src/icon.svg --output=build-resources/appx/Square150x150Logo.png --width=300 --height=300 && npx svg2png src/icon.svg --output=build-resources/appx/Square44x44Logo.png --width=44 --height=44 && npx svg2png src/icon.svg --output=build-resources/appx/Wide310x150Logo.png --width=620 --height=300", + "download-ffmpeg": "mkdirp ffmpeg-mac && wget https://github.com/mifi/ffmpeg-build-script/releases/download/v2.1.0/ffmpeg -O ffmpeg-mac/ffmpeg && wget https://github.com/mifi/ffmpeg-build-script/releases/download/v2.1.0/ffprobe -O ffmpeg-mac/ffprobe && chmod +x ffmpeg-mac/ffmpeg && chmod +x ffmpeg-mac/ffprobe", "build": "yarn icon-gen && react-scripts build", "test": "react-scripts test", "eject": "react-scripts eject", @@ -129,8 +130,8 @@ "dmg" ], "extraResources": [ - "node_modules/ffmpeg-static/ffmpeg", - "node_modules/ffprobe-static/bin/darwin/**" + { "from": "ffmpeg-mac/ffmpeg", "to": "node_modules/ffmpeg-static/ffmpeg" }, + { "from": "ffmpeg-mac/ffprobe", "to": "node_modules/ffmpeg-static/ffprobe" } ], "icon": "icns-build/app.icns" },