fix: replace nclatest proxy with ghfast.top, add dual install commands
This commit is contained in:
2 files changed
+24
-4
No files matched your search
@@ -6,7 +6,13 @@ export const COMMENT_MARKER = '<!-- napcat-pr-build -->';
|
|||||||
export const DOCKER_COMMENT_MARKER = '<!-- napcat-pr-docker -->';
|
export const DOCKER_COMMENT_MARKER = '<!-- napcat-pr-docker -->';
|
||||||
|
|
||||||
// 默认代理前缀(加速中国大陆访问 GitHub Release)
|
// 默认代理前缀(加速中国大陆访问 GitHub Release)
|
||||||
export const PROXY_BASE = 'https://nclatest.znin.net';
|
// 格式:https://ghfast.top/{full-github-url}
|
||||||
|
export const PROXY_BASE = 'https://gh.llkk.cc';
|
||||||
|
|
||||||
|
/** 将 GitHub 直链转换为 ghfast.top 加速链接 */
|
||||||
|
export function toProxyUrl (directUrl: string): string {
|
||||||
|
return `${PROXY_BASE}/${directUrl}`;
|
||||||
|
}
|
||||||
|
|
||||||
export type BuildStatus = 'success' | 'failure' | 'cancelled' | 'pending' | 'unknown';
|
export type BuildStatus = 'success' | 'failure' | 'cancelled' | 'pending' | 'unknown';
|
||||||
|
|
||||||
@@ -186,13 +192,20 @@ export function generateResultComment (
|
|||||||
|
|
||||||
// 添加快速安装命令
|
// 添加快速安装命令
|
||||||
if (installInfo) {
|
if (installInfo) {
|
||||||
const proxyInstallUrl = installInfo.installUrl.replace('https://github.com', PROXY_BASE);
|
const directUrl = installInfo.installUrl;
|
||||||
|
const proxyInstallUrl = toProxyUrl(directUrl);
|
||||||
lines.push(
|
lines.push(
|
||||||
'',
|
'',
|
||||||
'---',
|
'---',
|
||||||
'',
|
'',
|
||||||
'## 🚀 快速安装 (Linux)',
|
'## 🚀 快速安装 (Linux)',
|
||||||
'',
|
'',
|
||||||
|
'**直连(需要能访问 GitHub)**',
|
||||||
|
'```bash',
|
||||||
|
`curl -sSL ${directUrl} | bash`,
|
||||||
|
'```',
|
||||||
|
'',
|
||||||
|
'**加速(国内推荐,ghfast.top)**',
|
||||||
'```bash',
|
'```bash',
|
||||||
`curl -sSL ${proxyInstallUrl} | bash`,
|
`curl -sSL ${proxyInstallUrl} | bash`,
|
||||||
'```',
|
'```',
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ import { execSync } from 'node:child_process';
|
|||||||
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync } from 'node:fs';
|
import { existsSync, readFileSync, writeFileSync, mkdirSync, readdirSync } from 'node:fs';
|
||||||
import { join, basename, resolve } from 'node:path';
|
import { join, basename, resolve } from 'node:path';
|
||||||
import { GitHubAPI, getEnv, setOutput } from './lib/github.ts';
|
import { GitHubAPI, getEnv, setOutput } from './lib/github.ts';
|
||||||
import { PROXY_BASE } from './lib/comment.ts';
|
import { toProxyUrl } from './lib/comment.ts';
|
||||||
|
|
||||||
interface AssetEntry {
|
interface AssetEntry {
|
||||||
name: string;
|
name: string;
|
||||||
@@ -119,7 +119,8 @@ async function main (): Promise<void> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// ---- 创建 Release ----
|
// ---- 创建 Release ----
|
||||||
const proxyInstallUrl = `${downloadBase}/install.sh`.replace('https://github.com', PROXY_BASE);
|
const directInstallUrl = `${downloadBase}/install.sh`;
|
||||||
|
const proxyInstallUrl = toProxyUrl(directInstallUrl);
|
||||||
const releaseBody = [
|
const releaseBody = [
|
||||||
`## NapCat PR #${prNumber} 测试版本`,
|
`## NapCat PR #${prNumber} 测试版本`,
|
||||||
'',
|
'',
|
||||||
@@ -129,6 +130,12 @@ async function main (): Promise<void> {
|
|||||||
'',
|
'',
|
||||||
'### 快速安装 (Linux)',
|
'### 快速安装 (Linux)',
|
||||||
'',
|
'',
|
||||||
|
'**直连(需要能访问 GitHub)**',
|
||||||
|
'```bash',
|
||||||
|
`curl -sSL ${directInstallUrl} | bash`,
|
||||||
|
'```',
|
||||||
|
'',
|
||||||
|
'**加速(国内推荐,ghfast.top)**',
|
||||||
'```bash',
|
'```bash',
|
||||||
`curl -sSL ${proxyInstallUrl} | bash`,
|
`curl -sSL ${proxyInstallUrl} | bash`,
|
||||||
'```',
|
'```',
|
||||||
|
|||||||
Reference in new issue
Block a user