Merge pull request #15 from ecency/nt/version-type-cast #47
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
name: Distribution | |
on: #events (push and pull_request) | |
push: | |
branches: [ "main" ] | |
#pull_request: | |
# branches: [ "main" ] | |
env: | |
PROPERTIES_PATH: "android/key.properties" | |
jobs: #here we specify the jobs - We could have multiple jobs | |
build-android: #name it something meaningful | |
runs-on: macos-latest #runner: select a machine to use | |
steps: | |
- uses: actions/checkout@v1 | |
- uses: actions/setup-java@v1 | |
with: | |
java-version: '17.x' | |
- uses: subosito/flutter-action@v1 | |
with: | |
channel: 'stable' | |
cache: true | |
- name: Install dependencies | |
run: flutter pub get # action | |
- name: Run clean | |
run: flutter clean | |
- name: Upload-keystore generator | |
run: | | |
echo "${{secrets.UPLOAD_KEYSTORE}}" > upload.keystore.asc | |
base64 -d --input upload.keystore.asc --output android/app/key.jks | |
- name: Key.Properties | |
run: | | |
echo keyPassword=\${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }} > ${{env.PROPERTIES_PATH}} | |
echo storePassword=\${{ secrets.UPLOAD_KEYSTORE_PASSPHRASE }} >> ${{env.PROPERTIES_PATH}} | |
echo keyAlias=\${{ secrets.ALIAS }} >> ${{env.PROPERTIES_PATH}} | |
#- name: Run tests | |
# run: flutter test | |
- name: Build Android appBundle | |
run: flutter build appbundle --release | |
#- name: Build ios | |
# run: flutter build ios --release --no-codesign | |
- name: Upload AAB | |
id: uploadArtifact | |
uses: actions/upload-artifact@v1 | |
with: | |
name: waves-android | |
path: build/app/outputs/bundle/release/app-release.aab | |
- name: Deploy to Play Store (BETA) | |
id: deploy | |
uses: r0adkll/upload-google-play@v1 | |
with: | |
serviceAccountJsonPlainText: ${{ secrets.SERVICE_ACCOUNT_JSON }} | |
packageName: com.ecency.waves | |
releaseFiles: "build/app/outputs/bundle/release/app-release.aab" | |
track: internal | |
status: completed | |
build-ios: | |
runs-on: macos-latest | |
steps: | |
- name: Check out | |
uses: actions/checkout@v1 | |
- name: Install the Apple certificate and provisioning profile | |
env: | |
BUILD_CERTIFICATE_BASE64: ${{ secrets.CERTIFICATES_P12 }} | |
P12_PASSWORD: ${{ secrets.CERTIFICATE_PASSWORD }} | |
BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE }} | |
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_APP_PASS }} | |
run: | | |
# create variables | |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 | |
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db | |
# import certificate and provisioning profile from secrets | |
echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH | |
echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode -o $PP_PATH | |
# create temporary keychain | |
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH | |
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
# import certificate to keychain | |
security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH | |
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH | |
security list-keychain -d user -s $KEYCHAIN_PATH | |
# apply provisioning profile | |
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles | |
- name: Install Flutter | |
uses: subosito/flutter-action@v2 | |
with: | |
channel: 'stable' | |
cache: true | |
- name: Install dependencies | |
run: | | |
flutter pub get | |
dart pub add build_runner --dev | |
- name: Run build_runner build | |
run: dart run build_runner build --delete-conflicting-outputs | |
- name: Building IPA | |
run: | | |
flutter build ipa --release \ | |
--export-options-plist=ios/Runner/ExportOptions.plist | |
- name: Upload to AppStoreConnect | |
env: | |
APPLE_ID: ${{ secrets.APPLE_ID }} | |
APPLE_APP_PASS: ${{ secrets.APPLE_APP_PASS }} | |
run: xcrun altool --upload-app -f "build/ios/ipa/waves.ipa" -t ios -u "$APPLE_ID" -p "$APPLE_APP_PASS" |