ci: make release recipe sed portable across BSD and GNU sed (#83)

`just release` used `sed -i ''`, which is BSD/macOS syntax. In the nix dev
shell GNU sed shadows it and reads `''` as an empty script and the s/.../
expression as a filename, aborting the version bump. Use `-i.bak` plus a
cleanup `rm`, which works on both BSD and GNU sed.

Reviewed-on: https://codeberg.org/secana/Forji/pulls/83
This commit is contained in:
Stefan Hausotte 2026-06-15 19:06:16 +02:00 committed by secana
parent e36150a2fc
commit a8ce9d1180

View file

@ -65,9 +65,11 @@ release new_version:
PREV=$(grep -m1 'MARKETING_VERSION' {{pbxproj}} | sed 's/.*= *//;s/;.*//')
echo "Releasing $PREV -> $NEW"
# 1. Bump the version in the Xcode project.
sed -i '' "s/MARKETING_VERSION = [^;]*/MARKETING_VERSION = $NEW/" {{pbxproj}}
sed -i '' "s/CURRENT_PROJECT_VERSION = [^;]*/CURRENT_PROJECT_VERSION = $NEW/" {{pbxproj}}
# 1. Bump the version in the Xcode project. Use a backup suffix so the -i
# syntax works on both BSD sed (macOS) and GNU sed (nix dev shell).
sed -i.bak "s/MARKETING_VERSION = [^;]*/MARKETING_VERSION = $NEW/" {{pbxproj}}
sed -i.bak "s/CURRENT_PROJECT_VERSION = [^;]*/CURRENT_PROJECT_VERSION = $NEW/" {{pbxproj}}
rm -f {{pbxproj}}.bak
# 2. Generate the changelog section for the new version from the conventional
# commits since the last tag, prepending it under the header.