Skip to content

Commit

Permalink
workflows: update_version.sh handles copyright year and BB files prop…
Browse files Browse the repository at this point in the history
…erly (#8073)

Signed-off-by: Patrick Stephens <[email protected]>
  • Loading branch information
patrick-stephens authored Nov 3, 2023
1 parent 2702f4f commit 752f695
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 60 deletions.
57 changes: 0 additions & 57 deletions fluent-bit-2.1.11.bb

This file was deleted.

12 changes: 9 additions & 3 deletions update_version.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ else
exit 1
fi

# Get the current year
NEW_COPYRIGHT_YEAR=${NEW_COPYRIGHT_YEAR:-$(date +%Y)}

# Update Copyright statement
sed_wrapper -i -E "s/Copyright \(C\) 2015-([0-9]+)/Copyright (C) 2015-$NEW_COPYRIGHT_YEAR/g" "$SCRIPT_DIR"/include/fluent-bit/flb_version.h.in

# Extract and verify each version
major=$(echo "$NEW_VERSION" | cut -d. -f1)
minor=$(echo "$NEW_VERSION" | cut -d. -f2)
Expand Down Expand Up @@ -73,8 +79,8 @@ if [[ -f "fluent-bit-$NEW_VERSION.bb" ]]; then
echo "ERROR: existing fluent-bit-$NEW_VERSION.bb"
exit 1
else
sed_wrapper -i "s/PV = \"[0-9].[0-9].[0-9]\"/PV = \"$NEW_VERSION\"/g" "$SCRIPT_DIR"/fluent-bit-*.*.*.bb
mv "$SCRIPT_DIR"/fluent-bit-*.*.*.bb "fluent-bit-$NEW_VERSION.bb"
mv -vf "$SCRIPT_DIR"/fluent-bit-*.*.*.bb "fluent-bit-$NEW_VERSION.bb"
sed_wrapper -i -E "s/^PV =.*$/PV = \"$NEW_VERSION\"/g" "fluent-bit-$NEW_VERSION.bb"
fi

if [[ "${DISABLE_COMMIT:-no}" == "no" ]]; then
Expand All @@ -89,7 +95,7 @@ if [[ "${DISABLE_COMMIT:-no}" == "no" ]]; then
# Handle renaming
git add "*.bb"
git commit -a -s -m "bitbake: bump to v$NEW_VERSION"
else
else
echo "Skipping commits"
fi

Expand Down

0 comments on commit 752f695

Please sign in to comment.