From 5abac17dd38bd52f48f704678e6425535a8bab19 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 02:42:29 +0900 Subject: [PATCH 01/75] add VOICEVOX_ENGINE_DIR env for electron-builder --- vue.config.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vue.config.js b/vue.config.js index dd60d17197..669d091ed2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -1,5 +1,10 @@ // eslint-disable-next-line @typescript-eslint/no-var-requires const path = require("path"); +// eslint-disable-next-line @typescript-eslint/no-var-requires +const process = require("process"); + +const VOICEVOX_ENGINE_DIR = + process.env.VOICEVOX_ENGINE_DIR ?? "../voicevox_engine/run.dist/"; module.exports = { configureWebpack: { @@ -19,7 +24,7 @@ module.exports = { extraFiles: [ { from: ".env.production", to: ".env" }, { - from: "../voicevox_engine/run.dist/", + from: VOICEVOX_ENGINE_DIR, to: "", }, ], From c089858a4cc03d4bc3ac0e11c339bc406094a62b Mon Sep 17 00:00:00 2001 From: aoirint Date: Fri, 24 Sep 2021 19:35:00 +0900 Subject: [PATCH 02/75] add linux electron-builder config --- vue.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vue.config.js b/vue.config.js index 669d091ed2..2796d9b530 100644 --- a/vue.config.js +++ b/vue.config.js @@ -59,6 +59,16 @@ module.exports = { repo: "voicevox", vPrefixedTagName: false, }, + linux: { + icon: "public/icon.png", + category: "AudioVideo", + target: [ + { + target: "AppImage", + arch: ["x64"], + }, + ], + }, }, }, }, From deeb7119a825aa9c2cc942f76d558b3f7c5c2097 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 03:05:31 +0900 Subject: [PATCH 03/75] add workflow --- .github/workflows/build.yml | 106 ++++++++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..0c043333dd --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,106 @@ + +name: build +on: + push: + # branches: + # - master + release: + types: + - created + +jobs: + build: + env: + CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache + ELECTRON_CACHE: .cache/electron + ELECTRON_BUILDER_CACHE: .cache/electron-builder + cache-version: v2 + VOICEVOX_ENGINE_REPO_URL: https://github.com/aoirint/voicevox_engine + strategy: + matrix: + voicevox_engine_version: [0.5.2-aoirint-57] + artifact_name: + - linux-cpu-appimage + - linux-nvidia-appimage + - windows-cpu-nsis-web + - windows-nvidia-nsis-web + include: + - artifact_name: linux-cpu-appimage + voicevox_engine_artifact_name: linux-cpu + os: ubuntu-18.04 + - artifact_name: linux-nvidia-appimage + voicevox_engine_artifact_name: linux-nvidia + os: ubuntu-18.04 + - artifact_name: windows-cpu-nsis-web + voicevox_engine_artifact_name: windows-cpu + os: windows-2019 + - artifact_name: windows-nvidia-nsis-web + voicevox_engine_artifact_name: windows-nvidia + os: windows-2019 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - id: node-version + shell: bash + run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" + + - uses: actions/setup-node@master + with: + node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" + + - uses: actions/cache@master + with: + path: ~/.npm + key: ${{ env.cache-version }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-node- + + - name: Cache Electron + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-cache- + + - name: Cache Electron-Builder + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_BUILDER_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache- + + - name: Install dependencies + shell: bash + run: npm ci + + - name: Build Electron + shell: bash + run: npm run electron:build + + - name: Upload Linux AppImage artifact + if: startsWith(matrix.artifact_name, 'linux-') == 'true' + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: | + dist_electron/*.AppImage + + - name: Upload Windows nsis-web archives artifact + if: startsWith(matrix.artifact_name, 'windows-') == 'true' + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-archives + path: | + dist_electron/nsis-web/out/*.7z.* + + - name: Upload Windows nsis-web installer artifact + if: startsWith(matrix.artifact_name, 'windows-') == 'true' + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-installer + path: | + dist_electron/*.exe From 465c4661a674f9f64ab01b98ed5b5c0f7949a5fb Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 03:55:37 +0900 Subject: [PATCH 04/75] pack VOICEVOX ENGINE --- .github/workflows/build.yml | 37 +++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0c043333dd..7565926842 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,6 +42,34 @@ jobs: steps: - uses: actions/checkout@master + - run: | + mkdir -p voicevox_engine/download + + - run: | + echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt + + - uses: actions/cache@master + id: voicevox-engine-cache + with: + path: voicevox_engine/download + key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ voicevox_engine_version }} + + - name: Download VOICEVOX ENGINE + if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' + shell: bash + env: + VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/tag/${{ matrix.voicevox_engine_version }} + run: + wget -O voicevox_engine/download/list.txt "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_artifact_name }}.7z.txt" + cat voicevox_engine/download/list.txt | xargs -I '%' wget -O "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" + + - name: Extract VOICEVOX ENGINE + shell: bash + run: + # Extract first file to extract all parts + # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ + 7z x "$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + - id: node-version shell: bash run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" @@ -79,6 +107,8 @@ jobs: - name: Build Electron shell: bash + env: + VOICEVOX_ENGINE_DIR: voicevox_engine/${{ matrix.artifact_name }} run: npm run electron:build - name: Upload Linux AppImage artifact @@ -98,9 +128,4 @@ jobs: dist_electron/nsis-web/out/*.7z.* - name: Upload Windows nsis-web installer artifact - if: startsWith(matrix.artifact_name, 'windows-') == 'true' - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.artifact_name }}-installer - path: | - dist_electron/*.exe + if: startsWith(matrix.artifact_name, From 12c376d597a078e364d89834f4cf853ebc42c6bb Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 03:58:21 +0900 Subject: [PATCH 05/75] fix workflow --- .github/workflows/build.yml | 43 ++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 15 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7565926842..8483fffe4a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -15,7 +15,7 @@ jobs: ELECTRON_CACHE: .cache/electron ELECTRON_BUILDER_CACHE: .cache/electron-builder cache-version: v2 - VOICEVOX_ENGINE_REPO_URL: https://github.com/aoirint/voicevox_engine + VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" strategy: matrix: voicevox_engine_version: [0.5.2-aoirint-57] @@ -42,33 +42,35 @@ jobs: steps: - uses: actions/checkout@master - - run: | + - shell: bash + run: | mkdir -p voicevox_engine/download - - run: | + - shell: bash + run: | echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt - uses: actions/cache@master id: voicevox-engine-cache with: path: voicevox_engine/download - key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ voicevox_engine_version }} + key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ matrix.voicevox_engine_version }} - name: Download VOICEVOX ENGINE if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' shell: bash env: - VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/tag/${{ matrix.voicevox_engine_version }} - run: - wget -O voicevox_engine/download/list.txt "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_artifact_name }}.7z.txt" - cat voicevox_engine/download/list.txt | xargs -I '%' wget -O "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" + VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ matrix.voicevox_engine_version }} + run: | + curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_artifact_name }}.7z.txt" + cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" - name: Extract VOICEVOX ENGINE shell: bash - run: + run: | # Extract first file to extract all parts # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ - 7z x "$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ - id: node-version shell: bash @@ -108,11 +110,17 @@ jobs: - name: Build Electron shell: bash env: - VOICEVOX_ENGINE_DIR: voicevox_engine/${{ matrix.artifact_name }} - run: npm run electron:build + VOICEVOX_ENGINE_DIR: voicevox_engine/${{ matrix.voicevox_engine_artifact_name }} + run: npm run electron:build_pnever + + - shell: bash + run: echo ${{ endsWith(matrix.artifact_name, '-appimage') }} + + - shell: bash + run: echo ${{ endsWith(matrix.artifact_name, '-nsis-web') }} - name: Upload Linux AppImage artifact - if: startsWith(matrix.artifact_name, 'linux-') == 'true' + if: endsWith(matrix.artifact_name, '-appimage') uses: actions/upload-artifact@v2 with: name: ${{ matrix.artifact_name }} @@ -120,7 +128,7 @@ jobs: dist_electron/*.AppImage - name: Upload Windows nsis-web archives artifact - if: startsWith(matrix.artifact_name, 'windows-') == 'true' + if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 with: name: ${{ matrix.artifact_name }}-archives @@ -128,4 +136,9 @@ jobs: dist_electron/nsis-web/out/*.7z.* - name: Upload Windows nsis-web installer artifact - if: startsWith(matrix.artifact_name, + if: endsWith(matrix.artifact_name, '-nsis-web') + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-installer + path: | + dist_electron/nsis-web/*.exe From a4109041965e748e82aafd0de4588d08254b06e6 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 04:43:39 +0900 Subject: [PATCH 06/75] rm engine archive to free space --- .github/workflows/build.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8483fffe4a..aad36c47c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -50,14 +50,14 @@ jobs: run: | echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt - - uses: actions/cache@master - id: voicevox-engine-cache - with: - path: voicevox_engine/download - key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ matrix.voicevox_engine_version }} + # - uses: actions/cache@master + # id: voicevox-engine-cache + # with: + # path: voicevox_engine/download + # key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ matrix.voicevox_engine_version }} - name: Download VOICEVOX ENGINE - if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' + # if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' shell: bash env: VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ matrix.voicevox_engine_version }} @@ -72,6 +72,9 @@ jobs: # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + # remove downloads to free space + rm -rf voicevox_engine/download + - id: node-version shell: bash run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" From 6196b6c4dfc826032b27eb20dd15351ee2e077a4 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 04:48:28 +0900 Subject: [PATCH 07/75] name steps --- .github/workflows/build.yml | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index aad36c47c7..df7590c452 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -42,11 +42,13 @@ jobs: steps: - uses: actions/checkout@master - - shell: bash + - name: Create directory voicevox_engine/download + shell: bash run: | mkdir -p voicevox_engine/download - - shell: bash + - name: Dump VOICEVOX ENGINE repo URL to calc hash + shell: bash run: | echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt @@ -75,7 +77,8 @@ jobs: # remove downloads to free space rm -rf voicevox_engine/download - - id: node-version + - name: Output Node version + id: node-version shell: bash run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" @@ -83,7 +86,8 @@ jobs: with: node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" - - uses: actions/cache@master + - name: Cache Node packages + uses: actions/cache@master with: path: ~/.npm key: ${{ env.cache-version }}-node-${{ hashFiles('**/package-lock.json') }} From ed5e2a8fcfcf69da54a338c7fd22cd8bb92472a9 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 04:53:04 +0900 Subject: [PATCH 08/75] show disk space --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df7590c452..4ffecc0b9c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -114,6 +114,11 @@ jobs: shell: bash run: npm ci + - name: Show disk space (debug info) + shell: bash + run: | + df -h + - name: Build Electron shell: bash env: From 2ff32f197b7866e34396b016069ab3005f6bc9a0 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 05:08:37 +0900 Subject: [PATCH 09/75] update voicevox engine run path for linux --- .env.production | 2 +- src/background.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.env.production b/.env.production index 849567952a..f15a9198cf 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ -ENGINE_PATH=run.exe +ENGINE_PATH=./run VUE_APP_ENGINE_URL=http://127.0.0.1:50021 diff --git a/src/background.ts b/src/background.ts index 649c2f6235..9f91bda77a 100644 --- a/src/background.ts +++ b/src/background.ts @@ -95,7 +95,7 @@ async function runEngine() { // エンジンプロセスの起動 const enginePath = path.resolve( appDirPath, - process.env.ENGINE_PATH ?? "run.exe" + process.env.ENGINE_PATH ?? "./run" ); const args = store.get("useGpu") ? ["--use_gpu"] : null; engineProcess = execFile( From afdb4c7d98e15285ee832efe65707a401dbd3be3 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 06:42:37 +0900 Subject: [PATCH 10/75] revert linux diff --- .env.production | 2 +- .github/workflows/build.yml | 22 ---------------------- src/background.ts | 2 +- vue.config.js | 10 ---------- 4 files changed, 2 insertions(+), 34 deletions(-) diff --git a/.env.production b/.env.production index f15a9198cf..849567952a 100644 --- a/.env.production +++ b/.env.production @@ -1,2 +1,2 @@ -ENGINE_PATH=./run +ENGINE_PATH=run.exe VUE_APP_ENGINE_URL=http://127.0.0.1:50021 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4ffecc0b9c..765643b2b0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,17 +20,9 @@ jobs: matrix: voicevox_engine_version: [0.5.2-aoirint-57] artifact_name: - - linux-cpu-appimage - - linux-nvidia-appimage - windows-cpu-nsis-web - windows-nvidia-nsis-web include: - - artifact_name: linux-cpu-appimage - voicevox_engine_artifact_name: linux-cpu - os: ubuntu-18.04 - - artifact_name: linux-nvidia-appimage - voicevox_engine_artifact_name: linux-nvidia - os: ubuntu-18.04 - artifact_name: windows-cpu-nsis-web voicevox_engine_artifact_name: windows-cpu os: windows-2019 @@ -125,20 +117,6 @@ jobs: VOICEVOX_ENGINE_DIR: voicevox_engine/${{ matrix.voicevox_engine_artifact_name }} run: npm run electron:build_pnever - - shell: bash - run: echo ${{ endsWith(matrix.artifact_name, '-appimage') }} - - - shell: bash - run: echo ${{ endsWith(matrix.artifact_name, '-nsis-web') }} - - - name: Upload Linux AppImage artifact - if: endsWith(matrix.artifact_name, '-appimage') - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.artifact_name }} - path: | - dist_electron/*.AppImage - - name: Upload Windows nsis-web archives artifact if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 diff --git a/src/background.ts b/src/background.ts index 9f91bda77a..649c2f6235 100644 --- a/src/background.ts +++ b/src/background.ts @@ -95,7 +95,7 @@ async function runEngine() { // エンジンプロセスの起動 const enginePath = path.resolve( appDirPath, - process.env.ENGINE_PATH ?? "./run" + process.env.ENGINE_PATH ?? "run.exe" ); const args = store.get("useGpu") ? ["--use_gpu"] : null; engineProcess = execFile( diff --git a/vue.config.js b/vue.config.js index 2796d9b530..669d091ed2 100644 --- a/vue.config.js +++ b/vue.config.js @@ -59,16 +59,6 @@ module.exports = { repo: "voicevox", vPrefixedTagName: false, }, - linux: { - icon: "public/icon.png", - category: "AudioVideo", - target: [ - { - target: "AppImage", - arch: ["x64"], - }, - ], - }, }, }, }, From bb548bf9d21562b88136170c17e39d3a092cbd78 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 01:33:21 +0900 Subject: [PATCH 11/75] remove original engine after artifact build --- .github/workflows/build.yml | 1 + build/afterNsisWebArtifactBuild.js | 8 ++++++++ build/removeOriginalEngine.js | 9 +++++++++ 3 files changed, 18 insertions(+) create mode 100644 build/removeOriginalEngine.js diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 765643b2b0..a20d5a57c6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -115,6 +115,7 @@ jobs: shell: bash env: VOICEVOX_ENGINE_DIR: voicevox_engine/${{ matrix.voicevox_engine_artifact_name }} + ORIGINAL_ENGINE_DIR_TO_REMOVE: voicevox_engine/${{ matrix.voicevox_engine_artifact_name }} run: npm run electron:build_pnever - name: Upload Windows nsis-web archives artifact diff --git a/build/afterNsisWebArtifactBuild.js b/build/afterNsisWebArtifactBuild.js index 3de69c510e..b38d8ee353 100644 --- a/build/afterNsisWebArtifactBuild.js +++ b/build/afterNsisWebArtifactBuild.js @@ -1,7 +1,15 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const splitNsisArchive = require("./splitNsisArchive").default; +const removeOriginalEngine = require("./removeOriginalEngine").default; + +const process = require("process"); +const REMOVE_ORIGINAL_ENGINE = process.env.ORIGINAL_ENGINE_DIR_TO_REMOVE !== ""; // target: electron-builder.Target exports.default = async function (target) { + if (REMOVE_ORIGINAL_ENGINE) { + await removeOriginalEngine(target); + } + await splitNsisArchive(target); }; diff --git a/build/removeOriginalEngine.js b/build/removeOriginalEngine.js new file mode 100644 index 0000000000..e05e65771b --- /dev/null +++ b/build/removeOriginalEngine.js @@ -0,0 +1,9 @@ +/* eslint-disable @typescript-eslint/no-var-requires */ +const fs = require("fs"); + +const ORIGINAL_ENGINE_DIR_TO_REMOVE = process.env.ORIGINAL_ENGINE_DIR_TO_REMOVE; + +// target: electron-builder.Target +exports.default = async function (target) { + fs.rmdirSync(ORIGINAL_ENGINE_DIR_TO_REMOVE, { recursive: true }); +}; From 283e5593e7d0514a0433c29ab9db36bfac2add28 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 01:41:14 +0900 Subject: [PATCH 12/75] env check; empty string or undefined --- build/afterNsisWebArtifactBuild.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/afterNsisWebArtifactBuild.js b/build/afterNsisWebArtifactBuild.js index b38d8ee353..cedd163beb 100644 --- a/build/afterNsisWebArtifactBuild.js +++ b/build/afterNsisWebArtifactBuild.js @@ -3,7 +3,7 @@ const splitNsisArchive = require("./splitNsisArchive").default; const removeOriginalEngine = require("./removeOriginalEngine").default; const process = require("process"); -const REMOVE_ORIGINAL_ENGINE = process.env.ORIGINAL_ENGINE_DIR_TO_REMOVE !== ""; +const REMOVE_ORIGINAL_ENGINE = process.env.ORIGINAL_ENGINE_DIR_TO_REMOVE != null; // target: electron-builder.Target exports.default = async function (target) { From 51813fe29af9088caa6940cfe8f5b76253ce5c3c Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 01:42:30 +0900 Subject: [PATCH 13/75] fail-fast false --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a20d5a57c6..048a68fd0a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,7 @@ jobs: cache-version: v2 VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" strategy: + fail-fast: false matrix: voicevox_engine_version: [0.5.2-aoirint-57] artifact_name: From 2396199b44ff47fd767a562d9856fb4c635c5ac5 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 02:17:29 +0900 Subject: [PATCH 14/75] upload win unpacked --- .github/workflows/build.yml | 71 ++++--------------------------------- 1 file changed, 7 insertions(+), 64 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 048a68fd0a..5721aef5fb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,67 +9,21 @@ on: - created jobs: - build: + build-unpacked: env: CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache ELECTRON_CACHE: .cache/electron ELECTRON_BUILDER_CACHE: .cache/electron-builder cache-version: v2 - VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" strategy: fail-fast: false matrix: - voicevox_engine_version: [0.5.2-aoirint-57] - artifact_name: - - windows-cpu-nsis-web - - windows-nvidia-nsis-web - include: - - artifact_name: windows-cpu-nsis-web - voicevox_engine_artifact_name: windows-cpu - os: windows-2019 - - artifact_name: windows-nvidia-nsis-web - voicevox_engine_artifact_name: windows-nvidia - os: windows-2019 + os: [windows-2019] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master - - name: Create directory voicevox_engine/download - shell: bash - run: | - mkdir -p voicevox_engine/download - - - name: Dump VOICEVOX ENGINE repo URL to calc hash - shell: bash - run: | - echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt - - # - uses: actions/cache@master - # id: voicevox-engine-cache - # with: - # path: voicevox_engine/download - # key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ matrix.voicevox_engine_version }} - - - name: Download VOICEVOX ENGINE - # if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' - shell: bash - env: - VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ matrix.voicevox_engine_version }} - run: | - curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_artifact_name }}.7z.txt" - cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" - - - name: Extract VOICEVOX ENGINE - shell: bash - run: | - # Extract first file to extract all parts - # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ - 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ - - # remove downloads to free space - rm -rf voicevox_engine/download - - name: Output Node version id: node-version shell: bash @@ -114,23 +68,12 @@ jobs: - name: Build Electron shell: bash - env: - VOICEVOX_ENGINE_DIR: voicevox_engine/${{ matrix.voicevox_engine_artifact_name }} - ORIGINAL_ENGINE_DIR_TO_REMOVE: voicevox_engine/${{ matrix.voicevox_engine_artifact_name }} - run: npm run electron:build_pnever - - - name: Upload Windows nsis-web archives artifact - if: endsWith(matrix.artifact_name, '-nsis-web') - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.artifact_name }}-archives - path: | - dist_electron/nsis-web/out/*.7z.* + run: npm run electron:build_pnever -- --dir - - name: Upload Windows nsis-web installer artifact - if: endsWith(matrix.artifact_name, '-nsis-web') + - name: Upload Windows Unpacked + if: startsWith(matrix.os, 'windows-') uses: actions/upload-artifact@v2 with: - name: ${{ matrix.artifact_name }}-installer + name: windows-unpacked path: | - dist_electron/nsis-web/*.exe + dist_electron/win-unpacked From 597b01cc576e07fbdb434e4f7500754667855d58 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 02:47:02 +0900 Subject: [PATCH 15/75] stage build --- .github/workflows/build.yml | 147 +++++++++++++++++++++++++++++++++++- 1 file changed, 143 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5721aef5fb..6af9370970 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: - created jobs: - build-unpacked: + build-noengine-cache: env: CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache ELECTRON_CACHE: .cache/electron @@ -70,10 +70,149 @@ jobs: shell: bash run: npm run electron:build_pnever -- --dir - - name: Upload Windows Unpacked + - name: Upload Windows NoEngine Cache if: startsWith(matrix.os, 'windows-') uses: actions/upload-artifact@v2 with: - name: windows-unpacked + name: windows-noengine-cache path: | - dist_electron/win-unpacked + dist_electron/ + dist/ + + build: + needs: [build-noengine-cache] + env: + CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache + ELECTRON_CACHE: .cache/electron + ELECTRON_BUILDER_CACHE: .cache/electron-builder + cache-version: v2 + VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" + strategy: + fail-fast: false + matrix: + voicevox_engine_version: [0.5.2-aoirint-57] + artifact_name: + - windows-cpu-nsis-web + - windows-nvidia-nsis-web + include: + - artifact_name: windows-cpu-nsis-web + noengine_artifact_name: windows-noengine-cache + voicevox_engine_artifact_name: windows-cpu + os: windows-2019 + - artifact_name: windows-nvidia-nsis-web + noengine_artifact_name: windows-noengine-cache + voicevox_engine_artifact_name: windows-nvidia + os: windows-2019 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Download and extract artifact + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.noengine_artifact_name }} + path: ./ + + # Download VOICEVOX ENGINE + - name: Create directory voicevox_engine/download + shell: bash + run: | + mkdir -p voicevox_engine/download + - name: Dump VOICEVOX ENGINE repo URL to calc hash + shell: bash + run: | + echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt + # - uses: actions/cache@master + # id: voicevox-engine-cache + # with: + # path: voicevox_engine/download + # key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ matrix.voicevox_engine_version }} + + - name: Download VOICEVOX ENGINE + # if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' + shell: bash + env: + VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ matrix.voicevox_engine_version }} + run: | + curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_artifact_name }}.7z.txt" + cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" + + - name: Extract VOICEVOX ENGINE + shell: bash + run: | + # Extract first file to extract all parts + # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ + 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + # remove downloads to free space + rm -rf voicevox_engine/download + + - name: Move VOICEVOX ENGINE to win-unpacked + shell: bash + if: startsWith(matrix.noengine_artifact_name, 'windows-') + run: | + mv voicevox_engine/* dist_electron/win-unpacked/ + rm -rf voicevox_engine + + - name: Output Node version + id: node-version + shell: bash + run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" + + - name: Set NODE_VERSION output + uses: actions/setup-node@master + with: + node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" + + - name: Cache Node packages + uses: actions/cache@master + with: + path: ~/.npm + key: ${{ env.cache-version }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-node- + + - name: Cache Electron + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-cache- + + - name: Cache Electron-Builder + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_BUILDER_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache- + + - name: Install dependencies + shell: bash + run: npm ci + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + - name: Build Electron + shell: bash + run: npm run electron:build_pnever + + - name: Upload Windows nsis-web archives artifact + if: endsWith(matrix.artifact_name, '-nsis-web') + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-archives + path: | + dist_electron/nsis-web/out/*.7z.* + + - name: Upload Windows nsis-web installer artifact + if: endsWith(matrix.artifact_name, '-nsis-web') + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-installer + path: | + dist_electron/nsis-web/*.exe From 3ffdd9b8b3d8ca9205ca612f525e4605c208cde3 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 03:16:47 +0900 Subject: [PATCH 16/75] prepackaged --- .github/workflows/build.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6af9370970..d5b6122522 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -112,7 +112,12 @@ jobs: uses: actions/download-artifact@v2 with: name: ${{ matrix.noengine_artifact_name }} - path: ./ + path: ./prepackaged + + - name: List files (debug info) + shell: bash + run: | + ls # Download VOICEVOX ENGINE - name: Create directory voicevox_engine/download @@ -151,7 +156,7 @@ jobs: shell: bash if: startsWith(matrix.noengine_artifact_name, 'windows-') run: | - mv voicevox_engine/* dist_electron/win-unpacked/ + mv voicevox_engine/* prepackaged/win-unpacked/ rm -rf voicevox_engine - name: Output Node version @@ -199,7 +204,7 @@ jobs: - name: Build Electron shell: bash - run: npm run electron:build_pnever + run: npm run electron:build_pnever -- --prepackaged "prepackaged" - name: Upload Windows nsis-web archives artifact if: endsWith(matrix.artifact_name, '-nsis-web') From 8448c0649452e5f4b3eaaff42b5a752d3407df24 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 03:27:04 +0900 Subject: [PATCH 17/75] fix prepackage --- .github/workflows/build.yml | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5b6122522..f4466340f1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ on: - created jobs: - build-noengine-cache: + build-noengine-prepackage: env: CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache ELECTRON_CACHE: .cache/electron @@ -70,17 +70,16 @@ jobs: shell: bash run: npm run electron:build_pnever -- --dir - - name: Upload Windows NoEngine Cache + - name: Upload Windows NoEngine Prepackage if: startsWith(matrix.os, 'windows-') uses: actions/upload-artifact@v2 with: - name: windows-noengine-cache + name: windows-noengine-prepackage path: | - dist_electron/ - dist/ + dist_electron/win-unpacked build: - needs: [build-noengine-cache] + needs: [build-noengine-prepackage] env: CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache ELECTRON_CACHE: .cache/electron @@ -96,11 +95,11 @@ jobs: - windows-nvidia-nsis-web include: - artifact_name: windows-cpu-nsis-web - noengine_artifact_name: windows-noengine-cache + noengine_artifact_name: windows-noengine-prepackage voicevox_engine_artifact_name: windows-cpu os: windows-2019 - artifact_name: windows-nvidia-nsis-web - noengine_artifact_name: windows-noengine-cache + noengine_artifact_name: windows-noengine-prepackage voicevox_engine_artifact_name: windows-nvidia os: windows-2019 @@ -114,11 +113,6 @@ jobs: name: ${{ matrix.noengine_artifact_name }} path: ./prepackaged - - name: List files (debug info) - shell: bash - run: | - ls - # Download VOICEVOX ENGINE - name: Create directory voicevox_engine/download shell: bash @@ -156,7 +150,7 @@ jobs: shell: bash if: startsWith(matrix.noengine_artifact_name, 'windows-') run: | - mv voicevox_engine/* prepackaged/win-unpacked/ + mv voicevox_engine/* prepackaged/ rm -rf voicevox_engine - name: Output Node version From 460ff2a45253b27a76d9fbc380ec6461af9332db Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:01:07 +0900 Subject: [PATCH 18/75] add disk space disp --- .github/workflows/build.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f4466340f1..1067e231b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -118,10 +118,11 @@ jobs: shell: bash run: | mkdir -p voicevox_engine/download - - name: Dump VOICEVOX ENGINE repo URL to calc hash - shell: bash - run: | - echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt + + # - name: Dump VOICEVOX ENGINE repo URL to calc hash + # shell: bash + # run: | + # echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt # - uses: actions/cache@master # id: voicevox-engine-cache # with: @@ -200,6 +201,11 @@ jobs: shell: bash run: npm run electron:build_pnever -- --prepackaged "prepackaged" + - name: Show disk space (debug info) + shell: bash + run: | + df -h + - name: Upload Windows nsis-web archives artifact if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 From 5776d2825199b2cc43738c2d36f307d651dea7b8 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:11:02 +0900 Subject: [PATCH 19/75] merge nsis-web artifact --- .github/workflows/build.yml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1067e231b4..4508247b6b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -206,18 +206,11 @@ jobs: run: | df -h - - name: Upload Windows nsis-web archives artifact + - name: Upload Windows nsis-web artifact if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 with: - name: ${{ matrix.artifact_name }}-archives + name: ${{ matrix.artifact_name }} path: | dist_electron/nsis-web/out/*.7z.* - - - name: Upload Windows nsis-web installer artifact - if: endsWith(matrix.artifact_name, '-nsis-web') - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.artifact_name }}-installer - path: | dist_electron/nsis-web/*.exe From cce5bb0f05fdb3e83e3779893b6989c3d4a51728 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:17:12 +0900 Subject: [PATCH 20/75] engine-prepackage --- .github/workflows/build.yml | 74 +++++++++++++++++++++++++++++++------ 1 file changed, 62 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4508247b6b..e251b3294c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -78,27 +78,24 @@ jobs: path: | dist_electron/win-unpacked - build: + + build-engine-prepackage: needs: [build-noengine-prepackage] env: - CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache - ELECTRON_CACHE: .cache/electron - ELECTRON_BUILDER_CACHE: .cache/electron-builder - cache-version: v2 VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" strategy: fail-fast: false matrix: voicevox_engine_version: [0.5.2-aoirint-57] artifact_name: - - windows-cpu-nsis-web - - windows-nvidia-nsis-web + - windows-cpu-prepackage + - windows-nvidia-prepackage include: - - artifact_name: windows-cpu-nsis-web + - artifact_name: windows-cpu-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_artifact_name: windows-cpu os: windows-2019 - - artifact_name: windows-nvidia-nsis-web + - artifact_name: windows-nvidia-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_artifact_name: windows-nvidia os: windows-2019 @@ -107,11 +104,11 @@ jobs: steps: - uses: actions/checkout@master - - name: Download and extract artifact + - name: Download and extract noengine-prepackage artifact uses: actions/download-artifact@v2 with: name: ${{ matrix.noengine_artifact_name }} - path: ./prepackaged + path: ./prepackage # Download VOICEVOX ENGINE - name: Create directory voicevox_engine/download @@ -144,6 +141,7 @@ jobs: # Extract first file to extract all parts # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + # remove downloads to free space rm -rf voicevox_engine/download @@ -154,6 +152,57 @@ jobs: mv voicevox_engine/* prepackaged/ rm -rf voicevox_engine + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + - name: Upload prepackage artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: | + prepackage/ + + + build: + needs: [build-engine-prepackage] + env: + CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache + ELECTRON_CACHE: .cache/electron + ELECTRON_BUILDER_CACHE: .cache/electron-builder + cache-version: v2 + strategy: + fail-fast: false + matrix: + artifact_name: + - windows-cpu-nsis-web + - windows-nvidia-nsis-web + include: + - artifact_name: windows-cpu-nsis-web + engine_artifact_name: windows-cpu-prepackage + voicevox_engine_artifact_name: windows-cpu + os: windows-2019 + - artifact_name: windows-nvidia-nsis-web + engine_artifact_name: windows-nvidia-prepackage + voicevox_engine_artifact_name: windows-nvidia + os: windows-2019 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Download and extract engine-prepackage artifact + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.noengine_artifact_name }} + path: ./prepackage + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + - name: Output Node version id: node-version shell: bash @@ -197,9 +246,10 @@ jobs: run: | df -h + # NOTE: prepackage can be removed before splitting nsis-web archive - name: Build Electron shell: bash - run: npm run electron:build_pnever -- --prepackaged "prepackaged" + run: npm run electron:build_pnever -- --prepackaged "prepackage/" - name: Show disk space (debug info) shell: bash From f734d96d08563de548693b4acfdef427da6e6760 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:29:02 +0900 Subject: [PATCH 21/75] upload to release --- .github/workflows/build.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e251b3294c..cb524d8de9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -264,3 +264,21 @@ jobs: path: | dist_electron/nsis-web/out/*.7z.* dist_electron/nsis-web/*.exe + + - name: Upload Windows nsis-web archives to Release assets + if: github.event.release.tag_name != '' && endsWith(matrix.artifact_name, '-nsis-web') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} # == github.event.release.tag_name + file_glob: true + file: dist_electron/nsis-web/out/*.7z.* + + - name: Upload Windows nsis-web installer to Release assets + if: github.event.release.tag_name != '' && endsWith(matrix.artifact_name, '-nsis-web') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} # == github.event.release.tag_name + file_glob: true + file: dist_electron/nsis-web/*.exe From 6dad7dfbf23824a0b4fd4cbb6ca4bd209b5c82e2 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:31:42 +0900 Subject: [PATCH 22/75] fix dir --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index cb524d8de9..002a81a8fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -149,7 +149,7 @@ jobs: shell: bash if: startsWith(matrix.noengine_artifact_name, 'windows-') run: | - mv voicevox_engine/* prepackaged/ + mv voicevox_engine/* prepackage/ rm -rf voicevox_engine - name: Show disk space (debug info) From 1107ab0d1034b184e547b225407c6680ce203050 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:33:56 +0900 Subject: [PATCH 23/75] fix merge condition --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 002a81a8fa..29f9d570d6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -145,9 +145,8 @@ jobs: # remove downloads to free space rm -rf voicevox_engine/download - - name: Move VOICEVOX ENGINE to win-unpacked + - name: Merge VOICEVOX ENGINE into prepackage/ shell: bash - if: startsWith(matrix.noengine_artifact_name, 'windows-') run: | mv voicevox_engine/* prepackage/ rm -rf voicevox_engine From a55a07f7d78ecfbd233f93d2834cab120e6eed7a Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 04:45:55 +0900 Subject: [PATCH 24/75] rename job; distributable --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29f9d570d6..78f0b238da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -164,7 +164,7 @@ jobs: prepackage/ - build: + build-distributable: needs: [build-engine-prepackage] env: CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache From e99cf4e8feb4e825f2551f7288d27cb5d9c8846e Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 05:25:16 +0900 Subject: [PATCH 25/75] fix engine copy --- .github/workflows/build.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 78f0b238da..a2632047f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -132,14 +132,14 @@ jobs: env: VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ matrix.voicevox_engine_version }} run: | - curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_artifact_name }}.7z.txt" + curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_asset_name }}.7z.txt" cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" - name: Extract VOICEVOX ENGINE shell: bash run: | # Extract first file to extract all parts - # Destination: voicevox/${{ matrix.voicevox_engine_artifact_name }}/ + # Destination: voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/ 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ # remove downloads to free space @@ -148,7 +148,7 @@ jobs: - name: Merge VOICEVOX ENGINE into prepackage/ shell: bash run: | - mv voicevox_engine/* prepackage/ + mv voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/* prepackage/ rm -rf voicevox_engine - name: Show disk space (debug info) @@ -180,11 +180,9 @@ jobs: include: - artifact_name: windows-cpu-nsis-web engine_artifact_name: windows-cpu-prepackage - voicevox_engine_artifact_name: windows-cpu os: windows-2019 - artifact_name: windows-nvidia-nsis-web engine_artifact_name: windows-nvidia-prepackage - voicevox_engine_artifact_name: windows-nvidia os: windows-2019 runs-on: ${{ matrix.os }} From c66e598b2d36642aa9ed37ef409155e1f553e8c8 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 05:36:58 +0900 Subject: [PATCH 26/75] fix matrix var name --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a2632047f6..2f03bc81ed 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -93,11 +93,11 @@ jobs: include: - artifact_name: windows-cpu-prepackage noengine_artifact_name: windows-noengine-prepackage - voicevox_engine_artifact_name: windows-cpu + voicevox_engine_asset_name: windows-cpu os: windows-2019 - artifact_name: windows-nvidia-prepackage noengine_artifact_name: windows-noengine-prepackage - voicevox_engine_artifact_name: windows-nvidia + voicevox_engine_asset_name: windows-nvidia os: windows-2019 runs-on: ${{ matrix.os }} From e1e869a1596370ecdb8563835a89c05c543865dd Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 05:57:32 +0900 Subject: [PATCH 27/75] fix step name --- .github/workflows/build.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2f03bc81ed..6ead82b8a5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,12 +24,13 @@ jobs: steps: - uses: actions/checkout@master - - name: Output Node version + - name: Set output Node version id: node-version shell: bash run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" - - uses: actions/setup-node@master + - name: Setup Node + uses: actions/setup-node@master with: node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" @@ -200,12 +201,12 @@ jobs: run: | df -h - - name: Output Node version + - name: Set output Node version id: node-version shell: bash run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" - - name: Set NODE_VERSION output + - name: Setup Node uses: actions/setup-node@master with: node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" From b76a7d94bbe5cfe2a8ad22a04174cb0866c2eb92 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 06:13:04 +0900 Subject: [PATCH 28/75] fix matrix var ref --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ead82b8a5..ae692b0413 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -193,7 +193,7 @@ jobs: - name: Download and extract engine-prepackage artifact uses: actions/download-artifact@v2 with: - name: ${{ matrix.noengine_artifact_name }} + name: ${{ matrix.engine_artifact_name }} path: ./prepackage - name: Show disk space (debug info) From 04478e5fdb4743648ca4b2eb657e3ffa617191bc Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 06:45:31 +0900 Subject: [PATCH 29/75] add fixme note to rename before upload to asset --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ae692b0413..8065da79b8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -263,6 +263,7 @@ jobs: dist_electron/nsis-web/out/*.7z.* dist_electron/nsis-web/*.exe + # FIXME: rename archives and installer before upload to separate cpu, gpu distribution - name: Upload Windows nsis-web archives to Release assets if: github.event.release.tag_name != '' && endsWith(matrix.artifact_name, '-nsis-web') uses: svenstaro/upload-release-action@v2 From 731179a43f64ea5154226a3fcff9db0a1f963413 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 07:26:13 +0900 Subject: [PATCH 30/75] disable cpu build --- .github/workflows/build.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8065da79b8..e797663ffc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,13 +89,13 @@ jobs: matrix: voicevox_engine_version: [0.5.2-aoirint-57] artifact_name: - - windows-cpu-prepackage + # - windows-cpu-prepackage - windows-nvidia-prepackage include: - - artifact_name: windows-cpu-prepackage - noengine_artifact_name: windows-noengine-prepackage - voicevox_engine_asset_name: windows-cpu - os: windows-2019 + # - artifact_name: windows-cpu-prepackage + # noengine_artifact_name: windows-noengine-prepackage + # voicevox_engine_asset_name: windows-cpu + # os: windows-2019 - artifact_name: windows-nvidia-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-nvidia @@ -176,12 +176,12 @@ jobs: fail-fast: false matrix: artifact_name: - - windows-cpu-nsis-web + # - windows-cpu-nsis-web - windows-nvidia-nsis-web include: - - artifact_name: windows-cpu-nsis-web - engine_artifact_name: windows-cpu-prepackage - os: windows-2019 + # - artifact_name: windows-cpu-nsis-web + # engine_artifact_name: windows-cpu-prepackage + # os: windows-2019 - artifact_name: windows-nvidia-nsis-web engine_artifact_name: windows-nvidia-prepackage os: windows-2019 From b00d807eaa5956a76cf9ed3f01e03a011da64b2d Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 07:31:35 +0900 Subject: [PATCH 31/75] enable cpu engine prepackage --- .github/workflows/build.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e797663ffc..3c165694fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,13 +89,13 @@ jobs: matrix: voicevox_engine_version: [0.5.2-aoirint-57] artifact_name: - # - windows-cpu-prepackage + - windows-cpu-prepackage - windows-nvidia-prepackage include: - # - artifact_name: windows-cpu-prepackage - # noengine_artifact_name: windows-noengine-prepackage - # voicevox_engine_asset_name: windows-cpu - # os: windows-2019 + - artifact_name: windows-cpu-prepackage + noengine_artifact_name: windows-noengine-prepackage + voicevox_engine_asset_name: windows-cpu + os: windows-2019 - artifact_name: windows-nvidia-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-nvidia From e0607ab0d092702aa950506d36e234a9052397e3 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 08:33:52 +0900 Subject: [PATCH 32/75] build distributable only on release --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3c165694fe..ca34ae47c7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -166,6 +166,7 @@ jobs: build-distributable: + if: github.event.release.tag_name != '' # If release needs: [build-engine-prepackage] env: CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache @@ -265,7 +266,7 @@ jobs: # FIXME: rename archives and installer before upload to separate cpu, gpu distribution - name: Upload Windows nsis-web archives to Release assets - if: github.event.release.tag_name != '' && endsWith(matrix.artifact_name, '-nsis-web') + if: endsWith(matrix.artifact_name, '-nsis-web') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -274,7 +275,7 @@ jobs: file: dist_electron/nsis-web/out/*.7z.* - name: Upload Windows nsis-web installer to Release assets - if: github.event.release.tag_name != '' && endsWith(matrix.artifact_name, '-nsis-web') + if: endsWith(matrix.artifact_name, '-nsis-web') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From 22f8b52ca7ecc0488d56f362dcddd31d3ef09c5d Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 08:34:07 +0900 Subject: [PATCH 33/75] build on push master --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ca34ae47c7..117b1e85bf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -2,8 +2,8 @@ name: build on: push: - # branches: - # - master + branches: + - master release: types: - created From 0bf2df9fc9e42dcbe76ced81a2b9438158c09fa5 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 08:34:56 +0900 Subject: [PATCH 34/75] fix commented step name --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 117b1e85bf..0478fc70d1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -121,7 +121,8 @@ jobs: # shell: bash # run: | # echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt - # - uses: actions/cache@master + # - name: Cache VOICEVOX ENGINE + # uses: actions/cache@master # id: voicevox-engine-cache # with: # path: voicevox_engine/download From 040479902fafb278ed9b3c7bdb0cc32aec965157 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 08:43:09 +0900 Subject: [PATCH 35/75] build on push main --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0478fc70d1..2bd6d4ef9d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build on: push: branches: - - master + - main release: types: - created From 7d54077589b8034bf7fd842e66e6aa92abec00de Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 09:08:25 +0900 Subject: [PATCH 36/75] revert removeOriginalEngine diff --- build/afterNsisWebArtifactBuild.js | 8 -------- build/removeOriginalEngine.js | 9 --------- 2 files changed, 17 deletions(-) delete mode 100644 build/removeOriginalEngine.js diff --git a/build/afterNsisWebArtifactBuild.js b/build/afterNsisWebArtifactBuild.js index cedd163beb..3de69c510e 100644 --- a/build/afterNsisWebArtifactBuild.js +++ b/build/afterNsisWebArtifactBuild.js @@ -1,15 +1,7 @@ /* eslint-disable @typescript-eslint/no-var-requires */ const splitNsisArchive = require("./splitNsisArchive").default; -const removeOriginalEngine = require("./removeOriginalEngine").default; - -const process = require("process"); -const REMOVE_ORIGINAL_ENGINE = process.env.ORIGINAL_ENGINE_DIR_TO_REMOVE != null; // target: electron-builder.Target exports.default = async function (target) { - if (REMOVE_ORIGINAL_ENGINE) { - await removeOriginalEngine(target); - } - await splitNsisArchive(target); }; diff --git a/build/removeOriginalEngine.js b/build/removeOriginalEngine.js deleted file mode 100644 index e05e65771b..0000000000 --- a/build/removeOriginalEngine.js +++ /dev/null @@ -1,9 +0,0 @@ -/* eslint-disable @typescript-eslint/no-var-requires */ -const fs = require("fs"); - -const ORIGINAL_ENGINE_DIR_TO_REMOVE = process.env.ORIGINAL_ENGINE_DIR_TO_REMOVE; - -// target: electron-builder.Target -exports.default = async function (target) { - fs.rmdirSync(ORIGINAL_ENGINE_DIR_TO_REMOVE, { recursive: true }); -}; From 09e5dea48b35b120304f9c4fd5bbca3fd4b23a44 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 09:13:23 +0900 Subject: [PATCH 37/75] temporary use Hiroshiba/voicevox_engine check-2021-09-25 --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2bd6d4ef9d..49a1b7e67f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,11 +83,11 @@ jobs: build-engine-prepackage: needs: [build-noengine-prepackage] env: - VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" + VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine" strategy: fail-fast: false matrix: - voicevox_engine_version: [0.5.2-aoirint-57] + voicevox_engine_version: [check-2021-09-25] artifact_name: - windows-cpu-prepackage - windows-nvidia-prepackage From cec9dd933fd331b0cd2ab3e521a6072f2ecf752c Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 09:19:22 +0900 Subject: [PATCH 38/75] use env to define voicevox engine repo/ver --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 49a1b7e67f..070e7fe067 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -8,6 +8,10 @@ on: types: - created +env: + VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine" + VOICEVOX_ENGINE_VERSION: check-2021-09-25 + jobs: build-noengine-prepackage: env: @@ -82,12 +86,13 @@ jobs: build-engine-prepackage: needs: [build-noengine-prepackage] - env: - VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine" strategy: fail-fast: false matrix: - voicevox_engine_version: [check-2021-09-25] + voicevox_engine_repo_url: + - ${{ env.VOICEVOX_ENGINE_REPO_URL }} + voicevox_engine_version: + - ${{ env.VOICEVOX_ENGINE_VERSION }} artifact_name: - windows-cpu-prepackage - windows-nvidia-prepackage @@ -120,7 +125,7 @@ jobs: # - name: Dump VOICEVOX ENGINE repo URL to calc hash # shell: bash # run: | - # echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt + # echo "${{ matrix.voicevox_engine_repo_url }}" > voicevox_engine/repo_url.txt # - name: Cache VOICEVOX ENGINE # uses: actions/cache@master # id: voicevox-engine-cache @@ -132,7 +137,7 @@ jobs: # if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' shell: bash env: - VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ matrix.voicevox_engine_version }} + VOICEVOX_ENGINE_RELEASE_URL: ${{ matrix.voicevox_engine_repo_url }}/releases/download/${{ matrix.voicevox_engine_version }} run: | curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_asset_name }}.7z.txt" cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" From 557036c1bb18336587839967b9f05b1f36c884b9 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 09:28:00 +0900 Subject: [PATCH 39/75] use env directly (env cannot be used in matrix) --- .github/workflows/build.yml | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 070e7fe067..10f126a8db 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -89,10 +89,11 @@ jobs: strategy: fail-fast: false matrix: - voicevox_engine_repo_url: - - ${{ env.VOICEVOX_ENGINE_REPO_URL }} - voicevox_engine_version: - - ${{ env.VOICEVOX_ENGINE_VERSION }} + # FIXME: env cannot be referenced in matrix + # voicevox_engine_repo_url: + # - ${{ env.VOICEVOX_ENGINE_REPO_URL }} + # voicevox_engine_version: + # - ${{ env.VOICEVOX_ENGINE_VERSION }} artifact_name: - windows-cpu-prepackage - windows-nvidia-prepackage @@ -125,19 +126,19 @@ jobs: # - name: Dump VOICEVOX ENGINE repo URL to calc hash # shell: bash # run: | - # echo "${{ matrix.voicevox_engine_repo_url }}" > voicevox_engine/repo_url.txt + # echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt # - name: Cache VOICEVOX ENGINE # uses: actions/cache@master # id: voicevox-engine-cache # with: # path: voicevox_engine/download - # key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ matrix.voicevox_engine_version }} + # key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ env.VOICEVOX_ENGINE_VERSION }} - name: Download VOICEVOX ENGINE # if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' shell: bash env: - VOICEVOX_ENGINE_RELEASE_URL: ${{ matrix.voicevox_engine_repo_url }}/releases/download/${{ matrix.voicevox_engine_version }} + VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ env.VOICEVOX_ENGINE_VERSION }} run: | curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_asset_name }}.7z.txt" cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" From 90f38af9218df1d0babe3f1920f8c573796ddb01 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 09:34:22 +0900 Subject: [PATCH 40/75] add noengine-prepackage name and path in matrix --- .github/workflows/build.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 10f126a8db..089ace1f78 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -22,7 +22,12 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019] + artifact_name: + - windows-noengine-prepackage + include: + - artifact_name: windows-noengine-prepackage + artifact_path: dist_electron/win-unpacked + os: windows-2019 runs-on: ${{ matrix.os }} steps: @@ -71,17 +76,17 @@ jobs: run: | df -h + # Build result will be exported to ${{ matrix.artifact_path }} - name: Build Electron shell: bash run: npm run electron:build_pnever -- --dir - - name: Upload Windows NoEngine Prepackage - if: startsWith(matrix.os, 'windows-') + - name: Upload NoEngine Prepackage uses: actions/upload-artifact@v2 with: - name: windows-noengine-prepackage + name: ${{ matrix.artifact_name }} path: | - dist_electron/win-unpacked + ${{ matrix.artifact_path }} build-engine-prepackage: From 5e4462737afbb6d6f01ba3e409f4a89667182c87 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 17:06:16 +0900 Subject: [PATCH 41/75] windows build-workflow diff --- .github/workflows/build.yml | 296 ++++++++++++++++++++++++++++++++++++ 1 file changed, 296 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000000..089ace1f78 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,296 @@ + +name: build +on: + push: + branches: + - main + release: + types: + - created + +env: + VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine" + VOICEVOX_ENGINE_VERSION: check-2021-09-25 + +jobs: + build-noengine-prepackage: + env: + CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache + ELECTRON_CACHE: .cache/electron + ELECTRON_BUILDER_CACHE: .cache/electron-builder + cache-version: v2 + strategy: + fail-fast: false + matrix: + artifact_name: + - windows-noengine-prepackage + include: + - artifact_name: windows-noengine-prepackage + artifact_path: dist_electron/win-unpacked + os: windows-2019 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Set output Node version + id: node-version + shell: bash + run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" + + - name: Setup Node + uses: actions/setup-node@master + with: + node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" + + - name: Cache Node packages + uses: actions/cache@master + with: + path: ~/.npm + key: ${{ env.cache-version }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-node- + + - name: Cache Electron + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-cache- + + - name: Cache Electron-Builder + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_BUILDER_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache- + + - name: Install dependencies + shell: bash + run: npm ci + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + # Build result will be exported to ${{ matrix.artifact_path }} + - name: Build Electron + shell: bash + run: npm run electron:build_pnever -- --dir + + - name: Upload NoEngine Prepackage + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: | + ${{ matrix.artifact_path }} + + + build-engine-prepackage: + needs: [build-noengine-prepackage] + strategy: + fail-fast: false + matrix: + # FIXME: env cannot be referenced in matrix + # voicevox_engine_repo_url: + # - ${{ env.VOICEVOX_ENGINE_REPO_URL }} + # voicevox_engine_version: + # - ${{ env.VOICEVOX_ENGINE_VERSION }} + artifact_name: + - windows-cpu-prepackage + - windows-nvidia-prepackage + include: + - artifact_name: windows-cpu-prepackage + noengine_artifact_name: windows-noengine-prepackage + voicevox_engine_asset_name: windows-cpu + os: windows-2019 + - artifact_name: windows-nvidia-prepackage + noengine_artifact_name: windows-noengine-prepackage + voicevox_engine_asset_name: windows-nvidia + os: windows-2019 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Download and extract noengine-prepackage artifact + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.noengine_artifact_name }} + path: ./prepackage + + # Download VOICEVOX ENGINE + - name: Create directory voicevox_engine/download + shell: bash + run: | + mkdir -p voicevox_engine/download + + # - name: Dump VOICEVOX ENGINE repo URL to calc hash + # shell: bash + # run: | + # echo "${{ env.VOICEVOX_ENGINE_REPO_URL }}" > voicevox_engine/repo_url.txt + # - name: Cache VOICEVOX ENGINE + # uses: actions/cache@master + # id: voicevox-engine-cache + # with: + # path: voicevox_engine/download + # key: ${{ env.cache-version }}-voicevox-engine-${{ hashFiles('voicevox_engine/repo_url.txt') }}-${{ env.VOICEVOX_ENGINE_VERSION }} + + - name: Download VOICEVOX ENGINE + # if: steps.voicevox-engine-cache.outputs.cache-hit != 'true' + shell: bash + env: + VOICEVOX_ENGINE_RELEASE_URL: ${{ env.VOICEVOX_ENGINE_REPO_URL }}/releases/download/${{ env.VOICEVOX_ENGINE_VERSION }} + run: | + curl -L -o "voicevox_engine/download/list.txt" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/${{ matrix.voicevox_engine_asset_name }}.7z.txt" + cat "voicevox_engine/download/list.txt" | xargs -I '%' curl -L -o "voicevox_engine/download/%" "${{ env.VOICEVOX_ENGINE_RELEASE_URL }}/%" + + - name: Extract VOICEVOX ENGINE + shell: bash + run: | + # Extract first file to extract all parts + # Destination: voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/ + 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + + # remove downloads to free space + rm -rf voicevox_engine/download + + - name: Merge VOICEVOX ENGINE into prepackage/ + shell: bash + run: | + mv voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/* prepackage/ + rm -rf voicevox_engine + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + - name: Upload prepackage artifact + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: | + prepackage/ + + + build-distributable: + if: github.event.release.tag_name != '' # If release + needs: [build-engine-prepackage] + env: + CYPRESS_CACHE_FOLDER: ~/.npm/cypress_cache + ELECTRON_CACHE: .cache/electron + ELECTRON_BUILDER_CACHE: .cache/electron-builder + cache-version: v2 + strategy: + fail-fast: false + matrix: + artifact_name: + # - windows-cpu-nsis-web + - windows-nvidia-nsis-web + include: + # - artifact_name: windows-cpu-nsis-web + # engine_artifact_name: windows-cpu-prepackage + # os: windows-2019 + - artifact_name: windows-nvidia-nsis-web + engine_artifact_name: windows-nvidia-prepackage + os: windows-2019 + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Download and extract engine-prepackage artifact + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.engine_artifact_name }} + path: ./prepackage + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + - name: Set output Node version + id: node-version + shell: bash + run: echo "::set-output name=NODE_VERSION::$(cat .node-version)" + + - name: Setup Node + uses: actions/setup-node@master + with: + node-version: "${{ steps.node-version.outputs.NODE_VERSION }}" + + - name: Cache Node packages + uses: actions/cache@master + with: + path: ~/.npm + key: ${{ env.cache-version }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-node- + + - name: Cache Electron + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-cache- + + - name: Cache Electron-Builder + uses: actions/cache@master + with: + path: ${{ env.ELECTRON_BUILDER_CACHE }} + key: ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ env.cache-version }}-${{ runner.os }}--electron-builder-cache- + + - name: Install dependencies + shell: bash + run: npm ci + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + # NOTE: prepackage can be removed before splitting nsis-web archive + - name: Build Electron + shell: bash + run: npm run electron:build_pnever -- --prepackaged "prepackage/" + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + - name: Upload Windows nsis-web artifact + if: endsWith(matrix.artifact_name, '-nsis-web') + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: | + dist_electron/nsis-web/out/*.7z.* + dist_electron/nsis-web/*.exe + + # FIXME: rename archives and installer before upload to separate cpu, gpu distribution + - name: Upload Windows nsis-web archives to Release assets + if: endsWith(matrix.artifact_name, '-nsis-web') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} # == github.event.release.tag_name + file_glob: true + file: dist_electron/nsis-web/out/*.7z.* + + - name: Upload Windows nsis-web installer to Release assets + if: endsWith(matrix.artifact_name, '-nsis-web') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} # == github.event.release.tag_name + file_glob: true + file: dist_electron/nsis-web/*.exe From 329ed75b840bbe52cee8d3fe4c14bd736342bf12 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 25 Sep 2021 06:49:15 +0900 Subject: [PATCH 42/75] add linux appimage build config --- vue.config.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/vue.config.js b/vue.config.js index 669d091ed2..2796d9b530 100644 --- a/vue.config.js +++ b/vue.config.js @@ -59,6 +59,16 @@ module.exports = { repo: "voicevox", vPrefixedTagName: false, }, + linux: { + icon: "public/icon.png", + category: "AudioVideo", + target: [ + { + target: "AppImage", + arch: ["x64"], + }, + ], + }, }, }, }, From b5740d9f3f0c55a7806fb4c9bd0ca18caea16f66 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 11:41:46 +0900 Subject: [PATCH 43/75] add linux matrix --- .github/workflows/build.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 089ace1f78..df8f9380f2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -23,8 +23,12 @@ jobs: fail-fast: false matrix: artifact_name: + - linux-noengine-prepackage - windows-noengine-prepackage include: + - artifact_name: linux-noengine-prepackage + artifact_path: dist_electron/linux-unpacked + os: ubuntu-18.04 - artifact_name: windows-noengine-prepackage artifact_path: dist_electron/win-unpacked os: windows-2019 @@ -100,9 +104,19 @@ jobs: # voicevox_engine_version: # - ${{ env.VOICEVOX_ENGINE_VERSION }} artifact_name: + - linux-cpu-appimage + - linux-nvidia-appimage - windows-cpu-prepackage - windows-nvidia-prepackage include: + - artifact_name: linux-cpu-appimage + noengine_artifact_name: linux-noengine-prepackage + voicevox_engine_asset_name: linux-cpu + os: ubuntu-18.04 + - artifact_name: linux-nvidia-appimage + noengine_artifact_name: linux-noengine-prepackage + voicevox_engine_asset_name: linux-nvidia + os: ubuntu-18.04 - artifact_name: windows-cpu-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-cpu From ade5ec32de1c04eaba6a2aa45be37629c6590f9e Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 11:42:38 +0900 Subject: [PATCH 44/75] overwrite .env.production for linux --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index df8f9380f2..27eb7d3f7e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -80,6 +80,13 @@ jobs: run: | df -h + - name: Overwrite .env.production for Linux + if: startsWith(matrix.os, 'ubuntu-') + shell: bash + run: | + echo "ENGINE_PATH=./run" > .env.production + echo "VUE_APP_ENGINE_URL=http://127.0.0.1:50021" >> .env.production + # Build result will be exported to ${{ matrix.artifact_path }} - name: Build Electron shell: bash From af7d55f5418fc95211ec9a4fc40c1b672597e53d Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 11:46:40 +0900 Subject: [PATCH 45/75] appimage build --- .github/workflows/build.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 27eb7d3f7e..fe54903a62 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -210,9 +210,17 @@ jobs: fail-fast: false matrix: artifact_name: + - linux-cpu-appimage + - linux-nvidia-appimage # - windows-cpu-nsis-web - windows-nvidia-nsis-web include: + - artifact_name: linux-cpu-appimage + engine_artifact_name: linux-cpu-prepackage + os: ubuntu-18.04 + - artifact_name: linux-nvidia-appimage + engine_artifact_name: linux-nvidia-prepackage + os: ubuntu-18.04 # - artifact_name: windows-cpu-nsis-web # engine_artifact_name: windows-cpu-prepackage # os: windows-2019 @@ -288,6 +296,14 @@ jobs: run: | df -h + - name: Upload Linux AppImage artifact + if: endsWith(matrix.artifact_name, '-appimage') + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: | + dist_electron/*.AppImage + - name: Upload Windows nsis-web artifact if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 From 136052f221a217fe312b1ed90813f0a929160f22 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 18:50:49 +0900 Subject: [PATCH 46/75] upload linux appimage to release as splitted archives --- .github/workflows/build.yml | 78 +++++++++++++++++++++++++++++++++++-- 1 file changed, 75 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fe54903a62..8d94e08611 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -304,7 +304,7 @@ jobs: path: | dist_electron/*.AppImage - - name: Upload Windows nsis-web artifact + - name: Upload Windows NSIS Web artifact if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 with: @@ -313,6 +313,78 @@ jobs: dist_electron/nsis-web/out/*.7z.* dist_electron/nsis-web/*.exe + + upload-distributable-to-release: + if: github.event.release.tag_name != '' # If release + needs: [build-distributable] + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04] + artifact_name: + - linux-cpu-appimage + - linux-nvidia-appimage + # - windows-cpu-nsis-web + - windows-nvidia-nsis-web + include: + - artifact_name: linux-cpu-appimage + - artifact_name: linux-nvidia-appimage + # - artifact_name: windows-cpu-nsis-web + - artifact_name: windows-nvidia-nsis-web + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Download and extract distributable artifact + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: ./artifact + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + # Linux AppImage + - name: Install dependencies for Linux AppImage Upload + if: endsWith(matrix.artifact_name, '-appimage') + shell: bash + run: | + sudo apt-get update + sudo apt-get install -y p7zip-full + + - name: Split AppImage artifact + if: endsWith(matrix.artifact_name, '-appimage') + shell: bash + run: | + for appImageFile in artifact/*.AppImage; do + # compressed to artifact/myartifact.AppImage.7z.001, artifact/myartifact.AppImage.7z.002, ... + 7z -v1g a "${appImageFile}.7z" "${appImageFile}" + + # Output splitted archive list to artifact/myartifact.7z.txt + ls ${{ matrix.artifact_name }}.7z.* > archives.txt + mv archives.txt "${{ matrix.artifact_name }}.7z.txt" + done + + - name: Show disk space (debug info) + if: endsWith(matrix.artifact_name, '-appimage') + shell: bash + run: | + df -h + + - name: Upload Linux AppImage splitted archives to Release assets + if: endsWith(matrix.artifact_name, '-appimage') + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + tag: ${{ github.ref }} # == github.event.release.tag_name + file_glob: true + file: artifact/*.7z.* + + + # Windows NSIS Web # FIXME: rename archives and installer before upload to separate cpu, gpu distribution - name: Upload Windows nsis-web archives to Release assets if: endsWith(matrix.artifact_name, '-nsis-web') @@ -321,7 +393,7 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} # == github.event.release.tag_name file_glob: true - file: dist_electron/nsis-web/out/*.7z.* + file: artifact/out/*.7z.* - name: Upload Windows nsis-web installer to Release assets if: endsWith(matrix.artifact_name, '-nsis-web') @@ -330,4 +402,4 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} # == github.event.release.tag_name file_glob: true - file: dist_electron/nsis-web/*.exe + file: artifact/*.exe From e2fa3b6ab5566fe1cfc4538b79f76067698522cb Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 18:55:05 +0900 Subject: [PATCH 47/75] fix listing --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8d94e08611..22919e64f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -360,12 +360,12 @@ jobs: shell: bash run: | for appImageFile in artifact/*.AppImage; do - # compressed to artifact/myartifact.AppImage.7z.001, artifact/myartifact.AppImage.7z.002, ... + # compressed to artifact/MyArtifact.AppImage.7z.001, artifact/MyArtifact.AppImage.7z.002, ... 7z -v1g a "${appImageFile}.7z" "${appImageFile}" # Output splitted archive list to artifact/myartifact.7z.txt - ls ${{ matrix.artifact_name }}.7z.* > archives.txt - mv archives.txt "${{ matrix.artifact_name }}.7z.txt" + ls ${appImageFile}.7z.* > archives.txt + mv archives.txt "artifact/${{ matrix.artifact_name }}.7z.txt" done - name: Show disk space (debug info) From 4bea3d434ccb126ec2405760bac20ea0dde39e7c Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 21:25:07 +0900 Subject: [PATCH 48/75] fix engine-prepackage artifact name --- .github/workflows/build.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22919e64f6..d744864953 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -111,16 +111,16 @@ jobs: # voicevox_engine_version: # - ${{ env.VOICEVOX_ENGINE_VERSION }} artifact_name: - - linux-cpu-appimage - - linux-nvidia-appimage + - linux-cpu-prepackage + - linux-nvidia-prepackage - windows-cpu-prepackage - windows-nvidia-prepackage include: - - artifact_name: linux-cpu-appimage + - artifact_name: linux-cpu-prepackage noengine_artifact_name: linux-noengine-prepackage voicevox_engine_asset_name: linux-cpu os: ubuntu-18.04 - - artifact_name: linux-nvidia-appimage + - artifact_name: linux-nvidia-prepackage noengine_artifact_name: linux-noengine-prepackage voicevox_engine_asset_name: linux-nvidia os: ubuntu-18.04 From 2bfe4387d77fcaa7a5c495e1755ef2e9e19261d5 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 22:23:22 +0900 Subject: [PATCH 49/75] split log --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d744864953..0a1d1cca10 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -360,6 +360,8 @@ jobs: shell: bash run: | for appImageFile in artifact/*.AppImage; do + echo "Splitting ${appImageFile}" + # compressed to artifact/MyArtifact.AppImage.7z.001, artifact/MyArtifact.AppImage.7z.002, ... 7z -v1g a "${appImageFile}.7z" "${appImageFile}" From 358849130310dfa3ede40bfc5ceee430e4cb9bee Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 22:45:41 +0900 Subject: [PATCH 50/75] recover file permissions before packaging to AppImage --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0a1d1cca10..c87f56d65f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -185,6 +185,13 @@ jobs: mv voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/* prepackage/ rm -rf voicevox_engine + - name: Recover file permissions + if: startsWith(matrix.artifact_name, 'linux-') + shell: bash + run: | + chmod +x prepackage/voicevox + chmod +x prepackage/run + - name: Show disk space (debug info) shell: bash run: | From 2b3c75a211b0d41bbbabd38c3ee37b6586e4edb0 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 22:46:41 +0900 Subject: [PATCH 51/75] remove artifact dir layer in asset --- .github/workflows/build.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c87f56d65f..87a7e3f1d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -366,15 +366,17 @@ jobs: if: endsWith(matrix.artifact_name, '-appimage') shell: bash run: | - for appImageFile in artifact/*.AppImage; do + cd artifact/ + + for appImageFile in *.AppImage; do echo "Splitting ${appImageFile}" - # compressed to artifact/MyArtifact.AppImage.7z.001, artifact/MyArtifact.AppImage.7z.002, ... + # compressed to MyArtifact.AppImage.7z.001, MyArtifact.AppImage.7z.002, ... 7z -v1g a "${appImageFile}.7z" "${appImageFile}" - # Output splitted archive list to artifact/myartifact.7z.txt + # Output splitted archive list to myartifact.7z.txt ls ${appImageFile}.7z.* > archives.txt - mv archives.txt "artifact/${{ matrix.artifact_name }}.7z.txt" + mv archives.txt "${{ matrix.artifact_name }}.7z.txt" done - name: Show disk space (debug info) From a30719a87bc400603ec28de45f5a1f66c03ccd1b Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 22:47:22 +0900 Subject: [PATCH 52/75] remove linux cpu asset --- .github/workflows/build.yml | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87a7e3f1d9..5178c18827 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -217,14 +217,14 @@ jobs: fail-fast: false matrix: artifact_name: - - linux-cpu-appimage + # - linux-cpu-appimage - linux-nvidia-appimage # - windows-cpu-nsis-web - windows-nvidia-nsis-web include: - - artifact_name: linux-cpu-appimage - engine_artifact_name: linux-cpu-prepackage - os: ubuntu-18.04 + # - artifact_name: linux-cpu-appimage + # engine_artifact_name: linux-cpu-prepackage + # os: ubuntu-18.04 - artifact_name: linux-nvidia-appimage engine_artifact_name: linux-nvidia-prepackage os: ubuntu-18.04 @@ -329,12 +329,12 @@ jobs: matrix: os: [ubuntu-18.04] artifact_name: - - linux-cpu-appimage + # - linux-cpu-appimage - linux-nvidia-appimage # - windows-cpu-nsis-web - windows-nvidia-nsis-web include: - - artifact_name: linux-cpu-appimage + # - artifact_name: linux-cpu-appimage - artifact_name: linux-nvidia-appimage # - artifact_name: windows-cpu-nsis-web - artifact_name: windows-nvidia-nsis-web @@ -394,7 +394,6 @@ jobs: file_glob: true file: artifact/*.7z.* - # Windows NSIS Web # FIXME: rename archives and installer before upload to separate cpu, gpu distribution - name: Upload Windows nsis-web archives to Release assets From abf79aaf0346083888318b4efe741a9605e16312 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 23:03:49 +0900 Subject: [PATCH 53/75] fix recover file permissions --- .github/workflows/build.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5178c18827..3d781d1ad0 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -185,13 +185,6 @@ jobs: mv voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/* prepackage/ rm -rf voicevox_engine - - name: Recover file permissions - if: startsWith(matrix.artifact_name, 'linux-') - shell: bash - run: | - chmod +x prepackage/voicevox - chmod +x prepackage/run - - name: Show disk space (debug info) shell: bash run: | @@ -245,6 +238,13 @@ jobs: name: ${{ matrix.engine_artifact_name }} path: ./prepackage + - name: Recover file permissions + if: endsWith(matrix.artifact_name, '-appimage') # linux + shell: bash + run: | + chmod +x prepackage/voicevox + chmod +x prepackage/run + - name: Show disk space (debug info) shell: bash run: | From 43ca78543958fa74ab7ee187db8013db15daa951 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 26 Sep 2021 09:34:22 +0900 Subject: [PATCH 54/75] impl upload-distributable-to-release --- .github/workflows/build.yml | 37 ++++++++++++++++++++++++++++++++++--- 1 file changed, 34 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 089ace1f78..4b62cdd1ca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -267,7 +267,7 @@ jobs: run: | df -h - - name: Upload Windows nsis-web artifact + - name: Upload Windows NSIS Web artifact if: endsWith(matrix.artifact_name, '-nsis-web') uses: actions/upload-artifact@v2 with: @@ -276,6 +276,37 @@ jobs: dist_electron/nsis-web/out/*.7z.* dist_electron/nsis-web/*.exe + + upload-distributable-to-release: + if: github.event.release.tag_name != '' # If release + needs: [build-distributable] + strategy: + fail-fast: false + matrix: + os: [ubuntu-18.04] + artifact_name: + # - windows-cpu-nsis-web + - windows-nvidia-nsis-web + include: + # - artifact_name: windows-cpu-nsis-web + - artifact_name: windows-nvidia-nsis-web + + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@master + + - name: Download and extract distributable artifact + uses: actions/download-artifact@v2 + with: + name: ${{ matrix.artifact_name }} + path: ./artifact + + - name: Show disk space (debug info) + shell: bash + run: | + df -h + + # Windows NSIS Web # FIXME: rename archives and installer before upload to separate cpu, gpu distribution - name: Upload Windows nsis-web archives to Release assets if: endsWith(matrix.artifact_name, '-nsis-web') @@ -284,7 +315,7 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} # == github.event.release.tag_name file_glob: true - file: dist_electron/nsis-web/out/*.7z.* + file: artifact/out/*.7z.* - name: Upload Windows nsis-web installer to Release assets if: endsWith(matrix.artifact_name, '-nsis-web') @@ -293,4 +324,4 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} tag: ${{ github.ref }} # == github.event.release.tag_name file_glob: true - file: dist_electron/nsis-web/*.exe + file: artifact/*.exe From ad793f9c05b13b9b06bada6b257b518d91a31ee5 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 05:03:23 +0900 Subject: [PATCH 55/75] generate public/licenses.json --- .github/workflows/build.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4b62cdd1ca..602e21667b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build on: push: branches: - - main + # - main release: types: - created @@ -71,6 +71,10 @@ jobs: shell: bash run: npm ci + - name: Generate public/licenses.json + shell: bash + run: npm run license:generate -- -o public/licenses.json + - name: Show disk space (debug info) shell: bash run: | From 594bb0754108b0c9f28a4597e968bf0365d05909 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 05:29:32 +0900 Subject: [PATCH 56/75] ci licenses.json --- .github/workflows/build.yml | 40 ++++++++++++++++++++++++++++++------- 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 602e21667b..d29516dd28 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,7 @@ name: build on: push: branches: - # - main + - main release: types: - created @@ -110,16 +110,24 @@ jobs: - artifact_name: windows-cpu-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-cpu - os: windows-2019 + os: ubuntu-18.04 - artifact_name: windows-nvidia-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-nvidia - os: windows-2019 + os: ubuntu-18.04 runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@master + - name: Setup Node 14.x + uses: actions/setup-node@v1 + with: + node-version: 14 + + - name: Install asar + run: npm install -g asar + - name: Download and extract noengine-prepackage artifact uses: actions/download-artifact@v2 with: @@ -155,17 +163,35 @@ jobs: - name: Extract VOICEVOX ENGINE shell: bash run: | + mkdir -p voicevox_engine/tmp + # Extract first file to extract all parts - # Destination: voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/ - 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/ + # Destination: voicevox_engine/tmp/${{ matrix.voicevox_engine_asset_name }}/ + 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/tmp/ + + mv voicevox_engine/tmp/${{ matrix.voicevox_engine_asset_name }}/* voicevox_engine/voicevox_engine # remove downloads to free space - rm -rf voicevox_engine/download + rm -rf voicevox_engine/download voicevox_engine/tmp + + - name: Merge licenses.json (ENGINE, VOICEVOX) + shell: bash + run: | + # Unpack asar + asar extract prepackage/resources/app.asar prepackage/resources/app + rm prepackage/resources/app.asar + + mv voicevox_engine/voicevox_engine/licenses.json engine_licenses.json + npm run license:merge -- -o prepackage/resources/app/licenses.json -i engine_licenses.json -i prepackage/resources/app/licenses.json + + # Repack asar + asar pack prepackage/resources/app prepackage/resources/app.asar + rm -rf prepackage/resources/app - name: Merge VOICEVOX ENGINE into prepackage/ shell: bash run: | - mv voicevox_engine/${{ matrix.voicevox_engine_asset_name }}/* prepackage/ + mv voicevox_engine/voicevox_engine/* prepackage/ rm -rf voicevox_engine - name: Show disk space (debug info) From c375eefe46d5620594e970a3952b273df5341375 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 06:12:54 +0900 Subject: [PATCH 57/75] mkdir --- .github/workflows/build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d29516dd28..ee3fb5e255 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -169,6 +169,7 @@ jobs: # Destination: voicevox_engine/tmp/${{ matrix.voicevox_engine_asset_name }}/ 7z x "voicevox_engine/download/$(cat voicevox_engine/download/list.txt | head -n1)" -ovoicevox_engine/tmp/ + mkdir -p voicevox_engine/voicevox_engine mv voicevox_engine/tmp/${{ matrix.voicevox_engine_asset_name }}/* voicevox_engine/voicevox_engine # remove downloads to free space From ec464fe83b1b0fc5983e3dd2995ee78bcc9981a3 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 06:01:22 +0900 Subject: [PATCH 58/75] engine --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ee3fb5e255..4820816e44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,8 @@ on: - created env: - VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine" - VOICEVOX_ENGINE_VERSION: check-2021-09-25 + VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" + VOICEVOX_ENGINE_VERSION: 0.5.2-aoirint-60 jobs: build-noengine-prepackage: From d0b106532e259e6c2176c61e73737299cfa68407 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 09:12:08 +0900 Subject: [PATCH 59/75] Update build.yml --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4820816e44..6a923c8237 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ on: env: VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" - VOICEVOX_ENGINE_VERSION: 0.5.2-aoirint-60 + VOICEVOX_ENGINE_VERSION: 0.6.0-aoirint-1 jobs: build-noengine-prepackage: From 3ef101f1777a84ee6b2ef9d7185aa5bdc0578b5c Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 09:39:48 +0900 Subject: [PATCH 60/75] npm ci --- .github/workflows/build.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6a923c8237..eb3c428b25 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -128,6 +128,10 @@ jobs: - name: Install asar run: npm install -g asar + - name: Install dependencies + shell: bash + run: npm ci + - name: Download and extract noengine-prepackage artifact uses: actions/download-artifact@v2 with: From a9aad8493f6ee0ab3cc7c448ae9512f10d65a41f Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 12:53:04 +0900 Subject: [PATCH 61/75] license: use packageName if name is undefined --- build/generateLicenses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generateLicenses.js b/build/generateLicenses.js index ce33e1018e..d5a2780d22 100644 --- a/build/generateLicenses.js +++ b/build/generateLicenses.js @@ -38,7 +38,7 @@ const licenseJson = execSync( const checkerLicenses = JSON.parse(licenseJson); const licenses = Object.entries(checkerLicenses).map(([packageName, license]) => ({ - name: license.name, + name: license.name ?? packageName, version: license.version, license: license.licenses, text: license.licenseText, From 94b877aecdef14e69097df3020ba07b63e439a21 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 13:28:54 +0900 Subject: [PATCH 62/75] revert packageName substitution --- build/generateLicenses.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build/generateLicenses.js b/build/generateLicenses.js index d5a2780d22..ce33e1018e 100644 --- a/build/generateLicenses.js +++ b/build/generateLicenses.js @@ -38,7 +38,7 @@ const licenseJson = execSync( const checkerLicenses = JSON.parse(licenseJson); const licenses = Object.entries(checkerLicenses).map(([packageName, license]) => ({ - name: license.name ?? packageName, + name: license.name, version: license.version, license: license.licenses, text: license.licenseText, From dc1731c82b50a252a0f5aea95d4426cf64f2b6c7 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 13:35:32 +0900 Subject: [PATCH 63/75] skip uploading to release --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb3c428b25..563824dbca 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -313,7 +313,7 @@ jobs: upload-distributable-to-release: - if: github.event.release.tag_name != '' # If release + if: false && github.event.release.tag_name != '' # If release needs: [build-distributable] strategy: fail-fast: false From 74e7184b218a86e85545567af0ae64f74d3306e1 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 13:39:42 +0900 Subject: [PATCH 64/75] parentheses --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 563824dbca..0b2caab045 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -313,7 +313,7 @@ jobs: upload-distributable-to-release: - if: false && github.event.release.tag_name != '' # If release + if: false && (github.event.release.tag_name != '') # If release needs: [build-distributable] strategy: fail-fast: false From 97971e31dbea44c8bd187e092bad7b9d973f79cc Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 13:43:07 +0900 Subject: [PATCH 65/75] add comment --- .github/workflows/build.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0b2caab045..d5183a361c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -311,7 +311,8 @@ jobs: dist_electron/nsis-web/out/*.7z.* dist_electron/nsis-web/*.exe - + # FIXME: build with production resources in Hiroshiba/voicevox + # Temporarily, skip uploading to GitHub Release (use Artifact instead) upload-distributable-to-release: if: false && (github.event.release.tag_name != '') # If release needs: [build-distributable] From 2d19495d7027a7f11ca7344c7d1cbc549f0fbc99 Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 14:03:27 +0900 Subject: [PATCH 66/75] env SKIP_UPLOADING_RELEASE_ASSET --- .github/workflows/build.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d5183a361c..9df7575395 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,10 @@ env: VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" VOICEVOX_ENGINE_VERSION: 0.6.0-aoirint-1 + # FIXME: implement build with production resources in Hiroshiba/voicevox + # Temporarily, skip uploading to GitHub Release (use Artifact instead) + SKIP_UPLOADING_RELEASE_ASSET: 1 + jobs: build-noengine-prepackage: env: @@ -311,10 +315,9 @@ jobs: dist_electron/nsis-web/out/*.7z.* dist_electron/nsis-web/*.exe - # FIXME: build with production resources in Hiroshiba/voicevox - # Temporarily, skip uploading to GitHub Release (use Artifact instead) + upload-distributable-to-release: - if: false && (github.event.release.tag_name != '') # If release + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' # If release needs: [build-distributable] strategy: fail-fast: false From 4267fc244620d8d357aca617a89b096588c60e8c Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 14:04:12 +0900 Subject: [PATCH 67/75] commonize os matrix --- .github/workflows/build.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9df7575395..27f2ec04d9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -107,6 +107,7 @@ jobs: # - ${{ env.VOICEVOX_ENGINE_REPO_URL }} # voicevox_engine_version: # - ${{ env.VOICEVOX_ENGINE_VERSION }} + os: [ubuntu-18.04] artifact_name: - windows-cpu-prepackage - windows-nvidia-prepackage @@ -114,11 +115,9 @@ jobs: - artifact_name: windows-cpu-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-cpu - os: ubuntu-18.04 - artifact_name: windows-nvidia-prepackage noengine_artifact_name: windows-noengine-prepackage voicevox_engine_asset_name: windows-nvidia - os: ubuntu-18.04 runs-on: ${{ matrix.os }} steps: From 1ae84f19f3db58cad1fa159f188fe1dca056347d Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 14:07:48 +0900 Subject: [PATCH 68/75] temporarily upload splitted appimage to artifact --- .github/workflows/build.yml | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f31ed82db0..110bf133ac 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -365,7 +365,7 @@ jobs: upload-distributable-to-release: - if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && github.event.release.tag_name != '' # If release + if: github.event.release.tag_name != '' # If release needs: [build-distributable] strategy: fail-fast: false @@ -428,8 +428,16 @@ jobs: run: | df -h + - name: Upload Linux AppImage Release artifact + if: env.SKIP_UPLOADING_RELEASE_ASSET == '1' && endsWith(matrix.artifact_name, '-appimage') + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-release + path: | + artifact/*.7z.* + - name: Upload Linux AppImage splitted archives to Release assets - if: endsWith(matrix.artifact_name, '-appimage') + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && endsWith(matrix.artifact_name, '-appimage') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -440,7 +448,7 @@ jobs: # Windows NSIS Web # FIXME: rename archives and installer before upload to separate cpu, gpu distribution - name: Upload Windows nsis-web archives to Release assets - if: endsWith(matrix.artifact_name, '-nsis-web') + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && endsWith(matrix.artifact_name, '-nsis-web') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} @@ -449,7 +457,7 @@ jobs: file: artifact/out/*.7z.* - name: Upload Windows nsis-web installer to Release assets - if: endsWith(matrix.artifact_name, '-nsis-web') + if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && endsWith(matrix.artifact_name, '-nsis-web') uses: svenstaro/upload-release-action@v2 with: repo_token: ${{ secrets.GITHUB_TOKEN }} From d6925896ba929e2dda057deff248bd598a750fdb Mon Sep 17 00:00:00 2001 From: aoirint Date: Wed, 29 Sep 2021 14:10:03 +0900 Subject: [PATCH 69/75] fix indent --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 110bf133ac..87fb93928c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -432,9 +432,9 @@ jobs: if: env.SKIP_UPLOADING_RELEASE_ASSET == '1' && endsWith(matrix.artifact_name, '-appimage') uses: actions/upload-artifact@v2 with: - name: ${{ matrix.artifact_name }}-release - path: | - artifact/*.7z.* + name: ${{ matrix.artifact_name }}-release + path: | + artifact/*.7z.* - name: Upload Linux AppImage splitted archives to Release assets if: env.SKIP_UPLOADING_RELEASE_ASSET != '1' && endsWith(matrix.artifact_name, '-appimage') From 97f5b6c3a67da12c44b9341fe95830f988af9086 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 2 Oct 2021 22:23:01 +0900 Subject: [PATCH 70/75] add tar.gz artifact --- .github/workflows/build.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c1ebb22567..6c238a85f3 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -265,6 +265,37 @@ jobs: path: | prepackage/ + - name: Recover file permissions + if: startsWith(matrix.artifact_name, 'linux-') # linux + shell: bash + run: | + chmod +x prepackage/voicevox + chmod +x prepackage/run + + # voicevox-x.x.x.tar.gz + # - VOICEVOX/ + # - voicevox + # - run + - name: Create Linux tar.gz + if: startsWith(matrix.artifact_name, 'linux-') # linux + shell: bash + run: | + mv prepackage VOICEVOX + tar cf voicevox-${{ github.ref }}.tar.gz VOICEVOX/ + + - name: Show disk space (debug info) + if: startsWith(matrix.artifact_name, 'linux-') # linux + shell: bash + run: | + df -h + + - name: Upload Linux tar.gz artifact + if: startsWith(matrix.artifact_name, 'linux-') # linux + uses: actions/upload-artifact@v2 + with: + name: ${{ matrix.artifact_name }}-targz + path: voicevox-${{ github.ref }}.tar.gz + build-distributable: if: github.event.release.tag_name != '' # If release From 93c56284b68b4b701b2b8e8351442fcb4d2f318a Mon Sep 17 00:00:00 2001 From: aoirint Date: Sat, 2 Oct 2021 22:40:40 +0900 Subject: [PATCH 71/75] replace github.ref --- .github/workflows/build.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6c238a85f3..94bb4c8b1e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -276,12 +276,18 @@ jobs: # - VOICEVOX/ # - voicevox # - run + - name: Set BUILD_IDENTIFIER env var + if: startsWith(matrix.artifact_name, 'linux-') # linux + shell: bash + run: | + echo "BUILD_IDENTIFIER=${GITHUB_REF##*/}" >> $GITHUB_ENV + - name: Create Linux tar.gz if: startsWith(matrix.artifact_name, 'linux-') # linux shell: bash run: | mv prepackage VOICEVOX - tar cf voicevox-${{ github.ref }}.tar.gz VOICEVOX/ + tar cf voicevox-${{ env.BUILD_IDENTIFIER }}.tar.gz VOICEVOX/ - name: Show disk space (debug info) if: startsWith(matrix.artifact_name, 'linux-') # linux @@ -294,7 +300,7 @@ jobs: uses: actions/upload-artifact@v2 with: name: ${{ matrix.artifact_name }}-targz - path: voicevox-${{ github.ref }}.tar.gz + path: voicevox-${{ env.BUILD_IDENTIFIER }}.tar.gz build-distributable: From bfa2ca04d5bafe03d725299885eb47374d6f58d9 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 3 Oct 2021 01:24:20 +0900 Subject: [PATCH 72/75] add size, hash in list --- .github/workflows/build.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 94bb4c8b1e..53f618122d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -479,8 +479,12 @@ jobs: # compressed to MyArtifact.AppImage.7z.001, MyArtifact.AppImage.7z.002, ... 7z -v1g a "${appImageFile}.7z" "${appImageFile}" - # Output splitted archive list to myartifact.7z.txt - ls ${appImageFile}.7z.* > archives.txt + # Output splitted archive name/size/hash list to myartifact.7z.txt + ls ${appImageFile}.7z.* > archives_name.txt + md5sum *.7z.* | awk '{print $1}' | tr a-z A-Z > archives_hash.txt + stat --printf="%s\n" *.7z.* > archives_size.txt + paste -d '\t' archives_name.txt archives_size.txt archives_hash.txt > archives.txt + mv archives.txt "${{ matrix.artifact_name }}.7z.txt" done From 6a4b62ffca93a7c9ac1c921848ec117c81a080c9 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 3 Oct 2021 01:28:17 +0900 Subject: [PATCH 73/75] change engine repo and version --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 53f618122d..1f7619ea69 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,8 +9,8 @@ on: - created env: - VOICEVOX_ENGINE_REPO_URL: "https://github.com/aoirint/voicevox_engine" - VOICEVOX_ENGINE_VERSION: 0.6.0-aoirint-1 + VOICEVOX_ENGINE_REPO_URL: "https://github.com/Hiroshiba/voicevox_engine" + VOICEVOX_ENGINE_VERSION: check-2021-09-29 # FIXME: implement build with production resources in Hiroshiba/voicevox # Temporarily, skip uploading to GitHub Release (use Artifact instead) From 5d7153e1c56511fe11ca85758e14827171e4c512 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 3 Oct 2021 01:37:10 +0900 Subject: [PATCH 74/75] swap order --- .github/workflows/build.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 1f7619ea69..3dc9441ee8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -479,10 +479,11 @@ jobs: # compressed to MyArtifact.AppImage.7z.001, MyArtifact.AppImage.7z.002, ... 7z -v1g a "${appImageFile}.7z" "${appImageFile}" - # Output splitted archive name/size/hash list to myartifact.7z.txt + # Output splitted archive namesizehash list to myartifact.7z.txt ls ${appImageFile}.7z.* > archives_name.txt - md5sum *.7z.* | awk '{print $1}' | tr a-z A-Z > archives_hash.txt stat --printf="%s\n" *.7z.* > archives_size.txt + md5sum *.7z.* | awk '{print $1}' | tr a-z A-Z > archives_hash.txt + paste -d '\t' archives_name.txt archives_size.txt archives_hash.txt > archives.txt mv archives.txt "${{ matrix.artifact_name }}.7z.txt" From 2533a044733b5c03ccfe881ffdbc2843d5e34d65 Mon Sep 17 00:00:00 2001 From: aoirint Date: Sun, 3 Oct 2021 19:59:02 +0900 Subject: [PATCH 75/75] add comment: tar.gz --- .github/workflows/build.yml | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3dc9441ee8..7b7b2f16da 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -272,16 +272,25 @@ jobs: chmod +x prepackage/voicevox chmod +x prepackage/run - # voicevox-x.x.x.tar.gz - # - VOICEVOX/ - # - voicevox - # - run - name: Set BUILD_IDENTIFIER env var if: startsWith(matrix.artifact_name, 'linux-') # linux shell: bash run: | echo "BUILD_IDENTIFIER=${GITHUB_REF##*/}" >> $GITHUB_ENV + # Create tar.gz for Linux + # + # Due to GitHub Actions limitation (https://github.com/actions/upload-artifact/issues/38), + # file permissions are lost in actions/upload-artifact. + # To distribute binaries (voicevox, run) with execute permission, + # we need to pack all the files in tarball (tar.gz) before uploading. + # https://github.com/actions/upload-artifact/blob/11e311c8b504ea40cbed20583a64d75b4735cff3/README.md#maintaining-file-permissions-and-case-sensitive-files + # + # voicevox-x.x.x.tar.gz + # - VOICEVOX/ + # - voicevox + # - run + # - name: Create Linux tar.gz if: startsWith(matrix.artifact_name, 'linux-') # linux shell: bash