Skip to content

Check new package versions #149

Check new package versions

Check new package versions #149

name: Check new package versions
on:
workflow_dispatch:
schedule:
- cron: '0 0 * * 1'
jobs:
check:
name: Check
if: ${{ github.repository == 'duhow/xiaoai-patch' }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Check version
run: |
BLUE='\033[0;34m'
NC='\033[0m'
(echo "REPO CURRENT TAG RELEASE";
for PACKAGE in $(find packages -name package.mk -type f -maxdepth 2 -mindepth 2 | cut -d'/' -f2); do
REPO=$(head packages/${PACKAGE}/package.mk | grep -e ^PACKAGE_SRC | grep github.com | cut -d'=' -f2 | tr -d '"' | cut -d'/' -f 4,5)
[ "${REPO}" = "" ] && continue
VERSION=$(grep -e ^PACKAGE_VERSION= packages/${PACKAGE}/package.mk | cut -d'=' -f2 | tr -d '"')
TAG=$(curl -s H 'User-Agent: GithubWorkflow' -u ${GITHUB_USER}:${GITHUB_TOKEN} https://api.github.com/repos/${REPO}/tags | jq -r '.[0].name')
RELEASE=$(curl -s H 'User-Agent: GithubWorkflow' -u ${GITHUB_USER}:${GITHUB_TOKEN} https://api.github.com/repos/${REPO}/releases/latest | jq -r '.tag_name')
(echo "master main devel" | grep -q ${VERSION}) || (echo "${TAG} ${RELEASE}" | grep -q ${VERSION}) || echo -ne "${BLUE}"
echo "${REPO} ${VERSION} ${TAG} ${RELEASE}"
echo -ne "${NC}"
done) | column -t || true
env:
GITHUB_USER: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}