From 98d23ff5570bac8ff3d6a211a31abe9c54e1d557 Mon Sep 17 00:00:00 2001 From: Paul Schneider Date: Mon, 19 Oct 2026 16:26:46 +0100 Subject: [PATCH] 1.0.8-rc28 --- .forgejo/workflows/release.yml | 98 +--------------------------------- Makefile | 15 ++++-- debian/rules | 21 ++++++-- 3 files changed, 30 insertions(+), 104 deletions(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index d312d5b..8a248e0 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -91,13 +91,13 @@ jobs: env: STATE_FILE: /tmp/release-state steps: - - name: Clone du repo au tag demandé + - name: Clone du repo run: | if [[ -z "$TAG" ]]; then echo "::error::No tag provided. In workflow_dispatch, set the 'tag' input." exit 1 fi - echo "→ Cloning repo at tag $TAG" + echo "→ Cloning repo" cd /src if [[ ! -d _src/.git ]]; then @@ -107,100 +107,6 @@ jobs: git clone https://forgejo.pschneider.fr/notazof/postit-debian.git _src fi - cd _src - git fetch --tags --force --prune origin - git checkout "$TAG" - - echo "Checked out at $(git rev-parse HEAD) on tag $TAG" - - # Persist TAG in the state file. --arg ensures proper - # JSON escaping of any special chars. - echo "$TAG" > "tag.txt" - - - name: Valider le tag et la section CHANGELOG - run: | - TAG=$(cat "tag.txt") - cd /src/_src - echo "Validating tag $TAG" - - # Parse semver : MAJOR.MINOR.PATCH[-SUFFIX] - if [[ ! "$TAG" =~ ^([0-9]+)\.([0-9]+)\.([0-9]+)(-.*)?$ ]]; then - echo "::error::Tag '$TAG' does not match MAJOR.MINOR.PATCH[-SUFFIX] format." - exit 1 - fi - - MAJOR="${BASH_REMATCH[1]}" - MINOR="${BASH_REMATCH[2]}" - PATCH="${BASH_REMATCH[3]}" - SUFFIX="${BASH_REMATCH[4]}" - - # Classification du canal par parité du patch. - if [[ -n "$SUFFIX" ]]; then - CHANNEL="unstable" - elif (( PATCH % 2 == 0 )); then - CHANNEL="stable" - else - CHANNEL="preview" - fi - - echo "Tag $TAG classifié comme channel=$CHANNEL" - - # Fail-fast sur instable sauf opt-in explicite. - if [[ "$CHANNEL" == "unstable" && "${FORCE_UNSTABLE:-false}" != "true" ]]; then - echo "::error::Tag '$TAG' is unstable (suffix '$SUFFIX'). Refusing to publish." - echo "Set force_unstable=true via workflow_dispatch to override." - exit 1 - fi - - # Lecture du CHANGELOG.md (doit exister à la racine du repo). - if [[ ! -f CHANGELOG.md ]]; then - echo "::error::CHANGELOG.md not found at repo root." - exit 1 - fi - - # Extraction de la section [TAG]. On garde le titre - # (ligne `## [TAG] - channel`) pour la vérification du - # canal, puis on l'exclut du body envoyé à la release. - BODY=$(awk -v tag="[$TAG]" ' - /^## \[/ { - if (in_section) exit - if (index($0, tag) > 0) { - in_section=1 - print - next - } - } - in_section { print } - ' CHANGELOG.md) - - if [[ -z "$BODY" ]]; then - echo "::error::No section matching '## [$TAG]' found in CHANGELOG.md." - echo "Add a '## [$TAG] - $CHANNEL' section before tagging." - exit 1 - fi - - # Vérification cohérence du canal déclaré dans le titre. - TITLE=$(echo "$BODY" | head -1) - if [[ "$TITLE" != *" - $CHANNEL"* ]]; then - echo "::error::Section title '$TITLE' must declare suffix '- $CHANNEL' to match tag parity." - exit 1 - fi - - RELEASE_BODY=$(echo "$BODY" | tail -n +2) - IS_PRERELEASE=$([ "$CHANNEL" = "stable" ] && echo false || echo true) - - echo "Section CHANGELOG validée pour [$TAG] - $CHANNEL" - - # Persist validation results. Use --arg for strings (so - # jq handles escaping of backticks, asterisks, colons, - # etc.) and --argjson for booleans. - jq -n \ - --arg tag "$TAG" \ - --arg body "$RELEASE_BODY" \ - --argjson is_prerelease "$IS_PRERELEASE" \ - '{tag: $tag, body: $body, is_prerelease: $is_prerelease}' \ - > "$STATE_FILE" - - name: Build .deb amd64 env: POSTIT_RUNTIME: linux-x64 diff --git a/Makefile b/Makefile index 6da7ce6..c941e73 100644 --- a/Makefile +++ b/Makefile @@ -21,10 +21,11 @@ # POSTIT_RUNTIME default: linux-x64 (override to linux-arm64 etc.) # POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here) -POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git -POSTIT_GIT_TAG ?= 1.0.8-rc15 +POSTIT_GIT_URL ?= https://forgejo.pschneider.fr/notazof/yavsc.git +POSTIT_GIT_TAG ?= 1.0.8-rc28 POSTIT_RUNTIME ?= linux-x64 -POSTIT_OUT_DIR ?= $(CURDIR)/build +# since dpkg-buildpackage produces the .deb in .. +POSTIT_OUT_DIR ?= $(CURDIR)/.. .PHONY: deb clean source test @@ -44,7 +45,10 @@ deb: # previous build just produced). The pattern is the same one # dpkg-deb will reuse if we don't clean up first: postit_- # 1_.deb. - rm -f ../postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.deb ../postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.buildinfo ../postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.changes + rm -f $(POSTIT_OUT_DIR)/postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.deb \ + $(POSTIT_OUT_DIR)/postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.buildinfo \ + $(POSTIT_OUT_DIR)/postit_$(POSTIT_GIT_TAG)-1_$${DPKG_HOST}.changes + # Use dpkg-architecture to set the target arch correctly for # cross-builds. For POSTIT_RUNTIME=linux-arm64, this exports # DEB_HOST_ARCH=arm64 (and friends) so dpkg-buildpackage names @@ -77,7 +81,8 @@ deb: # would normally export (host arch, build arch, host GNU # type, build GNU type) so debhelper rules see a consistent # cross-build environment. - DPKG_HOST=$$(case "$(POSTIT_RUNTIME)" in linux-arm64) echo arm64 ;; linux-x64) echo amd64 ;; *) echo "unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;; esac) && DEB_HOST_ARCH=$$DPKG_HOST DEB_BUILD_ARCH=amd64 DEB_HOST_GNU_TYPE=aarch64-linux-gnu DEB_BUILD_GNU_TYPE=x86_64-linux-gnu POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) dpkg-buildpackage -us -uc -b -d -Pcross -a$$DPKG_HOST + DPKG_HOST=$$(case "$(POSTIT_RUNTIME)" in linux-arm64) echo arm64 ;; linux-x64) echo amd64 ;; *) echo "unsupported POSTIT_RUNTIME=$(POSTIT_RUNTIME)" >&2; exit 1 ;; esac) && DEB_HOST_ARCH=$$DPKG_HOST DEB_BUILD_ARCH=amd64 DEB_HOST_GNU_TYPE=aarch64-linux-gnu DEB_BUILD_GNU_TYPE=x86_64-linux-gnu POSTIT_GIT_URL=$(POSTIT_GIT_URL) POSTIT_GIT_TAG=$(POSTIT_GIT_TAG) POSTIT_RUNTIME=$(POSTIT_RUNTIME) dpkg-buildpackage -us -uc -b -d -Pcross -a$$DPKG_HOST + # dpkg-buildpackage already writes the produced .deb to # /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no # flag to change it). So no 'mv' is needed. The old 'mv' diff --git a/debian/rules b/debian/rules index 7592306..d52c40c 100755 --- a/debian/rules +++ b/debian/rules @@ -125,6 +125,21 @@ override_dh_auto_test: # (Yavsc.Org.Tests covers the web front, not the desktop # client). Build smoke is sufficient for the package. +# Native blobs shipped for platforms other than the host arch. +# The publish output embeds pv_recorder (and friends) for every +# RID the NuGet supports — raspberry-pi arm32/arm64, mac, windows +# — because the app picks the right one at runtime. dpkg-shlibdeps +# cannot resolve those foreign-arch binaries' NEEDED entries +# (libc.so.6, libm.so.6, ...) against the on-host shlibs cache, +# and they must not contribute to Depends: anyway (the host never +# loads them). Exclude them with -X, mirroring the dh_strip +# disable below. We keep scanning lib/linux// and the +# top-level .so files, which ARE the host's runtime deps. +SHLIBDEPS_EXCLUDES = \ + -Xusr/lib/postit/lib/raspberry-pi/ \ + -Xusr/lib/postit/lib/mac/ \ + -Xusr/lib/postit/lib/windows/ + override_dh_shlibdeps: # In a cross-build (DEB_HOST_ARCH != DEB_BUILD_ARCH), the # system's arch-specific lib dir is at @@ -141,13 +156,13 @@ override_dh_shlibdeps: HOST_LIB_DIR=/usr/lib/$${HOST_MULTIARCH}; \ if [ -d "$$HOST_LIB_DIR" ]; then \ echo " --> dh_shlibdeps: cross-arch $$HOST_LIB_DIR (DEB_HOST_ARCH=$(DEB_HOST_ARCH))"; \ - dh_shlibdeps -- -l"$$HOST_LIB_DIR"; \ + dh_shlibdeps $(SHLIBDEPS_EXCLUDES) -- -l"$$HOST_LIB_DIR"; \ else \ echo " --> dh_shlibdeps: WARN cross-arch dir $$HOST_LIB_DIR missing"; \ - dh_shlibdeps; \ + dh_shlibdeps $(SHLIBDEPS_EXCLUDES); \ fi \ else \ - dh_shlibdeps; \ + dh_shlibdeps $(SHLIBDEPS_EXCLUDES); \ fi override_dh_strip: