mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
try to use pkg
This commit is contained in:
parent
697319b953
commit
3b139263ed
6
.github/workflows/build.yml
vendored
6
.github/workflows/build.yml
vendored
|
@ -200,7 +200,7 @@ jobs:
|
|||
sed -i "" -e "s/productName: mihomo-party/productName: Mihomo Party/" electron-builder.yml
|
||||
pnpm build:mac --${{ matrix.arch }}
|
||||
- name: Generate checksums
|
||||
run: pnpm checksum .dmg
|
||||
run: pnpm checksum .pkg
|
||||
- name: Upload Artifacts
|
||||
if: startsWith(github.ref, 'refs/heads/')
|
||||
uses: actions/upload-artifact@v4
|
||||
|
@ -208,7 +208,7 @@ jobs:
|
|||
name: MacOS ${{ matrix.arch }}
|
||||
path: |
|
||||
dist/*.sha256
|
||||
dist/*.dmg
|
||||
dist/*.pkg
|
||||
if-no-files-found: error
|
||||
- name: Publish Release
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
|
@ -216,7 +216,7 @@ jobs:
|
|||
with:
|
||||
files: |
|
||||
dist/*.sha256
|
||||
dist/*.dmg
|
||||
dist/*.pkg
|
||||
body_path: changelog.md
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ nsis:
|
|||
createDesktopShortcut: always
|
||||
mac:
|
||||
target:
|
||||
- dmg
|
||||
- pkg
|
||||
entitlementsInherit: build/entitlements.mac.plist
|
||||
extendInfo:
|
||||
- NSCameraUsageDescription: Application requests access to the device's camera.
|
||||
|
|
|
@ -20,8 +20,8 @@ const linuxFiles = [
|
|||
]
|
||||
|
||||
const macosFiles = [
|
||||
path.join(GITHUB_WORKSPACE, `mihomo-party-macos-${version}-arm64.dmg`),
|
||||
path.join(GITHUB_WORKSPACE, `mihomo-party-macos-${version}-x64.dmg`)
|
||||
path.join(GITHUB_WORKSPACE, `mihomo-party-macos-${version}-arm64.pkg`),
|
||||
path.join(GITHUB_WORKSPACE, `mihomo-party-macos-${version}-x64.pkg`)
|
||||
]
|
||||
|
||||
const windowsFiles = [
|
||||
|
|
|
@ -24,8 +24,8 @@ content += '\n<b>Windows7/8:</b>\n'
|
|||
content += `安装版:<a href="${downloadUrl}/mihomo-party-win7-${version}-x64-setup.exe">64位</a> | <a href="${downloadUrl}/mihomo-party-win7-${version}-ia32-setup.exe">32位</a>\n`
|
||||
content += `便携版:<a href="${downloadUrl}/mihomo-party-win7-${version}-x64-portable.7z">64位</a> | <a href="${downloadUrl}/mihomo-party-win7-${version}-ia32-portable.7z">32位</a>\n`
|
||||
content += '\n<b>macOS:</b>\n'
|
||||
content += `DMG:<a href="${downloadUrl}/mihomo-party-macos-${version}-x64.dmg
|
||||
">Intel</a> | <a href="${downloadUrl}/mihomo-party-macos-${version}-arm64.dmg">Apple Silicon</a>\n`
|
||||
content += `DMG:<a href="${downloadUrl}/mihomo-party-macos-${version}-x64.pkg
|
||||
">Intel</a> | <a href="${downloadUrl}/mihomo-party-macos-${version}-arm64.pkg">Apple Silicon</a>\n`
|
||||
content += '\n<b>Linux:</b>\n'
|
||||
content += `DEB:<a href="${downloadUrl}/mihomo-party-linux-${version}-amd64.deb
|
||||
">64位</a> | <a href="${downloadUrl}/mihomo-party-linux-${version}-arm64.deb">ARM64</a>\n`
|
||||
|
|
|
@ -17,7 +17,7 @@ changelog += '\n#### Windows7/8:\n\n'
|
|||
changelog += `- 安装版:[64位](${downloadUrl}/mihomo-party-win7-${version}-x64-setup.exe) | [32位](${downloadUrl}/mihomo-party-win7-${version}-ia32-setup.exe)\n\n`
|
||||
changelog += `- 便携版:[64位](${downloadUrl}/mihomo-party-win7-${version}-x64-portable.7z) | [32位](${downloadUrl}/mihomo-party-win7-${version}-ia32-portable.7z)\n\n`
|
||||
changelog += '\n#### macOS:\n\n'
|
||||
changelog += `- DMG:[Intel](${downloadUrl}/mihomo-party-macos-${version}-x64.dmg) | [Apple Silicon](${downloadUrl}/mihomo-party-macos-${version}-arm64.dmg)\n\n`
|
||||
changelog += `- DMG:[Intel](${downloadUrl}/mihomo-party-macos-${version}-x64.pkg) | [Apple Silicon](${downloadUrl}/mihomo-party-macos-${version}-arm64.pkg)\n\n`
|
||||
changelog += '\n#### Linux:\n\n'
|
||||
changelog += `- DEB:[64位](${downloadUrl}/mihomo-party-linux-${version}-amd64.deb) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-arm64.deb)\n\n`
|
||||
changelog += `- RPM:[64位](${downloadUrl}/mihomo-party-linux-${version}-x86_64.rpm) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-aarch64.rpm)`
|
||||
|
|
|
@ -39,8 +39,8 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
|
|||
'win32-x64': `mihomo-party-windows-${version}-x64-setup.exe`,
|
||||
'win32-ia32': `mihomo-party-windows-${version}-ia32-setup.exe`,
|
||||
'win32-arm64': `mihomo-party-windows-${version}-arm64-setup.exe`,
|
||||
'darwin-x64': `mihomo-party-macos-${version}-x64.dmg`,
|
||||
'darwin-arm64': `mihomo-party-macos-${version}-arm64.dmg`
|
||||
'darwin-x64': `mihomo-party-macos-${version}-x64.pkg`,
|
||||
'darwin-arm64': `mihomo-party-macos-${version}-arm64.pkg`
|
||||
}
|
||||
let file = fileMap[`${process.platform}-${process.arch}`]
|
||||
if (isPortable()) {
|
||||
|
@ -88,7 +88,7 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
|
|||
).unref()
|
||||
app.quit()
|
||||
}
|
||||
if (file.endsWith('.dmg')) {
|
||||
if (file.endsWith('.pkg')) {
|
||||
try {
|
||||
const execPromise = promisify(exec)
|
||||
const name = exePath().split('.app')[0].replace('/Applications/', '')
|
||||
|
|
|
@ -109,7 +109,7 @@ async function cleanup(): Promise<void> {
|
|||
// update cache
|
||||
const files = await readdir(dataDir())
|
||||
for (const file of files) {
|
||||
if (file.endsWith('.exe') || file.endsWith('.dmg') || file.endsWith('.7z')) {
|
||||
if (file.endsWith('.exe') || file.endsWith('.pkg') || file.endsWith('.7z')) {
|
||||
try {
|
||||
await rm(path.join(dataDir(), file))
|
||||
} catch {
|
||||
|
|
Loading…
Reference in New Issue
Block a user