From 7cdfd63ee87edd4dbf76d9adb630bb1e739c6186 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A4=9A=E5=95=A6b=E6=A2=A6?= <1715109585@qq.com> Date: Tue, 7 Nov 2023 19:36:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=91=E5=B8=83,=E7=AC=AC=E4=B8=80=E4=B8=AA?= =?UTF-8?q?=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/releasesText.md | 7 ++++++ .github/workflows/publish.yml | 22 +++++++++---------- easyToTV/app.go | 4 ++++ easyToTV/build/dmg.sh | 18 +++++++++++++++ easyToTV/frontend/src/win/event.js | 4 ++-- easyToTV/frontend/wailsjs/go/main/App.d.ts | 2 ++ easyToTV/frontend/wailsjs/go/main/App.js | 4 ++++ easyToTV/myModel/Version.go | 3 +++ ...5\261\217\346\250\241\345\235\227_test.go" | 6 ++--- 9 files changed, 54 insertions(+), 16 deletions(-) create mode 100644 .github/releasesText.md create mode 100755 easyToTV/build/dmg.sh create mode 100644 easyToTV/myModel/Version.go diff --git a/.github/releasesText.md b/.github/releasesText.md new file mode 100644 index 0000000..b6103b7 --- /dev/null +++ b/.github/releasesText.md @@ -0,0 +1,7 @@ +# 多多投屏 + +奋斗了{{用了多少时间}},本次更新内容如下: + +{{最新发布信息}} + +{{变更内容}} \ No newline at end of file diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index a2a7bf1..da8f2c4 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -91,26 +91,26 @@ jobs: wails - name: 生成 Version.go 文件 run: | - echo -e "package mymodel\n\nvar Version = \"${version}\"" > GoEasyDesigner/mymodel/Version.go - cat GoEasyDesigner/mymodel/Version.go + echo -e "package myModel\n\nvar Version = \"${version}\"" > easyToTV/myModel/Version.go + cat easyToTV/myModel/Version.go - name: 编译 run: | pwd - cd GoEasyDesigner + cd easyToTV wails build ls -la - name: 查看编译的文件保存 run: | ls -la mkdir -p /tmp/artifacts - cp -r GoEasyDesigner/build/bin/GoEasyDesigner.app /tmp/artifacts/GoEasyDesigner.app - cp -r GoEasyDesigner/build/dmg.sh /tmp/artifacts/dmg.sh - chmod +x /tmp/artifacts/GoEasyDesigner.app/Contents/MacOS/GoEasyDesigner + cp -r easyToTV/build/bin/easyToTV.app /tmp/artifacts/easyToTV.app + cp -r easyToTV/build/dmg.sh /tmp/artifacts/dmg.sh + chmod +x /tmp/artifacts/easyToTV.app/Contents/MacOS/easyToTV - name: 创建压缩包 run: | cd /tmp/artifacts/ ./dmg.sh - zip -r ./GoEasyDesigner_MacOS.zip ./GoEasyDesigner.app + zip -r ./easyToTV_MacOS.zip ./easyToTV.app - name: 上传产物 uses: actions/upload-artifact@v3 @@ -164,11 +164,11 @@ jobs: - name: 生成 Version.go 文件 shell: bash run: | - echo -e "package mymodel\n\nvar Version = \"${version}\"" > GoEasyDesigner/mymodel/Version.go - cat GoEasyDesigner/mymodel/Version.go + echo -e "package myModel\n\nvar Version = \"${version}\"" > easyToTV/myModel/Version.go + cat easyToTV/myModel/Version.go - name: 编译exe run: | - cd GoEasyDesigner + cd easyToTV wails build -webview2 embed -upx ls - name: 上传产物 @@ -176,7 +176,7 @@ jobs: with: name: window path: | - GoEasyDesigner/build/bin/*.exe + easyToTV/build/bin/*.exe jobs4: diff --git a/easyToTV/app.go b/easyToTV/app.go index e61094b..d828d52 100644 --- a/easyToTV/app.go +++ b/easyToTV/app.go @@ -82,3 +82,7 @@ func (a *App) E暂停播放() string { } return "ok" } + +func (a *App) GetVersion() string { + return myModel.Version +} diff --git a/easyToTV/build/dmg.sh b/easyToTV/build/dmg.sh new file mode 100755 index 0000000..0c6c830 --- /dev/null +++ b/easyToTV/build/dmg.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +APP_NAME="easyToTV" +APP_VERSION="$version" +DMG_NAME="${APP_NAME}-${APP_VERSION}.dmg" +TEMP_DIR="./install" + +mkdir -p "${TEMP_DIR}" + +cp -r "./${APP_NAME}.app" "${TEMP_DIR}" + +# 创建 Applications 文件夹的快捷方式 +ln -s "/Applications" "${TEMP_DIR}/Applications" + +# 创建空的镜像文件 +hdiutil create -srcfolder "${TEMP_DIR}" -volname "${APP_NAME}" -format UDZO "${DMG_NAME}" + +echo "${DMG_NAME} 已经创建完成!" \ No newline at end of file diff --git a/easyToTV/frontend/src/win/event.js b/easyToTV/frontend/src/win/event.js index 329fb0c..a01d4a7 100644 --- a/easyToTV/frontend/src/win/event.js +++ b/easyToTV/frontend/src/win/event.js @@ -3,9 +3,9 @@ import * as systemFc from "../../wailsjs/runtime"; import * as goFc from "../../wailsjs/go/main/App"; export function BindWindowEvent(c, comps) { - c.WinCreated = function () { + c.WinCreated = async function () { console.log("WinCreated") - comps.Win.text = "多多投屏 v1.0" + comps.Win.text = "多多投屏" + await goFc.GetVersion(); c.刷新设备列表(); } c.刷新设备列表 = async function () { diff --git a/easyToTV/frontend/wailsjs/go/main/App.d.ts b/easyToTV/frontend/wailsjs/go/main/App.d.ts index 94411d7..476202f 100755 --- a/easyToTV/frontend/wailsjs/go/main/App.d.ts +++ b/easyToTV/frontend/wailsjs/go/main/App.d.ts @@ -11,6 +11,8 @@ export function E获取系统时间():Promise; export function E获取设备列表():Promise; +export function GetVersion():Promise; + export function Greet(arg1:string):Promise; export function OpenFileDialog():Promise; diff --git a/easyToTV/frontend/wailsjs/go/main/App.js b/easyToTV/frontend/wailsjs/go/main/App.js index 13afe97..cb8acaa 100755 --- a/easyToTV/frontend/wailsjs/go/main/App.js +++ b/easyToTV/frontend/wailsjs/go/main/App.js @@ -22,6 +22,10 @@ export function E获取设备列表() { return window['go']['main']['App']['E获取设备列表'](); } +export function GetVersion() { + return window['go']['main']['App']['GetVersion'](); +} + export function Greet(arg1) { return window['go']['main']['App']['Greet'](arg1); } diff --git a/easyToTV/myModel/Version.go b/easyToTV/myModel/Version.go new file mode 100644 index 0000000..6256aeb --- /dev/null +++ b/easyToTV/myModel/Version.go @@ -0,0 +1,3 @@ +package myModel + +var Version = `v0.0.1` diff --git "a/easyToTV/myModel/\346\212\225\345\261\217\346\250\241\345\235\227_test.go" "b/easyToTV/myModel/\346\212\225\345\261\217\346\250\241\345\235\227_test.go" index 0a9fb43..636ce50 100644 --- "a/easyToTV/myModel/\346\212\225\345\261\217\346\250\241\345\235\227_test.go" +++ "b/easyToTV/myModel/\346\212\225\345\261\217\346\250\241\345\235\227_test.go" @@ -20,9 +20,9 @@ func TestE投屏模块实现_获取设备列表(t *testing.T) { println(err.Error()) } time.Sleep(10 * time.Second) - m.E暂停播放(设备URL) + m.E暂停播放() time.Sleep(10 * time.Second) - m.E停止播放(设备URL) + m.E停止播放() err = m.E投递视频文件(设备URL, "/Users/ll/Downloads/1988-龍貓CD1-国语.mp4", "") if err != nil { @@ -30,7 +30,7 @@ func TestE投屏模块实现_获取设备列表(t *testing.T) { } // 10秒以后停止播放 time.Sleep(10 * time.Second) - m.E停止播放(设备URL) + m.E停止播放() time.Sleep(60 * time.Second)