From bfba9ab81033f154171824934ef52cc9a84123e9 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 23 Sep 2025 13:33:50 +0200 Subject: [PATCH 1/4] build: get latest nightly build version from git.flow-control.dev --- contrib/make_nightly_build | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/make_nightly_build b/contrib/make_nightly_build index 95be193..eda0a1e 100755 --- a/contrib/make_nightly_build +++ b/contrib/make_nightly_build @@ -48,7 +48,14 @@ if [ -n "$UNPUSHED" ]; then fi # get latest version tag -last_nightly_version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name) + +if [ -z "$NO_FLOWCONTROL" ]; then + last_nightly_version=$(curl -s https://git.flow-control.dev/api/v1/repos/neurocyte/flow-nightly/releases/latest | jq -r .tag_name) +elif [ -z "$NO_GITHUB" ]; then + last_nightly_version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name) +elif [ -z "$NO_CODEBERG" ]; then + last_nightly_version=$(curl -s https://codeberg.org/api/v1/repos/neurocyte/flow-nightly/releases/latest | jq -r .tag_name) +fi [ -z "$last_nightly_version" ] && { echo "failed to fetch $title latest version" exit 1 From 15e27a6104b6a54e2da8577cb50dfb458999c290 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 23 Sep 2025 13:36:04 +0200 Subject: [PATCH 2/4] build: add option to allow uploading dirty nightly builds --- contrib/make_nightly_build | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/contrib/make_nightly_build b/contrib/make_nightly_build index eda0a1e..05a4850 100755 --- a/contrib/make_nightly_build +++ b/contrib/make_nightly_build @@ -6,6 +6,7 @@ for arg in "$@"; do --no-github) NO_GITHUB=1 ;; --no-codeberg) NO_CODEBERG=1 ;; --no-flowcontrol) NO_FLOWCONTROL=1 ;; + --allow-dirty) ALLOW_DIRTY=1 ;; esac done @@ -33,18 +34,20 @@ fi DIFF="$(git diff --stat --patch HEAD)" -if [ -n "$DIFF" ]; then - echo there are outstanding changes: - echo "$DIFF" - exit 1 -fi +if [ -z "$ALLOW_DIRTY" ]; then + if [ -n "$DIFF" ]; then + echo there are outstanding changes: + echo "$DIFF" + exit 1 + fi -UNPUSHED="$(git log --pretty=oneline '@{u}...')" + UNPUSHED="$(git log --pretty=oneline '@{u}...')" -if [ -n "$UNPUSHED" ]; then - echo there are unpushed commits: - echo "$UNPUSHED" - exit 1 + if [ -n "$UNPUSHED" ]; then + echo there are unpushed commits: + echo "$UNPUSHED" + exit 1 + fi fi # get latest version tag From 34594942c78b1df8b9beb98588f2961a4c484e7d Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 23 Sep 2025 15:19:45 +0200 Subject: [PATCH 3/4] build: add source tarballs to nightly builds --- contrib/make_nightly_build | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/contrib/make_nightly_build b/contrib/make_nightly_build index 05a4850..9d36a6f 100755 --- a/contrib/make_nightly_build +++ b/contrib/make_nightly_build @@ -85,9 +85,13 @@ echo building... ./zig build -Dpackage_release --prefix "$DESTDIR/build" +VERSION=$(/bin/cat "$DESTDIR/build/version") + +git archive --format=tar.gz --output="$DESTDIR/flow-$VERSION-source.tar.gz" HEAD +git archive --format=zip --output="$DESTDIR/flow-$VERSION-source.zip" HEAD + cd "$DESTDIR/build" -VERSION=$(/bin/cat version) TARGETS=$(/bin/ls) for target in $TARGETS; do @@ -146,18 +150,27 @@ cd .. cat "$release_notes" +ASSETS="" + if [ -z "$NO_FLOWCONTROL" ]; then + ASSETS="$ASSETS --asset $DESTDIR/flow-${VERSION}-source.tar.gz" + ASSETS="$ASSETS --asset $DESTDIR/flow-${VERSION}-source.tar.gz.sig" + ASSETS="$ASSETS --asset $DESTDIR/flow-${VERSION}-source.tar.gz.sha256" + ASSETS="$ASSETS --asset $DESTDIR/flow-${VERSION}-source.zip" + ASSETS="$ASSETS --asset $DESTDIR/flow-${VERSION}-source.zip.sig" + ASSETS="$ASSETS --asset $DESTDIR/flow-${VERSION}-source.zip.sha256" echo uploading to git.flow-control.dev - tea releases create --login flow-control --repo "$repo" --tag "$VERSION" --title "$title $VERSION" --note-file "$release_notes" + tea releases create --login flow-control --repo "$repo" --tag "$VERSION" --title "$title $VERSION" --note-file "$release_notes" \ + $ASSETS fi if [ -z "$NO_CODEBERG" ]; then - ASSETS="" for a in $DESTDIR/*; do ASSETS="$ASSETS --asset $a" done echo uploading to codeberg.org - tea releases create --login codeberg --repo "$repo" --tag "$VERSION" --title "$title $VERSION" --note-file "$release_notes" $ASSETS + tea releases create --login codeberg --repo "$repo" --tag "$VERSION" --title "$title $VERSION" --note-file "$release_notes" \ + $ASSETS fi if [ -z "$NO_GITHUB" ]; then From 024eb8b43b824f3faf97930c3a48c06a5d8cf909 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Tue, 23 Sep 2025 15:20:13 +0200 Subject: [PATCH 4/4] build: improve nightly build release notes --- contrib/make_nightly_build | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/contrib/make_nightly_build b/contrib/make_nightly_build index 9d36a6f..65949c5 100755 --- a/contrib/make_nightly_build +++ b/contrib/make_nightly_build @@ -128,24 +128,20 @@ echo cd .. { - echo "$title" "$VERSION" - echo - - echo "commits:" + echo "## commits in this build" echo git log "${last_nightly_version}..HEAD" --pretty="format:neurocyte/$APPNAME@%h %s" echo echo - echo "contributors to this release:" + echo "## contributors" git shortlog -s -n "${last_nightly_version}..HEAD" | cut -b 8- echo - echo - echo "also available at:" - echo "[flow-control.dev](https://git.flow-control.dev/neurocyte/flow-nightly/releases/tag/$VERSION)" - echo "[github.com](https://github.com/neurocyte/flow-nightly/releases/tag/$VERSION)" - echo "[codeberg.org](https://codeberg.org/neurocyte/flow-nightly/releases/tag/$VERSION)" + echo "## downloads" + echo "[flow-control.dev](https://git.flow-control.dev/neurocyte/flow-nightly/releases/tag/$VERSION) (source only)" + echo "[github.com](https://github.com/neurocyte/flow-nightly/releases/tag/$VERSION) (binaries & source)" + echo "[codeberg.org](https://codeberg.org/neurocyte/flow-nightly/releases/tag/$VERSION) (binaries & source)" } >"$release_notes" cat "$release_notes" @@ -175,5 +171,5 @@ fi if [ -z "$NO_GITHUB" ]; then echo uploading to github.com - gh release create "$VERSION" --repo "$repo" --notes-file "$release_notes" $DESTDIR/* + gh release create "$VERSION" --repo "$repo" --title "$title $VERSION" --notes-file "$release_notes" $DESTDIR/* fi