diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15d989dc..1b8bb6b7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -176,3 +176,53 @@ jobs: yarn upload-artifacts dist/LosslessCut-linux-armv7l.tar.bz2 yarn upload-artifacts dist/LosslessCut-linux-x64.tar.bz2 yarn upload-artifacts --name screenshot-linux.jpeg screenshot.jpeg + + release-win-arm64: + runs-on: windows-latest + timeout-minutes: 60 + + env: + is_tag: ${{ startsWith(github.ref, 'refs/tags/v') }} + + steps: + # Windows fix. See https://github.com/actions/checkout/issues/226 + - run: git config --global core.autocrlf false + + - uses: actions/checkout@v6 + + - uses: actions/setup-node@v6 + with: + node-version: 22 + cache: 'yarn' + + # Because of timeout issue https://github.com/yarnpkg/yarn/issues/4890 + - run: yarn install --immutable --network-timeout 1000000 + + - name: Download ffmpeg (Windows ARM64) + run: yarn download-ffmpeg-win32-arm64 + + - name: Build/release Electron app (Windows ARM64) + uses: samuelmeuli/action-electron-builder@v1 + with: + github_token: ${{ secrets.github_token }} + release: ${{ env.is_tag == 'true' }} + max_attempts: 1 + args: --arm64 --win + + # e2e test skipped: x64 runner cannot execute ARM64 binaries + + # https://stackoverflow.com/questions/74774114/using-docker-buildx-github-action-cache-without-official-actions/77225313#77225313 + - name: Expose actions cache variables + uses: actions/github-script@v6 + with: + script: | + core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env['ACTIONS_RUNTIME_TOKEN']) + core.exportVariable('ACTIONS_RESULTS_URL', process.env['ACTIONS_RESULTS_URL']) + + - name: Upload artifacts (Windows ARM64) + if: env.is_tag == 'false' + env: + ACTIONS_RUNTIME_TOKEN: ${{ env.ACTIONS_RUNTIME_TOKEN }} + ACTIONS_RESULTS_URL: ${{ env.ACTIONS_RESULTS_URL }} + run: | + yarn upload-artifacts dist/LosslessCut-win-arm64.7z diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f57a7926..ca374b5e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,6 +23,7 @@ yarn download-ffmpeg-darwin-x64 yarn download-ffmpeg-darwin-arm64 yarn download-ffmpeg-linux-x64 yarn download-ffmpeg-win32-x64 +yarn download-ffmpeg-win32-arm64 ``` For Windows, you may have to install [7z](https://www.7-zip.org/download.html), and then put the 7z folder in your `PATH`. diff --git a/package.json b/package.json index c8c31696..5c999145 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "download-ffmpeg-darwin-arm64": "mkdirp ffmpeg/darwin-arm64 && cd ffmpeg/darwin-arm64 && wget https://github.com/mifi/ffmpeg-build-script/releases/download/8.0-1/ffmpeg-macos-ARM64 -O ffmpeg && wget https://github.com/mifi/ffmpeg-build-script/releases/download/8.0-1/ffprobe-macos-ARM64 -O ffprobe && chmod +x ffmpeg && chmod +x ffprobe", "download-ffmpeg-linux-x64": "mkdirp ffmpeg/linux-x64 && cd ffmpeg/linux-x64 && wget https://github.com/mifi/ffmpeg-builds/releases/download/8.0-1/ffmpeg-n8.0-latest-linux64-gpl-shared-8.0.tar.xz -O ffmpeg-ffprobe.xz && tar -xv -f ffmpeg-ffprobe.xz && mv ffmpeg-n8.0-latest-linux64-gpl-shared-8.0 extracted && mkdirp lib && mv extracted/bin/ffmpeg extracted/bin/ffprobe extracted/lib/lib*.so* lib", "download-ffmpeg-win32-x64": "mkdirp ffmpeg/win32-x64 && cd ffmpeg/win32-x64 && npx download-cli https://github.com/mifi/ffmpeg-builds/releases/download/8.0-1/ffmpeg-n8.0-latest-win64-gpl-shared-8.0.zip --out . --filename ffmpeg-ffprobe.zip && 7z x ffmpeg-ffprobe.zip && mkdirp lib && cd ffmpeg-n8.0-latest-win64-gpl-shared-8.0/bin && npx shx mv ffmpeg.exe ffprobe.exe *.dll ../../lib", + "download-ffmpeg-win32-arm64": "mkdirp ffmpeg/win32-arm64 && cd ffmpeg/win32-arm64 && npx download-cli https://github.com/BtbN/FFmpeg-Builds/releases/download/latest/ffmpeg-n8.0-latest-winarm64-gpl-shared-8.0.zip --out . --filename ffmpeg-ffprobe.zip && 7z x ffmpeg-ffprobe.zip && mkdirp lib && cd ffmpeg-n8.0-latest-winarm64-gpl-shared-8.0/bin && npx shx mv ffmpeg.exe ffprobe.exe *.dll ../../lib", "build": "yarn generate-icon && electron-vite build", "tsc": "tsc --build", "test": "vitest", @@ -473,4 +474,4 @@ } }, "packageManager": "yarn@4.11.0" -} +} \ No newline at end of file