Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flavors to Wallet and Dapp samples #300

Merged
merged 6 commits into from
Jul 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .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 All @@ -8,7 +8,7 @@ on:

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

steps:
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
11 changes: 6 additions & 5 deletions .github/workflows/release_dapp_ios.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: iOS Web3Dapp deploy
name: iOS Web3Dapp (production) deploy

on:
workflow_dispatch:
Expand All @@ -8,7 +8,7 @@ on:

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

steps:
Expand Down Expand Up @@ -43,13 +43,13 @@ jobs:
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })

# flutter build ipa --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --release
flutter build ios --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release
flutter build ios --flavor production --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release

# Fastlane
- name: Fastlane
working-directory: example/dapp/ios
env:
BUNDLE_ID: "com.walletconnect.flutterdapp"
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_DAPP_ID: ${{ secrets.APPLE_DAPP_ID }}
PROJECT_ID: ${{ secrets.DAPP_PROJECT_ID }}
Expand All @@ -60,14 +60,15 @@ 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)
PARTS=(${FILE_VALUE//:/ })
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })

fastlane release_testflight username:$APPLE_ID token:$GH_BASIC_AUTH project_id:$PROJECT_ID app_id:$APPLE_DAPP_ID app_store_key_id:$APP_STORE_KEY_ID apple_issuer_id:$APPLE_ISSUER_ID app_store_connect_key:"$APP_STORE_CONNECT_KEY" match_git_url:$MATCH_GIT_URL app_version:$VERSION_NUMBER
fastlane release_testflight username:$APPLE_ID token:$GH_BASIC_AUTH project_id:$PROJECT_ID app_id:$APPLE_DAPP_ID app_store_key_id:$APP_STORE_KEY_ID apple_issuer_id:$APPLE_ISSUER_ID app_store_connect_key:"$APP_STORE_CONNECT_KEY" match_git_url:$MATCH_GIT_URL app_version:$VERSION_NUMBER flavor:production

# 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_ios.yml
74 changes: 74 additions & 0 deletions .github/workflows/release_dapp_ios_internal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: iOS 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

# Cache
- name: Cache
uses: actions/cache@v3
with:
path: |
.build
SourcePackagesCache
DerivedDataCache
key: ${{ runner.os }}-spm-${{ hashFiles('**/Package.resolved') }}
restore-keys: |
${{ runner.os }}-spm-

# Install Flutter and Dependencies
- uses: ./.github/actions/dependencies

# Build App
- name: Build App
working-directory: example/dapp
env:
PROJECT_ID: ${{ secrets.DAPP_PROJECT_ID }}
run: |
PUBSPEC_FILE=../../pubspec.yaml
FILE_VALUE=$(echo | grep "^version: " $PUBSPEC_FILE)
PARTS=(${FILE_VALUE//:/ })
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })

flutter build ios --flavor internal --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release

# Fastlane
- name: Fastlane
working-directory: example/dapp/ios
env:
BUNDLE_ID: "com.walletconnect.flutterdapp.internal"
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_DAPP_ID: ${{ secrets.APPLE_DAPP_ID_INTERNAL }}
PROJECT_ID: ${{ secrets.DAPP_PROJECT_ID }}
MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
APP_STORE_KEY_ID: ${{ secrets.APP_STORE_KEY_ID }}
APPLE_ISSUER_ID: ${{ secrets.APPLE_ISSUER_ID }}
GH_BASIC_AUTH: ${{ secrets.GH_BASIC_AUTH }}
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)
PARTS=(${FILE_VALUE//:/ })
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })

fastlane release_testflight username:$APPLE_ID token:$GH_BASIC_AUTH project_id:$PROJECT_ID app_id:$APPLE_DAPP_ID app_store_key_id:$APP_STORE_KEY_ID apple_issuer_id:$APPLE_ISSUER_ID app_store_connect_key:"$APP_STORE_CONNECT_KEY" match_git_url:$MATCH_GIT_URL app_version:$VERSION_NUMBER flavor:internal

# 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_ios_internal.yml
5 changes: 4 additions & 1 deletion .github/workflows/release_wallet_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ on:

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

steps:
Expand Down Expand Up @@ -43,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
11 changes: 6 additions & 5 deletions .github/workflows/release_wallet_ios.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: iOS Web3Wallet deploy
name: iOS Web3Wallet (production) deploy

on:
workflow_dispatch:
Expand All @@ -8,7 +8,7 @@ on:

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

steps:
Expand Down Expand Up @@ -43,13 +43,13 @@ jobs:
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })

# flutter build ipa --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --release
flutter build ios --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release
flutter build ios --flavor production --build-name $VERSION_NUMBER --dart-define="PROJECT_ID=$PROJECT_ID" --config-only --release

# Fastlane
- name: Fastlane
working-directory: example/wallet/ios
env:
BUNDLE_ID: "com.walletconnect.flutterwallet"
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_DAPP_ID: ${{ secrets.APPLE_WALLET_ID }}
PROJECT_ID: ${{ secrets.WALLET_PROJECT_ID }}
Expand All @@ -60,14 +60,15 @@ 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)
PARTS=(${FILE_VALUE//:/ })
FULL_VERSION=${PARTS[1]}
VERSION_NUMBER=(${FULL_VERSION//-/ })

fastlane release_testflight username:$APPLE_ID token:$GH_BASIC_AUTH project_id:$PROJECT_ID app_id:$APPLE_DAPP_ID app_store_key_id:$APP_STORE_KEY_ID apple_issuer_id:$APPLE_ISSUER_ID app_store_connect_key:"$APP_STORE_CONNECT_KEY" match_git_url:$MATCH_GIT_URL app_version:$VERSION_NUMBER
fastlane release_testflight username:$APPLE_ID token:$GH_BASIC_AUTH project_id:$PROJECT_ID app_id:$APPLE_DAPP_ID app_store_key_id:$APP_STORE_KEY_ID apple_issuer_id:$APPLE_ISSUER_ID app_store_connect_key:"$APP_STORE_CONNECT_KEY" match_git_url:$MATCH_GIT_URL app_version:$VERSION_NUMBER flavor:production

# 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_ios.yml
Loading
Loading