Skip to content

Commit

Permalink
发布,第一个版本
Browse files Browse the repository at this point in the history
  • Loading branch information
duolabmeng6 committed Nov 7, 2023
1 parent 7baaf2f commit 7cdfd63
Show file tree
Hide file tree
Showing 9 changed files with 54 additions and 16 deletions.
7 changes: 7 additions & 0 deletions .github/releasesText.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# 多多投屏

奋斗了{{用了多少时间}},本次更新内容如下:

{{最新发布信息}}

{{变更内容}}
22 changes: 11 additions & 11 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -164,19 +164,19 @@ 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: 上传产物
uses: actions/upload-artifact@v3
with:
name: window
path: |
GoEasyDesigner/build/bin/*.exe
easyToTV/build/bin/*.exe
jobs4:
Expand Down
4 changes: 4 additions & 0 deletions easyToTV/app.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,7 @@ func (a *App) E暂停播放() string {
}
return "ok"
}

func (a *App) GetVersion() string {
return myModel.Version
}
18 changes: 18 additions & 0 deletions easyToTV/build/dmg.sh
Original file line number Diff line number Diff line change
@@ -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} 已经创建完成!"
4 changes: 2 additions & 2 deletions easyToTV/frontend/src/win/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
2 changes: 2 additions & 0 deletions easyToTV/frontend/wailsjs/go/main/App.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ export function E获取系统时间():Promise<string>;

export function E获取设备列表():Promise<string>;

export function GetVersion():Promise<string>;

export function Greet(arg1:string):Promise<string>;

export function OpenFileDialog():Promise<string>;
4 changes: 4 additions & 0 deletions easyToTV/frontend/wailsjs/go/main/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
3 changes: 3 additions & 0 deletions easyToTV/myModel/Version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package myModel

var Version = `v0.0.1`
6 changes: 3 additions & 3 deletions easyToTV/myModel/投屏模块_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,17 @@ 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 {
println(err.Error())
}
// 10秒以后停止播放
time.Sleep(10 * time.Second)
m.E停止播放(设备URL)
m.E停止播放()

time.Sleep(60 * time.Second)

Expand Down

0 comments on commit 7cdfd63

Please sign in to comment.