diff --git a/.github/workflows/build_preview_pages.yml b/.github/workflows/build_preview_pages.yml index d261a8c5c8..fb1068e4ac 100644 --- a/.github/workflows/build_preview_pages.yml +++ b/.github/workflows/build_preview_pages.yml @@ -23,8 +23,21 @@ jobs: - name: Build run: | + # 追加のバージョン情報 + 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 + + # Storybookのビルド npm run storybook:build -- --output-dir $(pwd)/dist_preview/storybook - npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor + + # ブラウザ版エディタのビルド + VITE_EXTRA_VERSION_INFO="${LOCATION} @ ${SHORT_SHA}" \ + npm run browser:build -- --base ./ --outDir $(pwd)/dist_preview/editor - name: Upload artifact uses: actions/upload-artifact@v4 diff --git a/src/components/Menu/MenuBar/MenuBar.vue b/src/components/Menu/MenuBar/MenuBar.vue index 759304ed92..1ad3cdba56 100644 --- a/src/components/Menu/MenuBar/MenuBar.vue +++ b/src/components/Menu/MenuBar/MenuBar.vue @@ -53,6 +53,9 @@ 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 +96,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 {