From ba9920a3043efed1e5f733169c0f76b2480fff48 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 9 Nov 2024 15:22:19 +0900 Subject: [PATCH 1/4] =?UTF-8?q?Add:=20VITE=5FEXTRA=5FVERSION=5FINFO?= =?UTF-8?q?=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Menu/MenuBar/MenuBar.vue | 3 +++ src/vite-env.d.ts | 1 + 2 files changed, 4 insertions(+) diff --git a/src/components/Menu/MenuBar/MenuBar.vue b/src/components/Menu/MenuBar/MenuBar.vue index 759304ed92..da9e521270 100644 --- a/src/components/Menu/MenuBar/MenuBar.vue +++ b/src/components/Menu/MenuBar/MenuBar.vue @@ -53,6 +53,8 @@ const store = useStore(); const { registerHotkeyWithCleanup } = useHotkeyManager(); const currentVersion = ref(""); +const extraVersionInfo = import.meta.env.VITE_EXTRA_VERSION_INFO; + const audioKeys = computed(() => store.state.audioKeys); // デフォルトエンジンの代替先ポート @@ -93,6 +95,7 @@ const titleText = computed( (projectName.value != undefined ? projectName.value + " - " : "") + "VOICEVOX" + (currentVersion.value ? " - Ver. " + currentVersion.value : "") + + (extraVersionInfo ? ` (${extraVersionInfo})` : "") + (isMultiEngineOffMode.value ? " - マルチエンジンオフ" : "") + (defaultEngineAltPortTo.value != null ? ` - Port: ${defaultEngineAltPortTo.value}` diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index c7fbf04555..2295c4fd93 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -10,6 +10,7 @@ interface ImportMetaEnv { readonly VITE_LATEST_UPDATE_INFOS_URL: string; readonly VITE_GTM_CONTAINER_ID: string; readonly VITE_TARGET: "electron" | "browser"; + readonly VITE_EXTRA_VERSION_INFO: string | undefined; } interface ImportMeta { From df239cf30ea140bce4b840d862484e92083cbbe4 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 9 Nov 2024 15:22:55 +0900 Subject: [PATCH 2/4] =?UTF-8?q?Add:=20=E3=83=97=E3=83=AC=E3=83=93=E3=83=A5?= =?UTF-8?q?=E3=83=BC=E7=89=88=E3=81=A7=E5=8F=8D=E6=98=A0=E3=81=99=E3=82=8B?= =?UTF-8?q?=E3=82=88=E3=81=86=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_preview_pages.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_preview_pages.yml b/.github/workflows/build_preview_pages.yml index d261a8c5c8..1258d54cf3 100644 --- a/.github/workflows/build_preview_pages.yml +++ b/.github/workflows/build_preview_pages.yml @@ -24,7 +24,8 @@ jobs: - name: Build run: | npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook - npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor + VITE_EXTRA_VERSION_INFO=$(git rev-parse --short HEAD) \ + npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor - name: Upload artifact uses: actions/upload-artifact@v4 From 298b7ddcbabfa374d6b66b1425739f65d85fa540 Mon Sep 17 00:00:00 2001 From: sevenc-nanashi Date: Sat, 9 Nov 2024 15:40:48 +0900 Subject: [PATCH 3/4] =?UTF-8?q?Fix:=20SHA=E3=81=AE=E5=8F=96=E5=BE=97?= =?UTF-8?q?=E5=85=83=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_preview_pages.yml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_preview_pages.yml b/.github/workflows/build_preview_pages.yml index 1258d54cf3..09dd8cafd2 100644 --- a/.github/workflows/build_preview_pages.yml +++ b/.github/workflows/build_preview_pages.yml @@ -24,7 +24,15 @@ jobs: - name: Build run: | npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook - VITE_EXTRA_VERSION_INFO=$(git rev-parse --short HEAD) \ + if [ -n "${{ github.event.pull_request.head.sha }}" ]; then + LOCATION="PR#${{ github.event.pull_request.number }}" + SHORT_SHA=$(cut -c 1-7 <<< "${{ github.event.pull_request.head.sha }}") + else + LOCATION="${{ github.ref_name }}" + SHORT_SHA=$(cut -c 1-7 <<< "${{ github.sha }}") + fi + + VITE_EXTRA_VERSION_INFO="${LOCATION} @ ${SHORT_SHA}" \ npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor - name: Upload artifact From 2da2bed09bc18cb2815df6f136394398934387e4 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 9 Nov 2024 18:09:07 +0900 Subject: [PATCH 4/4] =?UTF-8?q?Add:=20=E8=BF=BD=E5=8A=A0=E3=81=AE=E3=83=90?= =?UTF-8?q?=E3=83=BC=E3=82=B8=E3=83=A7=E3=83=B3=E6=83=85=E5=A0=B1=E3=82=92?= =?UTF-8?q?=E3=83=93=E3=83=AB=E3=83=89=E3=83=97=E3=83=AD=E3=82=BB=E3=82=B9?= =?UTF-8?q?=E3=81=AB=E7=B5=B1=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build_preview_pages.yml | 6 +++++- src/components/Menu/MenuBar/MenuBar.vue | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build_preview_pages.yml b/.github/workflows/build_preview_pages.yml index 09dd8cafd2..fb1068e4ac 100644 --- a/.github/workflows/build_preview_pages.yml +++ b/.github/workflows/build_preview_pages.yml @@ -23,7 +23,7 @@ jobs: - name: Build run: | - npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook + # 追加のバージョン情報 if [ -n "${{ github.event.pull_request.head.sha }}" ]; then LOCATION="PR#${{ github.event.pull_request.number }}" SHORT_SHA=$(cut -c 1-7 <<< "${{ github.event.pull_request.head.sha }}") @@ -32,6 +32,10 @@ jobs: SHORT_SHA=$(cut -c 1-7 <<< "${{ github.sha }}") fi + # Storybookのビルド + npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook + + # ブラウザ版エディタのビルド VITE_EXTRA_VERSION_INFO="${LOCATION} @ ${SHORT_SHA}" \ npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor diff --git a/src/components/Menu/MenuBar/MenuBar.vue b/src/components/Menu/MenuBar/MenuBar.vue index da9e521270..1ad3cdba56 100644 --- a/src/components/Menu/MenuBar/MenuBar.vue +++ b/src/components/Menu/MenuBar/MenuBar.vue @@ -53,6 +53,7 @@ const store = useStore(); const { registerHotkeyWithCleanup } = useHotkeyManager(); const currentVersion = ref(""); +/** 追加のバージョン情報。コミットハッシュなどを書ける。 */ const extraVersionInfo = import.meta.env.VITE_EXTRA_VERSION_INFO; const audioKeys = computed(() => store.state.audioKeys);