mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2026-11-03 05:22:09 +08:00
Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d8e5e58f8f | ||
|
|
067a9f7cad |
+3
-3
@@ -63,18 +63,18 @@ tracing = "0.1.44"
|
||||
|
||||
tauri = { version = "2.12.4" }
|
||||
tauri-plugin-clipboard-manager = "2.5.0"
|
||||
parking_lot = { version = "0.12.5", features = ["hardware-lock-elision"] }
|
||||
parking_lot = { version = "0.13.0", features = ["hardware-lock-elision"] }
|
||||
anyhow = "1.0.104"
|
||||
chrono = "0.4.45"
|
||||
criterion = { version = "0.8.2", features = ["async_tokio"] }
|
||||
tokio = { version = "1.53.3", features = [
|
||||
tokio = { version = "1.54.1", features = [
|
||||
"rt-multi-thread",
|
||||
"macros",
|
||||
"time",
|
||||
"sync",
|
||||
] }
|
||||
flexi_logger = "0.31.10"
|
||||
log = "0.4.34"
|
||||
log = "0.4.35"
|
||||
regex = "1.13.1"
|
||||
reqwest = { version = "0.13.5", features = [
|
||||
"json",
|
||||
|
||||
@@ -4,7 +4,7 @@ version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
specta = { version = "=2.0.0-rc.25", features = ["derive", "function"] }
|
||||
specta = { version = "=2.0.0-rc.27", features = ["derive", "function"] }
|
||||
clash-verge-logging = { workspace = true }
|
||||
chrono = { workspace = true }
|
||||
log = { workspace = true }
|
||||
|
||||
@@ -5,14 +5,14 @@ edition = "2024"
|
||||
rust-version = "1.91"
|
||||
|
||||
[dependencies]
|
||||
specta = { version = "=2.0.0-rc.25", features = ["derive", "function"] }
|
||||
specta = { version = "=2.0.0-rc.27", features = ["derive", "function"] }
|
||||
tauri = { workspace = true }
|
||||
tauri-plugin-clipboard-manager = { workspace = true }
|
||||
parking_lot = { workspace = true }
|
||||
serde = { workspace = true, features = ["derive"] }
|
||||
# sysinfo 0.38.2 conflicts with dark-light
|
||||
# see https://github.com/GuillaumeGomez/sysinfo/issues/1623
|
||||
sysinfo = { version = "0.39.6", features = ["network", "system"] }
|
||||
sysinfo = { version = "0.40.1", features = ["network", "system"] }
|
||||
|
||||
[target.'cfg(not(windows))'.dependencies]
|
||||
libc = "0.2.191"
|
||||
|
||||
@@ -134,31 +134,6 @@ function fetchBranches() {
|
||||
)
|
||||
}
|
||||
|
||||
function discardClosedCandidate(branch, base, prefix) {
|
||||
const candidates = list(
|
||||
`pulls?state=all&base=${base}&head=${repository.split('/')[0]}:${branch}&per_page=100`,
|
||||
)
|
||||
const latest = candidates[0]
|
||||
if (!latest || candidates.some((pr) => pr.state === 'open'))
|
||||
throw new Error(
|
||||
`Branch ${branch} is reserved by an active or unknown candidate.`,
|
||||
)
|
||||
const pr = get(`pulls/${latest.number}`)
|
||||
requireBotPr(pr, base, prefix)
|
||||
if (pr.state !== 'closed' || pr.merged)
|
||||
throw new Error(
|
||||
`Close the unmerged candidate before retrying: ${pr.html_url}`,
|
||||
)
|
||||
updateRefs(pr.base.repo.node_id, [
|
||||
{
|
||||
name: `refs/heads/${branch}`,
|
||||
beforeOid: pr.head.sha,
|
||||
afterOid: '0'.repeat(40),
|
||||
},
|
||||
])
|
||||
summary(`Released the unused branch from closed PR: ${pr.html_url}`)
|
||||
}
|
||||
|
||||
function prepare() {
|
||||
let refresh
|
||||
if (env.GITHUB_EVENT_NAME === 'pull_request_target') {
|
||||
@@ -236,15 +211,8 @@ function prepare() {
|
||||
: last
|
||||
? `${base}-rc.${BigInt(last.match(rcPattern)[4] ?? 0) + 1n}`
|
||||
: `${base}-rc`)
|
||||
if (tags.includes(tag)) throw new Error(`Tag ${tag} already exists.`)
|
||||
for (const [prefix, target] of [
|
||||
['release/', 'dev'],
|
||||
['publish/', 'main'],
|
||||
]) {
|
||||
const branch = `${prefix}${tag}`
|
||||
if (refs.includes(`refs/heads/${branch}`) && branch !== refresh?.head.ref)
|
||||
discardClosedCandidate(branch, target, prefix)
|
||||
}
|
||||
if (occupied.includes(tag))
|
||||
throw new Error(`Tag ${tag} already exists or is reserved.`)
|
||||
const sha = git('rev-parse', 'HEAD')
|
||||
const body = releaseBody(tag, sha, tags, false)
|
||||
summary(body)
|
||||
@@ -485,7 +453,7 @@ function publishPr() {
|
||||
validateVersionCommit(tag, sha)
|
||||
const branch = `publish/${tag}`
|
||||
const existing = list(
|
||||
`pulls?state=open&base=main&head=${repository.split('/')[0]}:${branch}&per_page=100`,
|
||||
`pulls?state=all&base=main&head=${repository.split('/')[0]}:${branch}&per_page=100`,
|
||||
)
|
||||
if (existing.length) {
|
||||
const publication = existing[0]
|
||||
@@ -599,31 +567,28 @@ function publish() {
|
||||
requireApproval(pr, sha)
|
||||
const main = git('rev-parse', 'origin/main')
|
||||
git('merge-base', '--is-ancestor', main, sha)
|
||||
git(
|
||||
'-c',
|
||||
'user.name=github-actions[bot]',
|
||||
'-c',
|
||||
'user.email=41898282+github-actions[bot]@users.noreply.github.com',
|
||||
'tag',
|
||||
'--annotate',
|
||||
'--no-sign',
|
||||
'--message',
|
||||
marker,
|
||||
const object = api('git/tags', {
|
||||
tag,
|
||||
sha,
|
||||
)
|
||||
// GraphQL updateRefs rejects annotated tag objects; Git preserves atomicity.
|
||||
git(
|
||||
'push',
|
||||
'--atomic',
|
||||
`--force-with-lease=refs/heads/main:${main}`,
|
||||
`--force-with-lease=refs/heads/${pr.head.ref}:${sha}`,
|
||||
`--force-with-lease=refs/tags/${tag}:`,
|
||||
'origin',
|
||||
`${sha}:refs/heads/main`,
|
||||
`${sha}:refs/heads/${pr.head.ref}`,
|
||||
`refs/tags/${tag}:refs/tags/${tag}`,
|
||||
)
|
||||
message: marker,
|
||||
object: sha,
|
||||
type: 'commit',
|
||||
})
|
||||
// The tag records run ownership in the same transaction as the fast-forward.
|
||||
updateRefs(pr.base.repo.node_id, [
|
||||
{ name: 'refs/heads/main', beforeOid: main, afterOid: sha, force: false },
|
||||
{
|
||||
name: `refs/heads/${pr.head.ref}`,
|
||||
beforeOid: sha,
|
||||
afterOid: sha,
|
||||
force: false,
|
||||
},
|
||||
{
|
||||
name: `refs/tags/${tag}`,
|
||||
beforeOid: '0'.repeat(40),
|
||||
afterOid: object.sha,
|
||||
force: false,
|
||||
},
|
||||
])
|
||||
summary(`Fast-forwarded main and tagged ${tag} at approved commit ${sha}.`)
|
||||
}
|
||||
releaseOutput(tag, sha)
|
||||
|
||||
@@ -58,8 +58,8 @@ smartstring = { workspace = true, features = ["serde"] }
|
||||
bitflags = { workspace = true }
|
||||
socket2 = { workspace = true }
|
||||
warp = { version = "0.4.3", features = ["server"] }
|
||||
open = "5.4.4"
|
||||
rfd = { version = "0.16.0", default-features = false, features = ["common-controls-v6"] }
|
||||
open = "5.4.5"
|
||||
rfd = { version = "0.17.2", default-features = false, features = ["common-controls-v6"] }
|
||||
dirs = "7.0.0"
|
||||
dunce = "1.0.5"
|
||||
nanoid = "0.5"
|
||||
@@ -79,7 +79,7 @@ tauri-plugin-fs = "2.7.1"
|
||||
tauri-plugin-process = "2.4.0"
|
||||
tauri-plugin-deep-link = "2.6.2"
|
||||
tauri-plugin-window-state = "2.5.0"
|
||||
zip = "9.1.3"
|
||||
zip = "9.2.2"
|
||||
flate2 = "1.1.10"
|
||||
reqwest_dav = "0.3.3"
|
||||
aes-gcm = { version = "0.11.1" }
|
||||
@@ -98,19 +98,19 @@ tracing = { workspace = true }
|
||||
tauri-plugin-devtools = { version = "2.2.2", optional = true }
|
||||
tauri-plugin-mihomo = { git = "https://github.com/clash-verge-rev/tauri-plugin-mihomo", rev = "7a03d16f4d39b1bb885b7babe66b9e153e34b615" }
|
||||
async-trait = "0.1.92"
|
||||
clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verge-service-ipc.git", tag = "v2.7.6", version = "2.7.6", features = [
|
||||
clash_verge_service_ipc = { git = "https://github.com/clash-verge-rev/clash-verge-service-ipc.git", tag = "v2.7.7", version = "2.7.6", features = [
|
||||
"client",
|
||||
] }
|
||||
arc-swap = "1.9.2"
|
||||
arc-swap = "1.9.3"
|
||||
tokio-rustls = "0.26.6"
|
||||
rustls = { version = "0.23.46", features = ["ring"] }
|
||||
webpki-roots = "1.0.9"
|
||||
webpki-roots = "1.0.11"
|
||||
dark-light = "3.0.0"
|
||||
bytes = "1.12.1"
|
||||
tokio-util = { version = "0.7.20", features = ["time"] }
|
||||
specta = { version = "=2.0.0-rc.25", features = ["derive", "function", "serde_json"] }
|
||||
specta = { version = "=2.0.0-rc.27", features = ["derive", "function", "serde_json"] }
|
||||
tauri-specta = { version = "=2.0.0-rc.25", features = ["derive", "typescript"] }
|
||||
specta-typescript = "=0.0.12"
|
||||
specta-typescript = "=0.0.14"
|
||||
|
||||
[target.'cfg(unix)'.dependencies]
|
||||
libc = "0.2.191"
|
||||
|
||||
Reference in New Issue
Block a user