Skip to content

Commit

Permalink
final modifications
Browse files Browse the repository at this point in the history
  • Loading branch information
quetool committed Jul 22, 2024
1 parent 4f1a2e3 commit 1a262f9
Show file tree
Hide file tree
Showing 12 changed files with 154 additions and 17 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/release_dapp_android.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Android Web3Dapp deploy
name: Android Web3Dapp (production) deploy

on:
workflow_dispatch:
Expand Down Expand Up @@ -43,10 +43,12 @@ jobs:
- name: Fastlane
working-directory: example/dapp/android
env:
FLAVOR: "production"
PROJECT_ID: ${{ secrets.DAPP_PROJECT_ID }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_DAPP_ID: ${{ secrets.FIREBASE_DAPP_ID }}
DOWNLOAD_URL: ${{ secrets.DOWNLOAD_URL_DAPP }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/release_dapp_android_internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Android Web3Dapp (internal) deploy

on:
workflow_dispatch:
pull_request:
types:
- closed

jobs:
build:
if: (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop') || github.event_name == 'workflow_dispatch'
runs-on: macos-latest-xlarge

steps:
# Checkout the repo
- name: Checkout repository
uses: actions/checkout@v4

# Install Java 17
- name: Install Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
architecture: x86_64
cache: 'gradle'

# Cache Gradle
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Install Flutter and Dependencies
- uses: ./.github/actions/dependencies

# Fastlane
- name: Fastlane
working-directory: example/dapp/android
env:
FLAVOR: "internal"
PROJECT_ID: ${{ secrets.DAPP_PROJECT_ID }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_DAPP_ID: ${{ secrets.FIREBASE_DAPP_ID_INTERNAL }}
DOWNLOAD_URL: ${{ secrets.DOWNLOAD_URL_DAPP_INTERNAL }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
PARTS=(${FILE_VALUE//:/ })
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })
fastlane add_plugin firebase_app_distribution
fastlane release_firebase project_id:$PROJECT_ID app_version:$VERSION_NUMBER
# Launch locally
# act -j build --container-architecture linux/amd64 -P macos-latest-xlarge=-self-hosted --secret-file .github/workflows/.env.secret -W .github/workflows/release_dapp_android.yml
1 change: 1 addition & 0 deletions .github/workflows/release_dapp_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TESTFLIGHT_URL: ${{ secrets.TESTFLIGHT_URL_DAPP }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_dapp_ios_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TESTFLIGHT_URL: ${{ secrets.TESTFLIGHT_URL_DAPP_INTERNAL }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release_wallet_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ jobs:
- name: Fastlane
working-directory: example/wallet/android
env:
FLAVOR: "production"
PROJECT_ID: ${{ secrets.WALLET_PROJECT_ID }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_WALLET_ID: ${{ secrets.FIREBASE_WALLET_ID }}
DOWNLOAD_URL: ${{ secrets.DOWNLOAD_URL_WALLET }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/release_wallet_android_internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Android Web3Wallet deploy

on:
workflow_dispatch:
pull_request:
types:
- closed

jobs:
build:
# if: github.event.pull_request.merged == true
if: (github.event.pull_request.merged == true && github.event.pull_request.base.ref == 'develop') || github.event_name == 'workflow_dispatch'
runs-on: macos-latest-xlarge

steps:
# Checkout the repo
- name: Checkout repository
uses: actions/checkout@v4

# Install Java 17
- name: Install Java 17
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
architecture: x86_64
cache: 'gradle'

# Cache Gradle
- name: Cache Gradle
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
# Install Flutter and Dependencies
- uses: ./.github/actions/dependencies

# Fastlane
- name: Fastlane
working-directory: example/wallet/android
env:
FLAVOR: "internal"
PROJECT_ID: ${{ secrets.WALLET_PROJECT_ID }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
FIREBASE_TOKEN: ${{ secrets.FIREBASE_TOKEN }}
FIREBASE_WALLET_ID: ${{ secrets.FIREBASE_WALLET_ID_INTERNAL }}
DOWNLOAD_URL: ${{ secrets.DOWNLOAD_URL_WALLET_INTERNAL }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
PARTS=(${FILE_VALUE//:/ })
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })
fastlane add_plugin firebase_app_distribution
fastlane release_firebase project_id:$PROJECT_ID app_version:$VERSION_NUMBER
# Launch locally
# act -j build --container-architecture linux/amd64 -P macos-latest-xlarge=-self-hosted --secret-file .github/workflows/.env.secret -W .github/workflows/release_wallet_android.yml
1 change: 1 addition & 0 deletions .github/workflows/release_wallet_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TESTFLIGHT_URL: ${{ secrets.TESTFLIGHT_URL_WALLET }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/release_wallet_ios_internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ jobs:
APP_STORE_CONNECT_KEY: ${{ secrets.APP_STORE_CONNECT_KEY }}
MATCH_GIT_URL: ${{ secrets.MATCH_GIT_URL }}
SLACK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
TESTFLIGHT_URL: ${{ secrets.TESTFLIGHT_URL_WALLET_INTERNAL }}
run: |
PUBSPEC_FILE=../../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
Expand Down
12 changes: 6 additions & 6 deletions example/dapp/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ platform :android do
slack_url = ENV['SLACK_URL']
firebase_token = ENV['FIREBASE_TOKEN']
firebase_dapp_id = ENV['FIREBASE_DAPP_ID']
_flavor = ENV['FLAVOR']
_download_url = ENV['DOWNLOAD_URL']

_latest_release = firebase_app_distribution_get_latest_release(
app: "#{firebase_dapp_id}",
Expand All @@ -58,32 +60,30 @@ platform :android do
_project_id = "#{options[:project_id]}"

# gradle(task: 'assemble', build_type: 'Release')
sh "flutter build apk --build-name #{_app_version} --build-number #{_new_build_number} --dart-define='PROJECT_ID=#{_project_id}' --release"
sh "flutter build apk --build-name #{_app_version} --build-number #{_new_build_number} --dart-define='PROJECT_ID=#{_project_id}' --flavor #{_flavor} --release"

changelog = read_changelog

firebase_app_distribution(
app: "#{firebase_dapp_id}",
groups: "flutter-team, javascript-team, kotlin-team, rust-team, unity, wc-testers",
android_artifact_path: '../build/app/outputs/flutter-apk/app-release.apk',
android_artifact_path: "../build/app/outputs/flutter-apk/app-#{_flavor}-release.apk",
release_notes: changelog,
android_artifact_type: "APK",
)

slack(
message: "📱 Web3Dapp Flutter #{_app_version} (#{_new_build_number}) for 🤖 Android successfully released!\n\n",
message: "📱 Web3Dapp Flutter #{_app_version}-#{_flavor} (#{_new_build_number}) for 🤖 Android successfully released!\n\n",
default_payloads: [],
attachment_properties: {
fields: [
{
title: "CHANGELOG",
value: changelog,
# short: true
},
{
title: "LINK",
value: "https://appdistribution.firebase.dev/i/2c6573f6956fa7b5",
# short: true
value: "#{_download_url}",
},
]
}
Expand Down
5 changes: 3 additions & 2 deletions example/dapp/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ platform :ios do
match_password = ENV['MATCH_PASSWORD']
slack_url = ENV['SLACK_URL']
app_identifier = ENV['BUNDLE_ID']
_testflight_url = ENV['TESTFLIGHT_URL']

api_key = app_store_connect_api_key(
key_id: options[:app_store_key_id],
Expand Down Expand Up @@ -124,8 +125,8 @@ platform :ios do
value: changelog,
},
{
title: "BUNDLE ID",
value: app_identifier,
title: "LINK",
value: "#{_testflight_url}",
},
]
}
Expand Down
12 changes: 6 additions & 6 deletions example/wallet/android/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ platform :android do
slack_url = ENV['SLACK_URL']
firebase_token = ENV['FIREBASE_TOKEN']
firebase_wallet_id = ENV['FIREBASE_WALLET_ID']
_flavor = ENV['FLAVOR']
_download_url = ENV['DOWNLOAD_URL']

_latest_release = firebase_app_distribution_get_latest_release(
app: "#{firebase_wallet_id}",
Expand All @@ -58,32 +60,30 @@ platform :android do
_project_id = "#{options[:project_id]}"

# gradle(task: 'assemble', build_type: 'Release')
sh "flutter build apk --build-name #{_app_version} --build-number #{_new_build_number} --dart-define='PROJECT_ID=#{_project_id}' --release"
sh "flutter build apk --build-name #{_app_version} --build-number #{_new_build_number} --dart-define='PROJECT_ID=#{_project_id}' --flavor #{_flavor} --release"

changelog = read_changelog

firebase_app_distribution(
app: "#{firebase_wallet_id}",
groups: "flutter-team, javascript-team, kotlin-team, rust-team, unity, wc-testers",
android_artifact_path: '../build/app/outputs/flutter-apk/app-release.apk',
android_artifact_path: "../build/app/outputs/flutter-apk/app-#{_flavor}-release.apk",
release_notes: changelog,
android_artifact_type: "APK",
)

slack(
message: "🔐 Web3Wallet Flutter #{_app_version} (#{_new_build_number}) for 🤖 Android successfully released!\n\n",
message: "🔐 Web3Wallet Flutter #{_app_version}-#{_flavor} (#{_new_build_number}) for 🤖 Android successfully released!\n\n",
default_payloads: [],
attachment_properties: {
fields: [
{
title: "CHANGELOG",
value: changelog,
# short: true
},
{
title: "LINK",
value: "https://appdistribution.firebase.dev/i/2b8b3dce9e2831cd",
# short: true
value: "#{_download_url}",
},
]
}
Expand Down
5 changes: 3 additions & 2 deletions example/wallet/ios/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ platform :ios do
match_password = ENV['MATCH_PASSWORD']
slack_url = ENV['SLACK_URL']
app_identifier = ENV['BUNDLE_ID']
_testflight_url = ENV['TESTFLIGHT_URL']

api_key = app_store_connect_api_key(
key_id: options[:app_store_key_id],
Expand Down Expand Up @@ -123,8 +124,8 @@ platform :ios do
value: changelog,
},
{
title: "BUNDLE ID",
value: app_identifier,
title: "LINK",
value: "#{_testflight_url}",
},
]
}
Expand Down

0 comments on commit 1a262f9

Please sign in to comment.