diff --git a/.github/workflows/android_release.yml b/.github/workflows/android_release.yml index f3a11d9b5..e8a73021a 100644 --- a/.github/workflows/android_release.yml +++ b/.github/workflows/android_release.yml @@ -1,67 +1,68 @@ name: Android Build/Upload to Play Store Console on: - release: - types: [published] + push: + tags: + - mobile-** jobs: build: runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: set up JDK 11 uses: actions/setup-java@v2 with: java-version: '11' distribution: 'adopt' - name: rustup target add aarch64-linux-android arm-linux-androideabi i686-linux-android x86_64-linux-android run: rustup target add aarch64-linux-android arm-linux-androideabi i686-linux-android x86_64-linux-android - name: Install Protobuf compiler working-directory: ./scripts run: sudo ./install_protobuf.sh - name: Install Yarn run: npm install -g yarn - name: yarn ci-cleaninstall run: yarn ci-cleaninstall - name: Save ALCHEMY_API_KEY to file working-directory: ./native env: ALCHEMY_API_KEY: ${{secrets.ALCHEMY_API_KEY}} run: mkdir -p facts && echo '{"key":"'"$ALCHEMY_API_KEY"'"}' > facts/alchemy.json - name: Save ANDROID_KEY_STORE_B64 to file env: ANDROID_KEY_STORE_B64: ${{secrets.ANDROID_KEY_STORE_B64}} run: echo "$ANDROID_KEY_STORE_B64" > ANDROID_KEY_STORE_B64.b64 - name: Save ANDROID_KEY_STORE to file run: base64 -d ANDROID_KEY_STORE_B64.b64 > android_key_store.keystore - name: Configure gradle.properties run: | mkdir ~/.gradle touch ~/.gradle/gradle.properties echo "COMM_UPLOAD_STORE_FILE=$(pwd)/android_key_store.keystore" >> ~/.gradle/gradle.properties echo "COMM_UPLOAD_KEY_ALIAS=AndroidSigningKey" >> ~/.gradle/gradle.properties - name: Build with Gradle working-directory: ./native/android env: ANDROID_SIGNING_PASSWORD: ${{secrets.ANDROID_SIGNING_PASSWORD}} run: ./gradlew bundleRelease - name: Save PLAY_STORE_PUBLISHING_KEY to file working-directory: ./native/android env: PLAY_STORE_PUBLISHING_KEY: ${{secrets.PLAY_STORE_PUBLISHING_KEY}} run: echo "$PLAY_STORE_PUBLISHING_KEY" > PLAY_STORE_PUBLISHING_KEY.json - name: Upload to Google Play working-directory: ./native/android run: node upload-aab.js diff --git a/.github/workflows/ios_release.yml b/.github/workflows/ios_release.yml index 485edecce..6bd8b8ce1 100644 --- a/.github/workflows/ios_release.yml +++ b/.github/workflows/ios_release.yml @@ -1,82 +1,83 @@ name: iOS Build/Archive/Upload to AppStore Connect on: - release: - types: [published] + push: + tags: + - mobile-** jobs: build: name: Build, archive, and upload iOS app runs-on: macos-12 steps: - name: Checkout uses: actions/checkout@v3 - name: Install Developer certificate env: BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} P12_PASSWORD: ${{ secrets.P12_PASSWORD }} KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }} run: | # create variables CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12 KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db # import certificate from secrets echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_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 list-keychain -d user -s $KEYCHAIN_PATH - name: brew install protobuf run: brew install protobuf - name: npm install -g yarn run: npm install -g yarn - name: yarn ci-cleaninstall run: yarn ci-cleaninstall - name: Save ALCHEMY_API_KEY to file working-directory: ./native env: ALCHEMY_API_KEY: ${{secrets.ALCHEMY_API_KEY}} run: mkdir -p facts && echo '{"key":"'"$ALCHEMY_API_KEY"'"}' > facts/alchemy.json - name: Save auth_key to file working-directory: ./native/ios env: AUTH_KEY: ${{secrets.AUTH_KEY}} run: echo "$AUTH_KEY" > AUTH_KEY.p8 - name: Archive working-directory: ./native/ios env: AUTH_KEY_ID: ${{secrets.AUTH_KEY_ID}} AUTH_KEY_ISSUER_ID: ${{secrets.AUTH_KEY_ISSUER_ID}} run: xcodebuild archive -workspace Comm.xcworkspace -scheme Comm -configuration Release -archivePath archives/Comm.xcarchive -destination generic/platform=iOS -allowProvisioningUpdates -authenticationKeyIssuerID "$AUTH_KEY_ISSUER_ID" -authenticationKeyID "$AUTH_KEY_ID" -authenticationKeyPath $PWD/AUTH_KEY.p8 - name: Export IPA working-directory: ./native/ios env: AUTH_KEY_ID: ${{secrets.AUTH_KEY_ID}} AUTH_KEY_ISSUER_ID: ${{secrets.AUTH_KEY_ISSUER_ID}} run: xcodebuild -exportArchive -archivePath archives/Comm.xcarchive -exportOptionsPlist exportOptions.plist -exportPath output -allowProvisioningUpdates -authenticationKeyIssuerID "$AUTH_KEY_ISSUER_ID" -authenticationKeyID "$AUTH_KEY_ID" -authenticationKeyPath $PWD/AUTH_KEY.p8 - name: Upload IPA to TestFlight working-directory: ./native/ios env: APPLE_USER_NAME: ${{secrets.APPLE_USER_NAME}} APPLE_APP_SPECIFIC_PASSWORD: ${{secrets.APPLE_APP_SPECIFIC_PASSWORD}} run: xcrun altool --upload-app --type ios --file output/Comm.ipa --username "$APPLE_USER_NAME" --password "$APPLE_APP_SPECIFIC_PASSWORD" - name: Clean up keychain if: ${{ always() }} run: security delete-keychain $RUNNER_TEMP/app-signing.keychain-db