mirror of
https://github.com/gentoo-mirror/gentoo-zh.git
synced 2025-04-19 15:58:56 -04:00
Merge updates from master
This commit is contained in:
commit
c0388e220c
152
.github/workflows/issues-bumper.js
vendored
152
.github/workflows/issues-bumper.js
vendored
@ -1,152 +0,0 @@
|
||||
const { graphql } = require("@octokit/graphql");
|
||||
const fs = require("fs");
|
||||
const toml = require("toml");
|
||||
|
||||
function getGithubAccount(packageName) {
|
||||
const tomlFileContent = fs.readFileSync(
|
||||
".github/workflows/overlay.toml",
|
||||
"utf8"
|
||||
);
|
||||
return toml.parse(tomlFileContent)[packageName]["github_account"];
|
||||
}
|
||||
|
||||
async function searchLimit(graphqlWithAuth) {
|
||||
const query = `
|
||||
query {
|
||||
rateLimit {
|
||||
remaining
|
||||
}
|
||||
}
|
||||
`;
|
||||
const { rateLimit } = await graphqlWithAuth(query);
|
||||
if (rateLimit.remaining === 0) {
|
||||
console.warn("Rate limit exceeded.");
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
module.exports = async ({ github, context, core }) => {
|
||||
const graphqlWithAuth = graphql.defaults({
|
||||
headers: {
|
||||
authorization: `token ${process.env.GITHUB_TOKEN}`,
|
||||
},
|
||||
});
|
||||
|
||||
if (await searchLimit(graphqlWithAuth)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const gentooZhOfficialRepoName = "microcai/gentoo-zh";
|
||||
const repoName = process.env.GITHUB_REPOSITORY;
|
||||
const repoIsGentooZhOfficial = repoName === gentooZhOfficialRepoName;
|
||||
|
||||
const pkg = {
|
||||
name: process.env.name,
|
||||
newver: process.env.newver,
|
||||
oldver: process.env.oldver,
|
||||
};
|
||||
|
||||
const titlePrefix = `[nvchecker] ${pkg.name} can be bump to `;
|
||||
const title = titlePrefix + pkg.newver;
|
||||
let body = pkg.oldver ? `oldver: ${pkg.oldver}` : "";
|
||||
|
||||
const githubAccounts = getGithubAccount(pkg.name);
|
||||
if (Array.isArray(githubAccounts)) {
|
||||
body += "\nCC:" + githubAccounts.map((account) => (repoIsGentooZhOfficial ? ` @${account}` : ` ${account}`)).join("");
|
||||
} else if (typeof githubAccounts === "string") {
|
||||
body += repoIsGentooZhOfficial ? `\nCC: @${githubAccounts}` : `\nCC: ${githubAccounts}`;
|
||||
}
|
||||
|
||||
if (!body) {
|
||||
body = null;
|
||||
}
|
||||
|
||||
const searchQuery = `
|
||||
query($searchQuery: String!, $cursor: String) {
|
||||
search(query: $searchQuery, type: ISSUE, first: 100, after: $cursor) {
|
||||
issueCount
|
||||
edges {
|
||||
node {
|
||||
... on Issue {
|
||||
number
|
||||
title
|
||||
body
|
||||
state
|
||||
}
|
||||
}
|
||||
}
|
||||
pageInfo {
|
||||
endCursor
|
||||
hasNextPage
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const variables = {
|
||||
searchQuery: `repo:${repoName} is:issue in:title ${titlePrefix}`,
|
||||
cursor: null,
|
||||
};
|
||||
|
||||
let issuesData = [];
|
||||
do {
|
||||
const { search } = await graphqlWithAuth(searchQuery, variables);
|
||||
issuesData = issuesData.concat(search.edges.map((edge) => edge.node));
|
||||
variables.cursor = search.pageInfo.endCursor;
|
||||
} while (variables.cursor);
|
||||
|
||||
for (const issue of issuesData) {
|
||||
if (issue.title.startsWith(titlePrefix)) {
|
||||
if (issue.body === body && issue.title === title) {
|
||||
return;
|
||||
} else if (issue.state === "OPEN") {
|
||||
await github.rest.issues.update({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: issue.number,
|
||||
title: title,
|
||||
body: body,
|
||||
});
|
||||
console.log(`Updated issue: ${issue.number}`);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const createIssueMutation = `
|
||||
mutation($title: String!, $body: String, $repoId: ID!) {
|
||||
createIssue(input: {title: $title, body: $body, repositoryId: $repoId}) {
|
||||
issue {
|
||||
url
|
||||
}
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const repoQuery = `
|
||||
query($owner: String!, $name: String!) {
|
||||
repository(owner: $owner, name: $name) {
|
||||
id
|
||||
}
|
||||
}
|
||||
`;
|
||||
|
||||
const { repository } = await graphqlWithAuth(repoQuery, {
|
||||
owner: context.repo.owner,
|
||||
name: context.repo.repo,
|
||||
});
|
||||
|
||||
const { createIssue } = await graphqlWithAuth(createIssueMutation, {
|
||||
title: title,
|
||||
body: body,
|
||||
repoId: repository.id,
|
||||
});
|
||||
|
||||
console.log(`Created issue: ${createIssue.issue.url}`);
|
||||
} catch (error) {
|
||||
core.warning(`Failed to create issue: ${error.message}`);
|
||||
throw error;
|
||||
}
|
||||
};
|
25
.github/workflows/nvchecker.yml
vendored
25
.github/workflows/nvchecker.yml
vendored
@ -2,6 +2,8 @@ name: nvchecker
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
workflow_dispatch:
|
||||
schedule:
|
||||
# * is a special character in YAML so you have to quote this string
|
||||
@ -14,6 +16,7 @@ concurrency:
|
||||
|
||||
jobs:
|
||||
nvchecker:
|
||||
if: github.repository == 'microcai/gentoo-zh'
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: ghcr.io/liangyongxiang/gentoo-testing:master
|
||||
@ -66,24 +69,22 @@ jobs:
|
||||
matrix:
|
||||
include: ${{ fromJson(needs.nvchecker.outputs.nvcmp) }}
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- name: Checkout bumpbot
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
repository: 'gentoo-zh-drafts/bumpbot'
|
||||
|
||||
- name: install github-script depends
|
||||
run: |
|
||||
npm install toml @octokit/graphql
|
||||
- name: Checkout gentoo-zh
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
path: 'gentoo-zh'
|
||||
|
||||
- name: update issues
|
||||
uses: actions/github-script@v7
|
||||
timeout-minutes: 1
|
||||
env:
|
||||
name: ${{ matrix.name }}
|
||||
newver: ${{ matrix.newver }}
|
||||
oldver: ${{ matrix.oldver }}
|
||||
GITHUB_TOKEN: ${{ secrets.GENTOO_ZH_NVCHECKER_PAT }}
|
||||
with:
|
||||
script: |
|
||||
const script = require('./.github/workflows/issues-bumper.js');
|
||||
(async function () {
|
||||
await script({github, context, core});
|
||||
})();
|
||||
GITHUB_TOKEN: ${{ secrets.GENTOO_ZH_NVCHECKER_PAT }} # https://github.com/microcai/gentoo-zh/pull/3130
|
||||
run: |
|
||||
go run . --file gentoo-zh/.github/workflows/overlay.toml --name "$name" --newver "$newver" --oldver "$oldver"
|
||||
|
@ -4,8 +4,8 @@ DIST Clash.Verge_2.0.3_amd64.deb 45023004 BLAKE2B f441cfd64150a26df0eb3c68560b1f
|
||||
DIST Clash.Verge_2.0.3_arm64.deb 42691082 BLAKE2B f7acec965a20ef1e181570db0787a185ff542318ce5a68947a1720cffdcb782909e41c223f7e0b6b48e92b8769541e1a06307e71aba141b4659653149ccdf5c4 SHA512 d7fba116228a8246d812ba6ca7eabc77e1b1008a7200867a2bc9bd0e9b339adb4207834ffecfd71759da3bca61eb76def04ee0fed1e8808da10e0f14b838fad2
|
||||
DIST Clash.Verge_2.1.2_amd64.deb 45831328 BLAKE2B 5e95b3f1077dcc4c50ec8cfb57f859d6f97c80a4e323b3259f28fce6c316a718524d0d8ce14fb39c6bc681c334c96bcf23f7601967880ef224596c6e05e71e74 SHA512 773ea007fab335f671ef15c15fda7344ece646d8acfddde885175a62aa10710f29bb19957ee7b6d763e24e1194fa7dde041527a2674f84b4ede3bcae434a61a7
|
||||
DIST Clash.Verge_2.1.2_arm64.deb 43387176 BLAKE2B dd188255469b3fe15bd481f7be68245e4c0d064cb38b9925f4fe812b1f1ca4df118727b00e6c2f9c60e6b209e14b5746008b8b6868a8ed37c844b4240b9c858c SHA512 d88fe550ff1ac640b0042e874edcf0ff02c02bbdd20348d6a777d13bd92212b0b8b4ecffe79f55645ea303120df9ab9fc139a46203bf79eb0a9c83544e412589
|
||||
DIST Clash.Verge_2.2.1_amd64.deb 48455526 BLAKE2B ed2abf237ac307d8a93e2a15c043389c197cbcff90020b553b7d1bb28010894328b72b415fb293de1fcbd591d4457b9917a56eb98374ade33d375021e59929cb SHA512 6ce99059555e1cb2056137cc257e8f409cddf7cd60f8c52caa6a3e2f480232c05f681297b4479b71a3812e7a0f1a71f0555f9bf98e6fb375e6db5fbe1d42d390
|
||||
DIST Clash.Verge_2.2.1_arm64.deb 45808754 BLAKE2B 7e233c656d26d94aa013d5000264ff66dd17d298a08a306976261259b868ac8e9e77befc503d8b6f34f30fba6f20eff7ade5827e35780f629eeddbaeb9d11c7c SHA512 d642bf59a2135cd3feeb74e013e28a7974b83964810e24726978fbf84f09e70c4db3a4e17363677a69bd5842a65901935f20f51bbe647c0f831308dde24b1bad
|
||||
DIST Clash.Verge_2.2.1-alpha_amd64.deb 48454228 BLAKE2B 7d61c233de25d5ade4732a6e5b713945ba12ec5a9dad2216e20df3d2e613c6713e961b997e0d256e6e04d0f7e9b82a80b6426d4db090447c8f641d7bc6aec166 SHA512 feedbd3f362c3b7b9344a107bc8dfe29287ca399cf94357444857a311f462cc2558e40e4ac63809a985065ab29aafda11b9a57b129c0d9ed552d059dce7b6733
|
||||
DIST Clash.Verge_2.2.1-alpha_arm64.deb 45806910 BLAKE2B 1b091a232ee38e33f844e506ae5fddf783913935d3ad69e4d8f370b17785402c7a18e3f62ed54f6ba0163dfa355824b9e21ec83442cf3f1b79439aae896e7019 SHA512 3fe8d6ae7beaa8021aaf180c03ce7511402ec31a1f41b0404a69bef0f15616a00acee9d03b776af19948acb430b249a8a43bf41b0f0751fdbea82700f99b9a3b
|
||||
DIST clash-verge_1.6.0_amd64.deb 43532710 BLAKE2B cd603d8f7fd0e84de895a06bbdad7205435cc71a075b7cd43a060010634564b9d0e25e3e6952e017d480f255a63219c65aa66a4408730b293c7bfab420ba61ef SHA512 4e17e319a5d83bc35967c204f91dc270e3061009fa3a3a6175090c28e89d81959036abce9f29280e56b470e954feb872714abd8583dc23800f9e7659b68172c1
|
||||
DIST clash-verge_1.6.0_arm64.deb 42036378 BLAKE2B ca99c2e29604c9fd62471ad77d2897adbe56472a0c6a4e7611fb9a86201b2e9510803bfe3103c02d69264f6a8c83c1fdc92be42b96be4f18dd8731793750bf52 SHA512 161ed9865292f7fc9ab38509caae58c48010bf25d030e322f7d1e0f41a803469154fa9b6b3d1d5072f417d2a70f1a4551aee314a8bf0c92e393fa34e2a5e866f
|
||||
DIST clash-verge_1.6.4_amd64.deb 43581684 BLAKE2B 520f02299115efb25ac070abc03324af829c5245b2776e8f6b15c5ccee29f5868fb553d37f82582c7183cf32d4ec49ac74d6f1b8cd8310ef35a518e50d2629e8 SHA512 c3d7004039085c54729703af262791b90afae3ddab17572899766fa6fc29997cb17543a3c6c692e2a5642ecc5a53e1b72b1276e141c452f95932c587b055e353
|
||||
|
@ -7,9 +7,10 @@ inherit desktop unpacker xdg
|
||||
|
||||
DESCRIPTION="(Continuation) of Clash Meta GUI based on Tauri. "
|
||||
HOMEPAGE="https://github.com/clash-verge-rev/clash-verge-rev"
|
||||
MY_PV=${PV//_alpha/-alpha}
|
||||
SRC_URI="
|
||||
amd64? ( https://github.com/clash-verge-rev/clash-verge-rev/releases/download/v${PV}/Clash.Verge_${PV}_amd64.deb )
|
||||
arm64? ( https://github.com/clash-verge-rev/clash-verge-rev/releases/download/v${PV}/Clash.Verge_${PV}_arm64.deb )
|
||||
amd64? ( https://github.com/clash-verge-rev/clash-verge-rev/releases/download/alpha/Clash.Verge_${MY_PV}_amd64.deb )
|
||||
arm64? ( https://github.com/clash-verge-rev/clash-verge-rev/releases/download/alpha/Clash.Verge_${MY_PV}_arm64.deb )
|
||||
"
|
||||
|
||||
S="${WORKDIR}"
|
Loading…
x
Reference in New Issue
Block a user