From cc1e43c11546feffb6a7ef3698c36924673b3673 Mon Sep 17 00:00:00 2001 From: Jonas Zaugg Date: Fri, 5 Feb 2021 00:15:18 +0100 Subject: [PATCH] Update make-release-package.sh Only check and update tag in Package.swift when not running a CI build. As long as GitHub actions are reserved for tests, this should be ok as this is a "fake" update of Package.swift anyway. If you ever use GitHub actions for releases, you'll probably have to rethink the tagging logic once again --- Configurations/make-release-package.sh | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/Configurations/make-release-package.sh b/Configurations/make-release-package.sh index 23afe66d..8ea78473 100755 --- a/Configurations/make-release-package.sh +++ b/Configurations/make-release-package.sh @@ -52,11 +52,18 @@ if [ "$ACTION" = "" ] ; then cd "$CONFIGURATION_BUILD_DIR/staging-spm" #rm -rf "$CONFIGURATION_BUILD_DIR/Sparkle.xcarchive" zip -rqyX -9 "../Sparkle-for-Swift-Package-Manager.zip" * - # Get latest git tag - cd "$SRCROOT" - latest_git_tag=$(git describe --abbrev=0) - # Check semantic versioning - [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" + + # GitHub actions set the CI environment variable to true + if [ "$CI" != true ]; then + # Get latest git tag + cd "$SRCROOT" + latest_git_tag=$(git describe --abbrev=0) + # Check semantic versioning + [[ $latest_git_tag =~ ^(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)(-((0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*)(\.(0|[1-9][0-9]*|[0-9]*[a-zA-Z-][0-9a-zA-Z-]*))*))?(\\+([0-9a-zA-Z-]+(\.[0-9a-zA-Z-]+)*))?$ ]] && echo "Tag $latest_git_tag follows semantic versioning" || echo "WARNING: Tag $latest_git_tag does not follow semantic versioning! SPM will not be able to resolve the repository" + else + # Dummy placeholder for CI test builds as we don't really need to update Package.swift for building and testing purposes + latest_git_tag="CI_BUILD" + fi # Generate new Package manifest cd "$CONFIGURATION_BUILD_DIR" cp "$SRCROOT/Package.swift" "$CONFIGURATION_BUILD_DIR"