From b14d3faa45c43fb187e05e3c0240184da79ef174 2022-08-21 15:41:25 From: Branko Majic <branko@majic.rs> Date: 2022-08-21 15:41:25 Subject: [PATCH] [factorio_development.sh] Added (personal) workaround for tag signing: - Older versions of git (<2.23) do not have the tag.gpgSign option. Try to emulate it by appending the --sign option if it is set in git configuration. --- diff --git a/games/factorio_development.sh b/games/factorio_development.sh index 9d41bc2b0266a6881ed3f7d9a086c40c8395fd2a..d4a9d5510c10cc572457df0fa49c4ca75a27be8e 100755 --- a/games/factorio_development.sh +++ b/games/factorio_development.sh @@ -850,11 +850,18 @@ function command_release() { return 1 fi + # @WORKAROUND: For using git tag signing on older versions of git. + if [[ $(git -C "$base_dir" config --get tag.gpgSign) == true ]]; then + local git_tag_gpgsign=("--sign") + else + local git_tag_gpgsign=() + fi + # Commit the changes and create a tag. GIT_VERSION_TAG_PREFIX # comes from build configuration. if ! git -C "$base_dir" add "$changelog_file" "$info_file" || \ ! git -C "$base_dir" commit --edit -m "Prepared release $version." || \ - ! git -C "$base_dir" tag -a -m "Release $version." "${GIT_VERSION_TAG_PREFIX}${version}"; then + ! git -C "$base_dir" tag "${git_tag_gpgsign[@]}" -a -m "Release $version." "${GIT_VERSION_TAG_PREFIX}${version}"; then error "Failed to create release commit and tag." return 1