From 524fd22456707d91640b1b6313ab98427e36f539 Mon Sep 17 00:00:00 2001 From: brenodt <54450520+brenodt@users.noreply.github.com> Date: Wed, 16 Nov 2022 16:45:48 -0300 Subject: [PATCH] ci: update Flutter tag filtering logic to remove build number --- .circleci/config.yml | 3 +-- .circleci/continue-config.yml | 6 +++--- .../jobs/publish-flutter-github-release.yml | 2 +- .../config-continuation/jobs/verify-version-flutter.yml | 4 ++-- circleci_config/config-setup/workflows/setup.yml | 3 +-- 5 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 940ee06f8..ee6573715 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -46,8 +46,7 @@ workflows: else echo ' "run-flutter-tagged-workflow": true' fi - fi - if [[ "$CIRCLE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]*(\.[0-9]+)?)?(\+([0-9])+)?.*$ ]]; then + elif [[ "$CIRCLE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]*(\.[0-9]+)?)?(\+([0-9])+)?.*$ ]]; then if [[ "$CIRCLE_TAG" =~ ^.*-android$ ]]; then echo ' "run-rust-android-tagged-workflow": true' elif [[ "$CIRCLE_TAG" =~ ^.*-ios$ ]]; then diff --git a/.circleci/continue-config.yml b/.circleci/continue-config.yml index 96b4876e4..0c6442bbf 100644 --- a/.circleci/continue-config.yml +++ b/.circleci/continue-config.yml @@ -803,7 +803,7 @@ jobs: name: Add utilities/bin to PATH - run: command: | - VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2}') + VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2 }' | sed 's/+.*$//') TAG="v${VERSION}" cd artifacts @@ -934,8 +934,8 @@ jobs: steps: - checkout-project - run: - command: |- - VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2}') + command: | + VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2 }' | sed 's/+.*$//') TAG="v${VERSION}-flutter" if [ $TAG != $CIRCLE_TAG ]; then echo "Git tag: $CIRCLE_TAG does not match the version of this app: $TAG" diff --git a/circleci_config/config-continuation/jobs/publish-flutter-github-release.yml b/circleci_config/config-continuation/jobs/publish-flutter-github-release.yml index 513e2e85d..c327c0aec 100644 --- a/circleci_config/config-continuation/jobs/publish-flutter-github-release.yml +++ b/circleci_config/config-continuation/jobs/publish-flutter-github-release.yml @@ -39,7 +39,7 @@ steps: - run: name: Publish Release on GitHub command: | - VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2}') + VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2 }' | sed 's/+.*$//') TAG="v${VERSION}" cd artifacts diff --git a/circleci_config/config-continuation/jobs/verify-version-flutter.yml b/circleci_config/config-continuation/jobs/verify-version-flutter.yml index 8eb303861..73de51c02 100644 --- a/circleci_config/config-continuation/jobs/verify-version-flutter.yml +++ b/circleci_config/config-continuation/jobs/verify-version-flutter.yml @@ -4,10 +4,10 @@ steps: - run: name: Verify that Git tag matches Flutter version command: | - VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2}') + VERSION=$(grep "version:" pubspec.yaml | awk '{ print $2 }' | sed 's/+.*$//') TAG="v${VERSION}-flutter" if [ $TAG != $CIRCLE_TAG ]; then echo "Git tag: $CIRCLE_TAG does not match the version of this app: $TAG" echo "Please update app version at qaul_ui/pubspec.yaml" exit 1 - fi \ No newline at end of file + fi diff --git a/circleci_config/config-setup/workflows/setup.yml b/circleci_config/config-setup/workflows/setup.yml index 650d666dc..90ab6cb3e 100644 --- a/circleci_config/config-setup/workflows/setup.yml +++ b/circleci_config/config-setup/workflows/setup.yml @@ -30,8 +30,7 @@ jobs: else echo ' "run-flutter-tagged-workflow": true' fi - fi - if [[ "$CIRCLE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]*(\.[0-9]+)?)?(\+([0-9])+)?.*$ ]]; then + elif [[ "$CIRCLE_TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(\-[a-zA-Z]*(\.[0-9]+)?)?(\+([0-9])+)?.*$ ]]; then if [[ "$CIRCLE_TAG" =~ ^.*-android$ ]]; then echo ' "run-rust-android-tagged-workflow": true' elif [[ "$CIRCLE_TAG" =~ ^.*-ios$ ]]; then