Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: プレビュー版のタイトルバーにコミットハッシュを入れる #2349

Merged
merged 5 commits into from
Nov 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion .github/workflows/build_preview_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,21 @@ jobs:

- name: Build
run: |
# 追加のバージョン情報
if [ -n "${{ github.event.pull_request.head.sha }}" ]; then
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved
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
Expand Down
4 changes: 4 additions & 0 deletions src/components/Menu/MenuBar/MenuBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ const store = useStore();
const { registerHotkeyWithCleanup } = useHotkeyManager();
const currentVersion = ref("");

/** 追加のバージョン情報。コミットハッシュなどを書ける。 */
const extraVersionInfo = import.meta.env.VITE_EXTRA_VERSION_INFO;
Hiroshiba marked this conversation as resolved.
Show resolved Hide resolved

const audioKeys = computed(() => store.state.audioKeys);

// デフォルトエンジンの代替先ポート
Expand Down Expand Up @@ -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}`
Expand Down
1 change: 1 addition & 0 deletions src/vite-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Loading