.github/workflows: debug #311
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
if: github.repository == 'microcai/gentoo-zh' && github.ref == 'refs/heads/master' | |
container: | |
image: ghcr.io/liangyongxiang/gentoo-testing:master | |
steps: | |
- name: checkout | |
uses: actions/checkout@v2 | |
- 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 | |
cat .github/workflows/old_ver.json | |
echo "::endgroup::" | |
- name: nvchecker | |
id: nvchecker | |
run: | | |
echo "::group::nvchecker" | |
cd .github/workflows/ | |
echo -e "[keys]\ngithub = \"${{ secrets.GITHUB_TOKEN }}\"" > keyfile.toml | |
nvchecker --file overlay.toml --keyfile keyfile.toml | |
echo "::endgroup::" | |
- name: new version normalization | |
id: new_ver | |
run: | | |
sed -r -i \ | |
-e 's#(\.|-|_)?a([[:digit:]]+)",$#_alpah\2",#' \ | |
-e 's#(\.|-|_)?p([[:digit:]]+)",$#_p\2",#' \ | |
-e 's#(\.|-|_)?rc([[:digit:]]+)",$#_rc\2",#' \ | |
.github/workflows/new_ver.json | |
cat .github/workflows/new_ver.json | |
- name: nvcmp | |
id: nvcmp | |
run: | | |
echo "::group::nvcmp" | |
echo "::set-output name=nvcmp::$(nvcmp --file overlay.toml --json --newer)" | |
echo "::endgroup::" | |
- name: setup node | |
uses: actions/setup-node@v2 | |
with: | |
node-version: 16 | |
- name: install github-script depends | |
run: | | |
npm install toml | |
- name: update issues | |
uses: actions/github-script@v6 | |
timeout-minutes: 1 | |
env: | |
pkgs: ${{steps.nvcmp.outputs.nvcmp}} | |
with: | |
github-token: ${{ secrets.GENTOO_ZH_NVCHECKER_PAT }} | |
script: | | |
const script = require('./.github/workflows/issues-bumper.js'); | |
(async function () { | |
await script({github, context, core}); | |
})(); |