-
Notifications
You must be signed in to change notification settings - Fork 187
85 lines (73 loc) · 2.69 KB
/
nvchecker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
name: nvchecker
on:
push:
workflow_dispatch:
schedule:
# * is a special character in YAML so you have to quote this string
# UTC 09:00 -> CST (China) 17:00, see https://datetime360.com/cn/utc-cst-china-time/
- cron: '0 09 * * *'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
nvchecker:
runs-on: ubuntu-latest
container:
image: ghcr.io/liangyongxiang/gentoo-testing:master
steps:
- name: checkout
uses: actions/checkout@v4
- name: gentoo
run: |
# eselect
echo "::group::eselect repository add and sync"
repo_name=$(cat profiles/repo_name)
eselect repository add "$repo_name" git "file://${PWD}"
emerge --sync "$repo_name"
egencache --jobs=$(nproc) --update --repo "$repo_name" &> /dev/null
eix-update
echo "::endgroup::"
# eix
echo "::group::eix search packages"
pkgs=$(ACCEPT_LICENSE="*" ACCEPT_KEYWORDS="~amd64" EIX_LIMIT=0 NAMEVERSION="<category>/<name>-<version>\n" eix --pure-packages --in-overlay "$repo_name" --format '<bestversion:NAMEVERSION>')
pkgs=$(qatom -F "\"%{CATEGORY}/%{PN}\": \"%{PV}\"," $pkgs) # remove revision
echo "$pkgs"
pkgs="{ ${pkgs::-1} }"
echo "$pkgs" > .github/workflows/old_ver.json
sed -r -i 's/_p[^"]*//' .github/workflows/old_ver.json
cat .github/workflows/old_ver.json
echo "::endgroup::"
- name: nvchecker
id: nvchecker
run: |
echo "::group::nvchecker and nvcmp"
cd .github/workflows/
echo -e "[keys]\ngithub = \"${{ secrets.GITHUB_TOKEN }}\"" > keyfile.toml
nvchecker --file overlay.toml --keyfile keyfile.toml
sed -r -i \
-e 's#(\.|-|_)?a([[:digit:]]+)(",?)$#_alpha\2\3#' \
-e 's#(\.|-|_)?p([[:digit:]]+)(",?)$#_p\2\3#' \
-e 's#(\.|-|_)?rc([[:digit:]]+)(",?)$#_rc\2\3#' \
new_ver.json
cat new_ver.json
echo "nvcmp=$(nvcmp --file overlay.toml --json --newer)" >> $GITHUB_OUTPUT
echo "::endgroup::"
- name: setup node
uses: actions/setup-node@v4
with:
node-version: latest
- name: install github-script depends
run: |
npm install toml
- name: update issues
uses: actions/github-script@v7
timeout-minutes: 1
env:
pkgs: ${{steps.nvchecker.outputs.nvcmp}}
with:
github-token: ${{ secrets.GENTOO_ZH_NVCHECKER_PAT }} # https://github.com/microcai/gentoo-zh/pull/3130
script: |
const script = require('./.github/workflows/issues-bumper.js');
(async function () {
await script({github, context, core});
})();