Files
gentoo-zh/.github/workflows/nvchecker.yml
T
dependabot[bot] 111425d7b9 build(deps): bump actions/checkout from 6 to 7
Bumps [actions/checkout](https://github.com/actions/checkout) from 6 to 7.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v6...v7)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2026-06-22 19:23:50 +08:00

141 lines
4.1 KiB
YAML

name: nvchecker
on:
push:
branches:
- master
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:
eix:
if: github.repository == 'microcai/gentoo-zh'
runs-on: ubuntu-latest
container:
image: gentoo/stage3
options: --privileged
outputs:
pkgs: ${{ steps.eix.outputs.pkgs }}
steps:
- name: sync gentoo main tree
run: |
emerge-webrsync
- name: cat binrepos
run: |
cat /etc/portage/binrepos.conf/*
- name: setup features
run: |
echo 'FEATURES="getbinpkg"' >> /etc/portage/make.conf
getuto
- name: install depends
run: |
emerge --verbose --quiet --jobs $(nproc) --autounmask y --autounmask-continue y \
app-eselect/eselect-repository \
app-portage/eix \
dev-vcs/git
- name: setup gentoo git repo
run: |
eselect repository add gentoo git https://github.com/gentoo-mirror/gentoo.git
rm -rf /var/db/repos/gentoo
emaint sync -r gentoo
- name: checkout
uses: actions/checkout@v7
- name: eix
id: eix
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 ~arm64 ~loong ~riscv" 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
pkgs="{ ${pkgs::-1} }"
echo $pkgs
# use multiine string:
# https://docs.github.com/en/actions/reference/workflows-and-actions/workflow-commands#setting-an-output-parameter
{
echo 'pkgs<<EOF'
echo "$pkgs"
echo 'EOF'
} >> "$GITHUB_OUTPUT"
echo "::endgroup::"
nvchecker:
needs: eix
runs-on: ubuntu-latest
outputs:
nvcmp: ${{ steps.nvchecker.outputs.nvcmp }}
steps:
- name: checkout
uses: actions/checkout@v7
- name: install depends
run: |
pip install nvchecker jq
- name: echo pkgs
run: |
echo '${{ needs.eix.outputs.pkgs }}'
- name: nvchecker
id: nvchecker
env:
GITHUB_TOKEN: ${{ secrets.GENTOO_ZH_NVCHECKER_PAT }}
run: |
echo "::group::nvchecker"
cd .github/workflows/
echo '${{ needs.eix.outputs.pkgs }}' > old_ver.json
echo -e "[keys]\ngithub = \"${{ secrets.GITHUB_TOKEN }}\"" > keyfile.toml
nvchecker --file overlay.toml --keyfile keyfile.toml
echo "::endgroup::"
echo "::group::nvcmp"
echo "nvcmp=$(nvcmp --file overlay.toml --json --newer | jq 'map({name, newver, oldver})' | jq -c .)" >> $GITHUB_OUTPUT
echo "::endgroup::"
issues-bumper:
needs: nvchecker
runs-on: ubuntu-latest
strategy:
matrix:
include: ${{ fromJson(needs.nvchecker.outputs.nvcmp) }}
steps:
- name: Checkout bumpbot
uses: actions/checkout@v7
with:
repository: 'gentoo-zh-drafts/bumpbot'
- name: Checkout gentoo-zh
uses: actions/checkout@v7
with:
path: 'gentoo-zh'
- name: update issues
timeout-minutes: 1
env:
name: ${{ matrix.name }}
newver: ${{ matrix.newver }}
oldver: ${{ matrix.oldver }}
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"