macos打包带版本号
This commit is contained in:
24
.github/workflows/build-macos.yml
vendored
24
.github/workflows/build-macos.yml
vendored
@@ -40,7 +40,15 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
uv run pyinstaller lite_mac.spec --noconfirm
|
uv run pyinstaller lite_mac.spec --noconfirm
|
||||||
|
|
||||||
# 第 7 步: 创建 macOS 应用包结构
|
# 第 7 步: 获取应用版本号
|
||||||
|
- name: Get application version
|
||||||
|
id: get_version
|
||||||
|
run: |
|
||||||
|
VERSION=$(python -c "import docutranslate; print(docutranslate.__version__)")
|
||||||
|
echo "VERSION=$VERSION" >> $GITHUB_ENV
|
||||||
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
|
# 第 8 步: 创建 macOS 应用包结构
|
||||||
- name: Create macOS app bundle structure
|
- name: Create macOS app bundle structure
|
||||||
run: |
|
run: |
|
||||||
mkdir -p dist/DocuTranslate.app/Contents/MacOS
|
mkdir -p dist/DocuTranslate.app/Contents/MacOS
|
||||||
@@ -70,7 +78,7 @@ jobs:
|
|||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>${{ github.run_number }}</string>
|
<string>${{ github.run_number }}</string>
|
||||||
<key>CFBundleShortVersionString</key>
|
<key>CFBundleShortVersionString</key>
|
||||||
<string>$(python -c "import docutranslate; print(docutranslate.__version__)")</string>
|
<string>${{ env.VERSION }}</string>
|
||||||
<key>NSHighResolutionCapable</key>
|
<key>NSHighResolutionCapable</key>
|
||||||
<true/>
|
<true/>
|
||||||
</dict>
|
</dict>
|
||||||
@@ -78,14 +86,14 @@ jobs:
|
|||||||
EOF
|
EOF
|
||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
# 第 8 步: 将 .app 打包成 .dmg 磁盘映像
|
# 第 9 步: 将 .app 打包成 .dmg 磁盘映像(带版本号)
|
||||||
- name: Create DMG Disk Image
|
- name: Create DMG Disk Image with version
|
||||||
run: |
|
run: |
|
||||||
hdiutil create -volname "DocuTranslate Installer" -srcfolder dist/DocuTranslate.app -ov -format UDZO dist/DocuTranslate-macOS.dmg
|
hdiutil create -volname "DocuTranslate Installer" -srcfolder dist/DocuTranslate.app -ov -format UDZO "dist/DocuTranslate-${{ env.VERSION }}-macOS.dmg"
|
||||||
|
|
||||||
# 第 9 步: 上传 .dmg 文件作为构建产物
|
# 第 10 步: 上传 .dmg 文件作为构建产物
|
||||||
- name: Upload macOS DMG
|
- name: Upload macOS DMG
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: DocuTranslate-macOS
|
name: DocuTranslate-macOS-${{ env.VERSION }}
|
||||||
path: dist/DocuTranslate-macOS.dmg # <--- 修改这里,上传 .dmg 文件
|
path: dist/DocuTranslate-${{ env.VERSION }}-macOS.dmg
|
||||||
Reference in New Issue
Block a user