1.0.8-rc28
This commit is contained in:
parent
71dcbf6539
commit
98d23ff557
3 changed files with 30 additions and 104 deletions
|
|
@ -91,13 +91,13 @@ jobs:
|
||||||
env:
|
env:
|
||||||
STATE_FILE: /tmp/release-state
|
STATE_FILE: /tmp/release-state
|
||||||
steps:
|
steps:
|
||||||
- name: Clone du repo au tag demandé
|
- name: Clone du repo
|
||||||
run: |
|
run: |
|
||||||
if [[ -z "$TAG" ]]; then
|
if [[ -z "$TAG" ]]; then
|
||||||
echo "::error::No tag provided. In workflow_dispatch, set the 'tag' input."
|
echo "::error::No tag provided. In workflow_dispatch, set the 'tag' input."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "→ Cloning repo at tag $TAG"
|
echo "→ Cloning repo"
|
||||||
|
|
||||||
cd /src
|
cd /src
|
||||||
if [[ ! -d _src/.git ]]; then
|
if [[ ! -d _src/.git ]]; then
|
||||||
|
|
@ -107,100 +107,6 @@ jobs:
|
||||||
git clone https://forgejo.pschneider.fr/notazof/postit-debian.git _src
|
git clone https://forgejo.pschneider.fr/notazof/postit-debian.git _src
|
||||||
fi
|
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
|
- name: Build .deb amd64
|
||||||
env:
|
env:
|
||||||
POSTIT_RUNTIME: linux-x64
|
POSTIT_RUNTIME: linux-x64
|
||||||
|
|
|
||||||
13
Makefile
13
Makefile
|
|
@ -21,10 +21,11 @@
|
||||||
# POSTIT_RUNTIME default: linux-x64 (override to linux-arm64 etc.)
|
# POSTIT_RUNTIME default: linux-x64 (override to linux-arm64 etc.)
|
||||||
# POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here)
|
# POSTIT_OUT_DIR default: $(CURDIR)/.. (artifacts land here)
|
||||||
|
|
||||||
POSTIT_GIT_URL ?= https://github.com/pazof/yavsc.git
|
POSTIT_GIT_URL ?= https://forgejo.pschneider.fr/notazof/yavsc.git
|
||||||
POSTIT_GIT_TAG ?= 1.0.8-rc15
|
POSTIT_GIT_TAG ?= 1.0.8-rc28
|
||||||
POSTIT_RUNTIME ?= linux-x64
|
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
|
.PHONY: deb clean source test
|
||||||
|
|
||||||
|
|
@ -44,7 +45,10 @@ deb:
|
||||||
# previous build just produced). The pattern is the same one
|
# previous build just produced). The pattern is the same one
|
||||||
# dpkg-deb will reuse if we don't clean up first: postit_<ver>-
|
# dpkg-deb will reuse if we don't clean up first: postit_<ver>-
|
||||||
# 1_<host_arch>.deb.
|
# 1_<host_arch>.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
|
# Use dpkg-architecture to set the target arch correctly for
|
||||||
# cross-builds. For POSTIT_RUNTIME=linux-arm64, this exports
|
# cross-builds. For POSTIT_RUNTIME=linux-arm64, this exports
|
||||||
# DEB_HOST_ARCH=arm64 (and friends) so dpkg-buildpackage names
|
# DEB_HOST_ARCH=arm64 (and friends) so dpkg-buildpackage names
|
||||||
|
|
@ -78,6 +82,7 @@ deb:
|
||||||
# type, build GNU type) so debhelper rules see a consistent
|
# type, build GNU type) so debhelper rules see a consistent
|
||||||
# cross-build environment.
|
# 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
|
# dpkg-buildpackage already writes the produced .deb to
|
||||||
# /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no
|
# /src/_src/../ = $POSTIT_OUT_DIR (its default — there's no
|
||||||
# flag to change it). So no 'mv' is needed. The old 'mv'
|
# flag to change it). So no 'mv' is needed. The old 'mv'
|
||||||
|
|
|
||||||
21
debian/rules
vendored
21
debian/rules
vendored
|
|
@ -125,6 +125,21 @@ override_dh_auto_test:
|
||||||
# (Yavsc.Org.Tests covers the web front, not the desktop
|
# (Yavsc.Org.Tests covers the web front, not the desktop
|
||||||
# client). Build smoke is sufficient for the package.
|
# 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/<arch>/ 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:
|
override_dh_shlibdeps:
|
||||||
# In a cross-build (DEB_HOST_ARCH != DEB_BUILD_ARCH), the
|
# In a cross-build (DEB_HOST_ARCH != DEB_BUILD_ARCH), the
|
||||||
# system's arch-specific lib dir is at
|
# system's arch-specific lib dir is at
|
||||||
|
|
@ -141,13 +156,13 @@ override_dh_shlibdeps:
|
||||||
HOST_LIB_DIR=/usr/lib/$${HOST_MULTIARCH}; \
|
HOST_LIB_DIR=/usr/lib/$${HOST_MULTIARCH}; \
|
||||||
if [ -d "$$HOST_LIB_DIR" ]; then \
|
if [ -d "$$HOST_LIB_DIR" ]; then \
|
||||||
echo " --> dh_shlibdeps: cross-arch $$HOST_LIB_DIR (DEB_HOST_ARCH=$(DEB_HOST_ARCH))"; \
|
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 \
|
else \
|
||||||
echo " --> dh_shlibdeps: WARN cross-arch dir $$HOST_LIB_DIR missing"; \
|
echo " --> dh_shlibdeps: WARN cross-arch dir $$HOST_LIB_DIR missing"; \
|
||||||
dh_shlibdeps; \
|
dh_shlibdeps $(SHLIBDEPS_EXCLUDES); \
|
||||||
fi \
|
fi \
|
||||||
else \
|
else \
|
||||||
dh_shlibdeps; \
|
dh_shlibdeps $(SHLIBDEPS_EXCLUDES); \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
override_dh_strip:
|
override_dh_strip:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue