CI #2426
This file contains hidden or 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: CI | |
| on: | |
| push: | |
| branches: [ master, anytime_integration_new ] | |
| pull_request: | |
| branches: [ master, anytime_integration_new ] | |
| workflow_dispatch: | |
| jobs: | |
| build: | |
| runs-on: macOS-15 | |
| env: | |
| P12_BASE64: ${{ secrets.P12_BASE64 }} | |
| P12_PASSWORD: ${{ secrets.P12_PASSWORD }} | |
| PROVISIONING_PROFILE_BASE64: ${{ secrets.PROVISIONING_PROFILE_BASE64 }} | |
| steps: | |
| - name: Disk Cleanup | |
| run: | | |
| echo "::group::Free space before cleanup" | |
| df -hI | |
| echo "::endgroup::" | |
| echo "::group::Cleaned Files" | |
| sudo rm -rf /Users/runner/Library/Android/sdk & | |
| sudo rm -rf /Applications/Xcode_15.4.app & | |
| sudo rm -rf /Applications/Xcode_16.1.app & | |
| sudo rm -rf /Applications/Xcode_16.2.app & | |
| sudo rm -rf /Applications/Xcode_16.3_Release_Candidate_2.app & | |
| wait | |
| echo "::endgroup::" | |
| echo "::group::Free space after cleanup" | |
| df -hI | |
| echo "::endgroup::" | |
| - name: ποΈ Check-out breezmobile repository | |
| uses: actions/checkout@v4 | |
| - name: ποΈ Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: '1.23.8' | |
| - name: ποΈ Setup Flutter | |
| uses: subosito/flutter-action@v2 | |
| with: | |
| flutter-version: '3.7.12' | |
| channel: 'stable' | |
| cache: true | |
| - name: π Install SSH Key | |
| uses: shimataro/ssh-key-action@v2 | |
| with: | |
| key: ${{ secrets.SSH_KEY }} | |
| known_hosts: ${{ secrets.KNOWN_HOSTS }} | |
| - name: π Install Keychain keys | |
| run: | | |
| KEYCHAIN_PATH=$RUNNER_TEMP/ios-build.keychain | |
| security create-keychain -p ci $KEYCHAIN_PATH | |
| security default-keychain -s $KEYCHAIN_PATH | |
| security unlock-keychain -p ci $KEYCHAIN_PATH | |
| security set-keychain-settings -t 6400 -l $KEYCHAIN_PATH | |
| P12_KEY_PATH=$RUNNER_TEMP/key.p12 | |
| echo -n "$P12_BASE64" | base64 --decode -o $P12_KEY_PATH | |
| security import $P12_KEY_PATH -k $KEYCHAIN_PATH -P "$P12_PASSWORD" -T /usr/bin/codesign -T /usr/bin/security | |
| security set-key-partition-list -S apple-tool:,apple: -s -k ci $KEYCHAIN_PATH > /dev/null | |
| rm -f $P12_KEY_PATH | |
| - name: π Install Provisioning Profile | |
| run: | | |
| PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision | |
| echo -n "$PROVISIONING_PROFILE_BASE64" | base64 --decode > $PP_PATH | |
| mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles | |
| cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles/ | |
| rm -f $PP_PATH | |
| - name: ποΈ Check-out Breez SDK repository | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: breez/breez | |
| path: breez | |
| - name: π¦ Install Breez SDK dependencies | |
| run: | | |
| go install golang.org/x/mobile/cmd/gomobile@v0.0.0-20250408133729-978277e7eaf7 | |
| go install golang.org/x/mobile/cmd/gobind@v0.0.0-20250408133729-978277e7eaf7 | |
| - name: π¨ Build Breez SDK bindings | |
| run: | | |
| cd breez | |
| export GOPRIVATE=github.com/btcsuite/btcd | |
| mkdir -p build/ios | |
| gomobile bind -iosversion=12.4 -target=ios -tags="ios experimental signrpc walletrpc chainrpc invoicesrpc routerrpc backuprpc peerrpc submarineswaprpc breezbackuprpc" -o build/ios/bindings.xcframework -ldflags="-s -w" github.com/breez/breez/bindings | |
| - name: βοΈ Setup configuration | |
| run: | | |
| cp -r $GITHUB_WORKSPACE/breez/build/ios/bindings.xcframework $GITHUB_WORKSPACE/ios/bindings.xcframework | |
| rm -rf $GITHUB_WORKSPACE/conf | |
| git clone builderfiles@packages.breez.technology:configuration -b production $GITHUB_WORKSPACE/temp_config | |
| cp -r $GITHUB_WORKSPACE/temp_config/conf $GITHUB_WORKSPACE/conf | |
| sftp builderfiles@packages.breez.technology:config/conf/GoogleService-Info.plist $GITHUB_WORKSPACE/ios/Runner/GoogleService-Info.plist | |
| - name: π Build app | |
| run: | | |
| flutter clean | |
| flutter build ios --no-codesign --no-tree-shake-icons | |
| - name: π¨ Build archive | |
| working-directory: ios | |
| run: | | |
| buildNumber=$(($GITHUB_RUN_NUMBER + 4000)).1 | |
| GOOGLE_SIGN_IN_URL=$(/usr/libexec/PlistBuddy -c "Print :REVERSED_CLIENT_ID" Runner/GoogleService-Info.plist) | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleURLTypes:0:CFBundleURLSchemes:0 $GOOGLE_SIGN_IN_URL" Runner/Info.plist | |
| /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" Runner/Info.plist | |
| xcodebuild \ | |
| -workspace Runner.xcworkspace \ | |
| -scheme Runner \ | |
| -sdk iphoneos \ | |
| -configuration Release \ | |
| -archivePath $PWD/build/Runner.xcarchive \ | |
| archive | |
| - name: π€ Export archive | |
| working-directory: ios | |
| run: | | |
| xcodebuild \ | |
| -exportArchive \ | |
| -archivePath $PWD/build/Runner.xcarchive \ | |
| -exportOptionsPlist ExportOptions.plist \ | |
| -exportPath $PWD/build/Runner.app | |
| - name: π± Publish to TestFlight | |
| env: | |
| APP_USERNAME: ${{ secrets.APP_USERNAME }} | |
| APP_PASSWORD: ${{ secrets.APP_PASSWORD }} | |
| working-directory: ios | |
| run: | | |
| altool="$(dirname "$(xcode-select -p)")/Developer/usr/bin/altool" | |
| ipa="$PWD/build/Runner.app/breez.ipa" | |
| "$altool" --upload-app --type ios --file "$ipa" --username $APP_USERNAME --password $APP_PASSWORD |