-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
102 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: Notify Slack | ||
|
||
on: | ||
workflow_call: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
notify-slack: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
|
||
- 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<<EOF" >> $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/[email protected] | ||
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,59 +19,6 @@ jobs: | |
# needs: [ Run-Unit-Tests ] | ||
# uses: ./.github/workflows/build-ios.yml | ||
|
||
Deploy-To-QA: | ||
Notify-Slack: | ||
needs: [ Build-Sample-Apps-Android ] # , Build-Sample-Apps-iOS ] | ||
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<<EOF" >> $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/[email protected] | ||
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 }} | ||
uses: ./.github/workflows/notifySlack.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Publish Package | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
tag-and-publish: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Extract version from pubspec.yaml | ||
run: | | ||
VERSION=$(grep 'version:' pubspec.yaml | sed 's/version: //') | ||
echo "PACKAGE_VERSION=$VERSION" >> $GITHUB_ENV | ||
shell: bash | ||
|
||
- name: Create Release Tag | ||
run: | | ||
TAG=v${{ steps.extract_version.outputs.PACKAGE_VERSION }} | ||
echo "Creating new tag $TAG" | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git tag $TAG | ||
git push origin $TAG | ||
- name: Publish to pub.dev | ||
run: flutter pub publish --dry-run | ||
env: | ||
PUB_CREDENTIALS: ${{ secrets.PUB_CREDENTIALS }} |