mirror of
https://github.com/pompurin404/mihomo-party.git
synced 2024-11-16 03:32:17 +08:00
provide the catalina installation package separately
This commit is contained in:
parent
caefbe915c
commit
dc9a41ed04
59
.github/workflows/build.yml
vendored
59
.github/workflows/build.yml
vendored
|
@ -191,7 +191,6 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
pnpm install
|
pnpm install
|
||||||
pnpm add @mihomo-party/sysproxy-darwin-${{ matrix.arch }}
|
pnpm add @mihomo-party/sysproxy-darwin-${{ matrix.arch }}
|
||||||
pnpm add -D electron@32.2.0
|
|
||||||
pnpm prepare --${{ matrix.arch }}
|
pnpm prepare --${{ matrix.arch }}
|
||||||
- name: Build
|
- name: Build
|
||||||
env:
|
env:
|
||||||
|
@ -222,9 +221,61 @@ jobs:
|
||||||
body_path: changelog.md
|
body_path: changelog.md
|
||||||
token: ${{ secrets.GITHUB_TOKEN }}
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
macos10:
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
arch:
|
||||||
|
- x64
|
||||||
|
- arm64
|
||||||
|
runs-on: macos-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
- name: Setup pnpm
|
||||||
|
run: npm install -g pnpm
|
||||||
|
- name: Install Dependencies
|
||||||
|
env:
|
||||||
|
npm_config_arch: ${{ matrix.arch }}
|
||||||
|
npm_config_target_arch: ${{ matrix.arch }}
|
||||||
|
run: |
|
||||||
|
pnpm install
|
||||||
|
pnpm add @mihomo-party/sysproxy-darwin-${{ matrix.arch }}
|
||||||
|
pnpm add -D electron@32.2.0
|
||||||
|
pnpm prepare --${{ matrix.arch }}
|
||||||
|
- name: Build
|
||||||
|
env:
|
||||||
|
npm_config_arch: ${{ matrix.arch }}
|
||||||
|
npm_config_target_arch: ${{ matrix.arch }}
|
||||||
|
run: |
|
||||||
|
sed -i "" -e "s/productName: mihomo-party/productName: Mihomo Party/" electron-builder.yml
|
||||||
|
sed -i "" -e "s/macos/catalina/" electron-builder.yml
|
||||||
|
chmod +x build/pkg-scripts/postinstall
|
||||||
|
pnpm build:mac --${{ matrix.arch }}
|
||||||
|
- name: Generate checksums
|
||||||
|
run: pnpm checksum .pkg
|
||||||
|
- name: Upload Artifacts
|
||||||
|
if: startsWith(github.ref, 'refs/heads/')
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: Catalina ${{ matrix.arch }}
|
||||||
|
path: |
|
||||||
|
dist/*.sha256
|
||||||
|
dist/*.pkg
|
||||||
|
if-no-files-found: error
|
||||||
|
- name: Publish Release
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
dist/*.sha256
|
||||||
|
dist/*.pkg
|
||||||
|
body_path: changelog.md
|
||||||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
artifact:
|
artifact:
|
||||||
if: startsWith(github.ref, 'refs/heads/')
|
if: startsWith(github.ref, 'refs/heads/')
|
||||||
needs: [windows, macos, linux, windows7]
|
needs: [windows, macos, linux, windows7, macos10]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
services:
|
services:
|
||||||
telegram-bot-api:
|
telegram-bot-api:
|
||||||
|
@ -252,7 +303,7 @@ jobs:
|
||||||
|
|
||||||
updater:
|
updater:
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
needs: [windows, macos, windows7]
|
needs: [windows, macos, windows7, macos10]
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -361,7 +412,7 @@ jobs:
|
||||||
homebrew:
|
homebrew:
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
name: Update Homebrew cask
|
name: Update Homebrew cask
|
||||||
needs: macos
|
needs: [macos, macos10]
|
||||||
runs-on: macos-latest
|
runs-on: macos-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Set up Git
|
- name: Set up Git
|
||||||
|
|
11
changelog.md
11
changelog.md
|
@ -1,11 +1,4 @@
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
||||||
- macOS 改用 pkg 安装方式,不再支持 dmg 安装方式,因此本次更新需要手动下载安装包进行安装
|
- 1.5.0 之后 macOS 改用 pkg 安装方式,不再支持 dmg 安装方式,因此本次更新需要手动下载安装包进行安装
|
||||||
|
- electron33 已不再支持 macOS 10.15,故为 10.15 提供单独的安装包,需要的用户请自行下载安装,应用内更新时会自动检测系统版本,安装后后续可正常在应用内直接更新
|
||||||
### New Features
|
|
||||||
|
|
||||||
- macOS/Linux 均不再存储 root 密码
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
- 修复 macOS 10.15 无法安装的问题
|
|
||||||
|
|
|
@ -39,7 +39,6 @@ nsis:
|
||||||
mac:
|
mac:
|
||||||
target:
|
target:
|
||||||
- pkg
|
- pkg
|
||||||
minimumSystemVersion: '10.15'
|
|
||||||
entitlementsInherit: build/entitlements.mac.plist
|
entitlementsInherit: build/entitlements.mac.plist
|
||||||
extendInfo:
|
extendInfo:
|
||||||
- NSCameraUsageDescription: Application requests access to the device's camera.
|
- NSCameraUsageDescription: Application requests access to the device's camera.
|
||||||
|
|
|
@ -24,6 +24,11 @@ const macosFiles = [
|
||||||
path.join(GITHUB_WORKSPACE, `mihomo-party-macos-${version}-x64.pkg`)
|
path.join(GITHUB_WORKSPACE, `mihomo-party-macos-${version}-x64.pkg`)
|
||||||
]
|
]
|
||||||
|
|
||||||
|
const macos10Files = [
|
||||||
|
path.join(GITHUB_WORKSPACE, `mihomo-party-catalina-${version}-arm64.pkg`),
|
||||||
|
path.join(GITHUB_WORKSPACE, `mihomo-party-catalina-${version}-x64.pkg`)
|
||||||
|
]
|
||||||
|
|
||||||
const windowsFiles = [
|
const windowsFiles = [
|
||||||
path.join(GITHUB_WORKSPACE, `mihomo-party-windows-${version}-x64-setup.exe`),
|
path.join(GITHUB_WORKSPACE, `mihomo-party-windows-${version}-x64-setup.exe`),
|
||||||
path.join(GITHUB_WORKSPACE, `mihomo-party-windows-${version}-x64-portable.7z`),
|
path.join(GITHUB_WORKSPACE, `mihomo-party-windows-${version}-x64-portable.7z`),
|
||||||
|
@ -80,7 +85,7 @@ const macosMedia = macosFiles.map((file, index) => ({
|
||||||
type: 'document',
|
type: 'document',
|
||||||
media: `attach://file${index}`
|
media: `attach://file${index}`
|
||||||
}))
|
}))
|
||||||
macosMedia[macosMedia.length - 1].caption = `#${hash} #macOS\n${message}`
|
macosMedia[macosMedia.length - 1].caption = `#${hash} #macOS 11+\n${message}`
|
||||||
const macosForm = new FormData()
|
const macosForm = new FormData()
|
||||||
macosForm.append('chat_id', CHAT_ID)
|
macosForm.append('chat_id', CHAT_ID)
|
||||||
macosForm.append('media', JSON.stringify(macosMedia))
|
macosForm.append('media', JSON.stringify(macosMedia))
|
||||||
|
@ -88,6 +93,18 @@ macosFiles.forEach((file, index) => {
|
||||||
macosForm.append(`file${index}`, fs.createReadStream(file))
|
macosForm.append(`file${index}`, fs.createReadStream(file))
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const macos10Media = macos10Files.map((file, index) => ({
|
||||||
|
type: 'document',
|
||||||
|
media: `attach://file${index}`
|
||||||
|
}))
|
||||||
|
macos10Media[macos10Media.length - 1].caption = `#${hash} #macOS 10.15+\n${message}`
|
||||||
|
const macos10Form = new FormData()
|
||||||
|
macos10Form.append('chat_id', CHAT_ID)
|
||||||
|
macos10Form.append('media', JSON.stringify(macos10Media))
|
||||||
|
macos10Files.forEach((file, index) => {
|
||||||
|
macos10Form.append(`file${index}`, fs.createReadStream(file))
|
||||||
|
})
|
||||||
|
|
||||||
function sleep(ms) {
|
function sleep(ms) {
|
||||||
return new Promise((resolve) => setTimeout(resolve, ms))
|
return new Promise((resolve) => setTimeout(resolve, ms))
|
||||||
}
|
}
|
||||||
|
@ -122,6 +139,16 @@ await axios.post(
|
||||||
|
|
||||||
await sleep(10000)
|
await sleep(10000)
|
||||||
|
|
||||||
|
await axios.post(
|
||||||
|
`http://127.0.0.1:8081/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMediaGroup`,
|
||||||
|
macos10Form,
|
||||||
|
{
|
||||||
|
headers: macos10Form.getHeaders()
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
await sleep(10000)
|
||||||
|
|
||||||
await axios.post(
|
await axios.post(
|
||||||
`http://127.0.0.1:8081/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMediaGroup`,
|
`http://127.0.0.1:8081/bot${process.env.TELEGRAM_BOT_TOKEN}/sendMediaGroup`,
|
||||||
linuxForm,
|
linuxForm,
|
||||||
|
|
|
@ -23,9 +23,12 @@ content += `便携版:<a href="${downloadUrl}/mihomo-party-windows-${version}-
|
||||||
content += '\n<b>Windows7/8:</b>\n'
|
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-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 += `便携版:<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 += '\n<b>macOS 11+:</b>\n'
|
||||||
content += `DMG:<a href="${downloadUrl}/mihomo-party-macos-${version}-x64.pkg
|
content += `PKG:<a href="${downloadUrl}/mihomo-party-macos-${version}-x64.pkg
|
||||||
">Intel</a> | <a href="${downloadUrl}/mihomo-party-macos-${version}-arm64.pkg">Apple Silicon</a>\n`
|
">Intel</a> | <a href="${downloadUrl}/mihomo-party-macos-${version}-arm64.pkg">Apple Silicon</a>\n`
|
||||||
|
content += '\n<b>macOS 10.15+:</b>\n'
|
||||||
|
content += `PKG:<a href="${downloadUrl}/mihomo-party-catalina-${version}-x64.pkg
|
||||||
|
">Intel</a> | <a href="${downloadUrl}/mihomo-party-catalina-${version}-arm64.pkg">Apple Silicon</a>\n`
|
||||||
content += '\n<b>Linux:</b>\n'
|
content += '\n<b>Linux:</b>\n'
|
||||||
content += `DEB:<a href="${downloadUrl}/mihomo-party-linux-${version}-amd64.deb
|
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`
|
">64位</a> | <a href="${downloadUrl}/mihomo-party-linux-${version}-arm64.deb">ARM64</a>\n`
|
||||||
|
|
|
@ -16,8 +16,10 @@ changelog += `- 便携版:[64位](${downloadUrl}/mihomo-party-windows-${versio
|
||||||
changelog += '\n#### Windows7/8:\n\n'
|
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-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 += `- 便携版:[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 += '\n#### macOS 11+:\n\n'
|
||||||
changelog += `- DMG:[Intel](${downloadUrl}/mihomo-party-macos-${version}-x64.pkg) | [Apple Silicon](${downloadUrl}/mihomo-party-macos-${version}-arm64.pkg)\n\n`
|
changelog += `- PKG:[Intel](${downloadUrl}/mihomo-party-macos-${version}-x64.pkg) | [Apple Silicon](${downloadUrl}/mihomo-party-macos-${version}-arm64.pkg)\n\n`
|
||||||
|
changelog += '\n#### macOS 10.15+:\n\n'
|
||||||
|
changelog += `- PKG:[Intel](${downloadUrl}/mihomo-party-catalina-${version}-x64.pkg) | [Apple Silicon](${downloadUrl}/mihomo-party-catalina-${version}-arm64.pkg)\n\n`
|
||||||
changelog += '\n#### Linux:\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 += `- 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)`
|
changelog += `- RPM:[64位](${downloadUrl}/mihomo-party-linux-${version}-x86_64.rpm) | [ARM64](${downloadUrl}/mihomo-party-linux-${version}-aarch64.rpm)`
|
||||||
|
|
|
@ -7,7 +7,7 @@ import { copyFile, rm, writeFile } from 'fs/promises'
|
||||||
import path from 'path'
|
import path from 'path'
|
||||||
import { existsSync } from 'fs'
|
import { existsSync } from 'fs'
|
||||||
import os from 'os'
|
import os from 'os'
|
||||||
import { exec, spawn } from 'child_process'
|
import { exec, execSync, spawn } from 'child_process'
|
||||||
import { promisify } from 'util'
|
import { promisify } from 'util'
|
||||||
|
|
||||||
export async function checkUpdate(): Promise<IAppVersion | undefined> {
|
export async function checkUpdate(): Promise<IAppVersion | undefined> {
|
||||||
|
@ -52,6 +52,14 @@ export async function downloadAndInstallUpdate(version: string): Promise<void> {
|
||||||
if (process.platform === 'win32' && parseInt(os.release()) < 10) {
|
if (process.platform === 'win32' && parseInt(os.release()) < 10) {
|
||||||
file = file.replace('windows', 'win7')
|
file = file.replace('windows', 'win7')
|
||||||
}
|
}
|
||||||
|
if (process.platform === 'darwin') {
|
||||||
|
const productVersion = execSync('sw_vers -productVersion', { encoding: 'utf8' })
|
||||||
|
.toString()
|
||||||
|
.trim()
|
||||||
|
if (parseInt(productVersion) < 11) {
|
||||||
|
file = file.replace('macos', 'catalina')
|
||||||
|
}
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
if (!existsSync(path.join(dataDir(), file))) {
|
if (!existsSync(path.join(dataDir(), file))) {
|
||||||
const res = await axios.get(`${baseUrl}${file}`, {
|
const res = await axios.get(`${baseUrl}${file}`, {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user