Skip to content

Commit

Permalink
1.5.13
Browse files Browse the repository at this point in the history
  • Loading branch information
xishang0128 committed Dec 23, 2024
1 parent 8abce96 commit 154757c
Show file tree
Hide file tree
Showing 8 changed files with 60 additions and 169 deletions.
201 changes: 49 additions & 152 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
name: Build
permissions: write-all
on:
workflow_dispatch:
inputs:
version:
description: "Tag version to release"
required: false
push:
branches:
- master
Expand All @@ -10,203 +16,94 @@ on:
- '.github/ISSUE_TEMPLATE/**'
- '.github/workflows/issues.yml'

permissions: write-all

jobs:
windows:
build:
strategy:
fail-fast: false
matrix:
arch:
- x64
- ia32
- arm64
runs-on: windows-latest
os: [windows-latest, ubuntu-latest, macos-latest]
arch: [x64, arm64]
runs-on: ${{ matrix.os }}
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-win32-${{ matrix.arch }}-msvc
pnpm prepare --${{ matrix.arch }}
- name: Build
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_target_arch: ${{ matrix.arch }}
run: pnpm build:win --${{ matrix.arch }}
- name: Add Portable Flag
run: |
New-Item -Path "PORTABLE" -ItemType File
Get-ChildItem dist/*portable.7z | ForEach-Object {
7z a $_.FullName PORTABLE
}
- name: Generate checksums
run: pnpm checksum setup.exe portable.7z
- name: Upload Artifacts
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v4
with:
name: Windows ${{ matrix.arch }}
path: |
dist/*.sha256
dist/*setup.exe
dist/*portable.7z
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/*setup.exe
dist/*portable.7z
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}

linux:
strategy:
fail-fast: false
matrix:
arch:
- x64
- arm64
runs-on: ubuntu-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-linux-${{ matrix.arch }}-gnu
sed -i "s/productName: Mihomo Party/productName: mihomo-party/" electron-builder.yml
pnpm prepare --${{ matrix.arch }}
- name: Build
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_target_arch: ${{ matrix.arch }}
run: pnpm build:linux --${{ matrix.arch }}
- name: Generate checksums
run: pnpm checksum .deb .rpm
- name: Upload Artifacts
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v4
with:
name: Linux ${{ matrix.arch }}
path: |
dist/*.sha256
dist/*.deb
dist/*.rpm
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/*.deb
dist/*.rpm
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}

macos:
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
- name: Install Dependencies and Prepare
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 @mihomo-party/sysproxy-${{ matrix.os == 'windows-latest' && 'win32' || matrix.os == 'ubuntu-latest' && 'linux' || 'darwin' }}-${{ matrix.arch }}${{ matrix.os == 'ubuntu-latest' && '-gnu' || matrix.os == 'windows-latest' && '-msvc' || '' }}
pnpm prepare --${{ matrix.arch }}
- name: Build
env:
npm_config_arch: ${{ matrix.arch }}
npm_config_target_arch: ${{ matrix.arch }}
run: |
chmod +x build/pkg-scripts/postinstall
pnpm build:mac --${{ matrix.arch }}
- name: Generate checksums
run: pnpm checksum .pkg
pnpm build:${{ matrix.os == 'windows-latest' && 'win' || matrix.os == 'ubuntu-latest' && 'linux' || 'mac' }} --${{ matrix.arch }}
- name: Generate latest.yml
run: pnpm updater

- name: Upload Artifacts
if: startsWith(github.ref, 'refs/heads/')
uses: actions/upload-artifact@v4
with:
name: MacOS ${{ matrix.arch }}
name: ${{ matrix.os }} ${{ 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 }}
dist/*
latest.yml
changelog.md
artifact:
if: startsWith(github.ref, 'refs/heads/')
needs: [windows, linux, macos]
pre-release:
if: startsWith(github.ref, 'refs/heads/') || ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.version == '' }}
needs: [build]
runs-on: ubuntu-latest
concurrency:
group: artifact
cancel-in-progress: false
steps:
- name: Download Artifacts
uses: actions/download-artifact@v4
with:
path: bin/
merge-multiple: true

- name: Upload Prerelease
uses: softprops/action-gh-release@v1
if: ${{ success() }}
- name: Delete current release assets
uses: 8Mi-Tech/delete-release-assets-action@main
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
tag: Prerelease-${{ github.ref_name }}
deleteOnlyFromDrafts: false

- name: Publish Prerelease
if: success()
uses: softprops/action-gh-release@v2
with:
tag_name: pre-release
files: |
bin/*
prerelease: true

updater:
if: startsWith(github.ref, 'refs/tags/v')
needs: [windows, macos, linux]
release:
if: startsWith(github.ref, 'refs/tags/v') || (github.event_name == 'workflow_dispatch' && github.event.inputs.version != '')
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup pnpm
run: npm install -g pnpm
- name: Install Dependencies
run: pnpm install
- name: Generate latest.yml
run: pnpm updater
- uses: actions/download-artifact@v4
with:
path: bin/
merge-multiple: true

- run: mv bin/changelog.md ./

- name: Publish Release
if: success()
uses: softprops/action-gh-release@v2
with:
files: latest.yml
tag_name: ${{ github.event.inputs.version != '' && github.event.inputs.version || github.ref }}
body_path: changelog.md
token: ${{ secrets.GITHUB_TOKEN }}
files: |
bin/*
6 changes: 3 additions & 3 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@

### Features

- 支持编辑/查看外部资源
- 支持重置应用
- 添加出站接口查看
- 添加更多嗅探配置

### Bug Fixes

- 修复某些系统下应用白屏的问题
- null
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mihomo-party",
"version": "1.5.12",
"version": "1.5.13",
"description": "Mihomo Party",
"main": "./out/main/index.js",
"author": "mihomo-party-org",
Expand Down
8 changes: 1 addition & 7 deletions scripts/updater.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,16 @@ import { readFileSync, writeFileSync } from 'fs'
const pkg = readFileSync('package.json', 'utf-8')
let changelog = readFileSync('changelog.md', 'utf-8')
const { version } = JSON.parse(pkg)
const downloadUrl = `https://github.com/mihomo-party-org/mihomo-party/releases/download/v${version}`
const downloadUrl = `https://github.com/xishang0128/mihomo-party/releases/download/v${version}`
const latest = {
version,
changelog
}

changelog += '\n### 下载地址:\n\n#### Windows10/11:\n\n'
changelog += `- 安装版:[64位](${downloadUrl}/mihomo-party-windows-${version}-x64-setup.exe) | [32位](${downloadUrl}/mihomo-party-windows-${version}-ia32-setup.exe) | [ARM64](${downloadUrl}/mihomo-party-windows-${version}-arm64-setup.exe)\n\n`
changelog += `- 便携版:[64位](${downloadUrl}/mihomo-party-windows-${version}-x64-portable.7z) | [32位](${downloadUrl}/mihomo-party-windows-${version}-ia32-portable.7z) | [ARM64](${downloadUrl}/mihomo-party-windows-${version}-arm64-portable.7z)\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-portable.7z) | [32位](${downloadUrl}/mihomo-party-win7-${version}-ia32-portable.7z)\n\n`
changelog += '\n#### macOS 11+:\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 += `- 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)`
Expand Down
4 changes: 2 additions & 2 deletions src/main/resolve/autoUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { promisify } from 'util'
export async function checkUpdate(): Promise<IAppVersion | undefined> {
const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig()
const res = await axios.get(
'https://github.com/mihomo-party-org/mihomo-party/releases/latest/download/latest.yml',
'https://github.com/xishang0128/mihomo-party/releases/latest/download/latest.yml',
{
headers: { 'Content-Type': 'application/octet-stream' },
proxy: {
Expand All @@ -35,7 +35,7 @@ export async function checkUpdate(): Promise<IAppVersion | undefined> {

export async function downloadAndInstallUpdate(version: string): Promise<void> {
const { 'mixed-port': mixedPort = 7890 } = await getControledMihomoConfig()
const baseUrl = `https://github.com/mihomo-party-org/mihomo-party/releases/download/v${version}/`
const baseUrl = `https://github.com/xishang0128/mihomo-party/releases/download/v${version}/`
const fileMap = {
'win32-x64': `mihomo-party-windows-${version}-x64-setup.exe`,
'win32-ia32': `mihomo-party-windows-${version}-ia32-setup.exe`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,8 @@ const ConnectionDetailModal: React.FC<Props> = (props) => {
<ModalBody>
<SettingItem title="连接建立时间">{dayjs(connection.start).fromNow()}</SettingItem>
<SettingItem title="规则">
{connection.rule}
{connection.rulePayload ? `(${connection.rulePayload})` : '未命中任何规则'}
{connection.rule ? connection.rule : '未命中任何规则'}
{connection.rulePayload ? `(${connection.rulePayload})` : ''}
</SettingItem>
<SettingItem title="代理链">{[...connection.chains].reverse().join('>>')}</SettingItem>
<SettingItem title="上传速度">{calcTraffic(connection.uploadSpeed || 0)}/s</SettingItem>
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/components/updater/updater-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const UpdaterModal: React.FC<Props> = (props) => {
size="sm"
className="flex app-nodrag"
onPress={() => {
open(`https://github.com/mihomo-party-org/mihomo-party/releases/tag/v${version}`)
open(`https://github.com/xishang0128/mihomo-party/releases/tag/v${version}`)
}}
>
前往下载
Expand Down
2 changes: 1 addition & 1 deletion src/renderer/src/pages/settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const Settings: React.FC = () => {
className="app-nodrag"
title="GitHub 仓库"
onPress={() => {
window.open('https://github.com/mihomo-party-org/mihomo-party')
window.open('https://github.com/xishang0128/mihomo-party')
}}
>
<IoLogoGithub className="text-lg" />
Expand Down

0 comments on commit 154757c

Please sign in to comment.