From ed5d69810a7d4adc7d2c3a61570f5a4b8aaa6c7b Mon Sep 17 00:00:00 2001 From: Amit Levy Date: Thu, 16 May 2024 11:55:10 +0300 Subject: [PATCH] Added capabilities to pluginQA --- .github/workflows/notifySlack.yml | 63 ----------------------------- .github/workflows/pluginQA.yml | 55 ++++++++++++++++++++++++- .github/workflows/publishPlugin.yml | 2 +- 3 files changed, 55 insertions(+), 65 deletions(-) delete mode 100644 .github/workflows/notifySlack.yml diff --git a/.github/workflows/notifySlack.yml b/.github/workflows/notifySlack.yml deleted file mode 100644 index 73733bc..0000000 --- a/.github/workflows/notifySlack.yml +++ /dev/null @@ -1,63 +0,0 @@ -name: Notify Slack - -on: - workflow_call: - workflow_dispatch: - -jobs: - notify-slack: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Extract version from pubspec.yaml - run: | - VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //') - echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV - shell: bash - - - name: Extract iOS SDK version from podspec - run: | - cd ios - IOS_SDK_VERSION=$(grep "s.ios.dependency 'AppsFlyerFramework'" appsflyer_sdk.podspec | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - echo "IOS_SDK_VERSION=$IOS_SDK_VERSION" >> $GITHUB_ENV - shell: bash - - - name: Extract Android SDK version - run: | - cd android - ANDROID_SDK_VERSION=$(cat build.gradle | grep 'com.appsflyer:af-android-sdk' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - echo "ANDROID_SDK_VERSION=$ANDROID_SDK_VERSION" >> $GITHUB_ENV - shell: bash - - - name: Extract CHANGELOG latest changes - run: | - PACKAGE_CHANGES=$(awk -v ver="$PACKAGE_VERSION" -v ORS=', ' ' - BEGIN { printing = 0; } - printing && /^## / { exit; } - $0 ~ "^## " ver { printing = 1; next; } - printing && NF { sub(/^-\s*/, ""); print; } - END { printf "\n" } # To ensure it ends with a newline - ' CHANGELOG.md) - PACKAGE_CHANGES="${PACKAGE_CHANGES%', '}" - echo "PACKAGE_CHANGES<> $GITHUB_ENV - echo "$PACKAGE_CHANGES" >> $GITHUB_ENV - echo "EOF" >> $GITHUB_ENV - shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} - - - name: Notify with Slack - uses: slackapi/slack-github-action@v1.23.0 - with: - payload: | - { - "version": "${{ env.PACKAGE_VERSION }}", - "branch" : "${{ github.ref }}", - "github-link" : "https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin", - "iOS-version": "${{ env.IOS_SDK_VERSION }}", - "android-version": "${{ env.ANDROID_SDK_VERSION }}", - "changelog" : "${{ env.PACKAGE_CHANGES }}" - } - env: - SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/pluginQA.yml b/.github/workflows/pluginQA.yml index bc86dba..e8676f6 100644 --- a/.github/workflows/pluginQA.yml +++ b/.github/workflows/pluginQA.yml @@ -21,4 +21,57 @@ jobs: Notify-Slack: needs: [ Build-Sample-Apps-Android ] # , Build-Sample-Apps-iOS ] - uses: ./.github/workflows/notifySlack.yml \ No newline at end of file + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Extract version from pubspec.yaml + run: | + VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //') + echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV + shell: bash + + - name: Extract iOS SDK version from podspec + run: | + cd ios + IOS_SDK_VERSION=$(grep "s.ios.dependency 'AppsFlyerFramework'" appsflyer_sdk.podspec | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') + echo "IOS_SDK_VERSION=$IOS_SDK_VERSION" >> $GITHUB_ENV + shell: bash + + - name: Extract Android SDK version + run: | + cd android + ANDROID_SDK_VERSION=$(cat build.gradle | grep 'com.appsflyer:af-android-sdk' | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') + echo "ANDROID_SDK_VERSION=$ANDROID_SDK_VERSION" >> $GITHUB_ENV + shell: bash + + - name: Extract CHANGELOG latest changes + run: | + PACKAGE_CHANGES=$(awk -v ver="$PACKAGE_VERSION" -v ORS=', ' ' + BEGIN { printing = 0; } + printing && /^## / { exit; } + $0 ~ "^## " ver { printing = 1; next; } + printing && NF { sub(/^-\s*/, ""); print; } + END { printf "\n" } # To ensure it ends with a newline + ' CHANGELOG.md) + PACKAGE_CHANGES="${PACKAGE_CHANGES%', '}" + echo "PACKAGE_CHANGES<> $GITHUB_ENV + echo "$PACKAGE_CHANGES" >> $GITHUB_ENV + echo "EOF" >> $GITHUB_ENV + shell: /usr/bin/bash --noprofile --norc -e -o pipefail {0} + + - name: Notify with SLack + uses: slackapi/slack-github-action@v1.23.0 + with: + payload: | + { + "version": "${{ env.PACKAGE_VERSION }}", + "branch" : "${{ github.ref }}", + "github-link" : "https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin", + "iOS-version": "${{ env.IOS_SDK_VERSION }}", + "android-version": "${{ env.ANDROID_SDK_VERSION }}", + "changelog" : "${{ env.PACKAGE_CHANGES }}" + } + env: + SLACK_WEBHOOK_URL: ${{ secrets.CI_SLACK_WEBHOOK_URL }} \ No newline at end of file diff --git a/.github/workflows/publishPlugin.yml b/.github/workflows/publishPlugin.yml index 306b785..e86451a 100644 --- a/.github/workflows/publishPlugin.yml +++ b/.github/workflows/publishPlugin.yml @@ -11,7 +11,7 @@ jobs: steps: - name: Checkout Repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Extract version from pubspec.yaml run: |