From 71eb666b36ddc267dca42e389b5cd25f2fc7a42c Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Sun, 3 May 2026 21:33:16 +0200 Subject: New upstream version 3.0.1 --- .github/workflows/hamlib-upstream-check.yml | 107 ++++++++++++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 .github/workflows/hamlib-upstream-check.yml (limited to '.github/workflows/hamlib-upstream-check.yml') diff --git a/.github/workflows/hamlib-upstream-check.yml b/.github/workflows/hamlib-upstream-check.yml new file mode 100644 index 00000000..01add999 --- /dev/null +++ b/.github/workflows/hamlib-upstream-check.yml @@ -0,0 +1,107 @@ +name: Hamlib Upstream Check + +on: + schedule: + # Weekly, Monday 12:00 UTC. Courtesy check for new Hamlib 4.x releases. + - cron: '0 12 * * MON' + workflow_dispatch: + +permissions: + contents: read + issues: write + +jobs: + check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + with: + persist-credentials: false + + - name: Check for newer upstream release + env: + GH_TOKEN: ${{ github.token }} + # Extension hook: to add Qt, Boost, fftw, or any other upstream, + # duplicate this workflow with different COMPONENT / REPO / MAJOR + # values, or convert this job into a matrix over those keys. + # The step logic below only reads these three env vars plus the + # hamlib_branch line in ci.yml, so swapping is mechanical. + COMPONENT: Hamlib + REPO: Hamlib/Hamlib + MAJOR: "4" + run: | + set -euo pipefail + + # Single source of truth for the pinned version lives in ci.yml. + # ci.yml and release.yml must agree on hamlib_branch; CI failure + # is the signal if they drift, so this step reads ci.yml only. + PINNED=$(grep -m1 'hamlib_branch:' .github/workflows/ci.yml \ + | sed -E 's/.*"([^"]+)".*/\1/') + if [[ -z "$PINNED" ]]; then + echo "::error::Could not read pinned ${COMPONENT} version from ci.yml" + exit 1 + fi + echo "Pinned: ${PINNED}" + + # Highest tag in the MAJOR.x series. Strict three-component filter + # skips partial tags like "4.6" and anything non-semver. sort -V + # handles numeric ordering correctly for dotted versions. + LATEST=$(gh api "/repos/${REPO}/tags" --paginate -q '.[].name' \ + | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' \ + | awk -F. -v m="${MAJOR}" '$1 == m' \ + | sort -V \ + | tail -n1) + if [[ -z "${LATEST}" ]]; then + echo "::error::No ${COMPONENT} ${MAJOR}.x tags found upstream" + exit 1 + fi + echo "Upstream: ${LATEST}" + + if [[ "${LATEST}" == "${PINNED}" ]]; then + echo "Pinned version is current. Nothing to do." + exit 0 + fi + + HIGHEST=$(printf '%s\n%s\n' "${PINNED}" "${LATEST}" | sort -V | tail -n1) + if [[ "${HIGHEST}" != "${LATEST}" ]]; then + echo "Pinned (${PINNED}) is ahead of upstream (${LATEST}); no action." + exit 0 + fi + + # Avoid filing a duplicate if last week's tracking issue is still + # open. "in:title" + the specific version number is tight enough + # to never collide with an unrelated issue. + if gh issue list --state open \ + --search "${COMPONENT} ${LATEST} in:title" \ + --json number -q '.[].number' | grep -q .; then + echo "Tracking issue already open for ${COMPONENT} ${LATEST}. Nothing to do." + exit 0 + fi + + TITLE="Upstream: ${COMPONENT} ${LATEST} available (pinned at ${PINNED})" + BODY=$(cat <