mirror of
https://github.com/DefinedNet/mobile_nebula.git
synced 2025-09-05 10:46:04 +00:00
According to https://github.com/actions/runner-images#available-images, currently `macos-latest` is pointing to macos 14 images, which come bundled with xcode 15. Apple now requires xcode 16, which we'll get by updating to `macos-15`. This also bumps the version github uses to `16.3` (by default it will stay at 16.0), and adds a note to the README that ideally we should all be using the same version of xcode that is used to build the app that is sent to Apple. We could get fancier with this, but I don't think it's really necessary right now. See https://www.polpiella.dev/managing-xcode-installs-using-fastlane for other approaches.
118 lines
4.1 KiB
YAML
118 lines
4.1 KiB
YAML
# This workflow builds the iOS and Android apps, just to check they build without error
|
|
|
|
name: Smoke build
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
pull_request:
|
|
|
|
jobs:
|
|
build-android:
|
|
name: Android
|
|
runs-on: macos-15
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
|
|
with:
|
|
show-progress: false
|
|
|
|
- name: Set up Go 1.22
|
|
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 #5.3.0
|
|
with:
|
|
go-version: '1.22'
|
|
cache-dependency-path: nebula/go.sum
|
|
|
|
- uses: actions/setup-java@3a4f6e1af504cf6a31855fa899c6aa5355ba6c12 #v4.7.0
|
|
with:
|
|
distribution: 'zulu'
|
|
java-version: '17'
|
|
|
|
- name: Install flutter
|
|
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff #v2.18.0
|
|
with:
|
|
flutter-version: '3.29.2'
|
|
|
|
- name: install dependencies
|
|
env:
|
|
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
|
|
run: |
|
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
|
gomobile init
|
|
flutter pub get
|
|
touch env.sh
|
|
|
|
- name: Build Android debug
|
|
run: flutter build appbundle --debug
|
|
|
|
- name: Setup bundletool
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: amyu/setup-bundletool@f7a6fdd8e04bb23d2fdf3c2f60c9257a6298a40a
|
|
- name: Install the google play key material
|
|
if: github.ref == 'refs/heads/main'
|
|
env:
|
|
GOOGLE_PLAY_API_JWT_BASE64: ${{ secrets.GOOGLE_PLAY_API_JWT_BASE64 }}
|
|
GOOGLE_PLAY_KEYSTORE_BASE64: ${{ secrets.GOOGLE_PLAY_KEYSTORE_BASE64 }}
|
|
run: |
|
|
GOOGLE_PLAY_API_JWT_PATH="$RUNNER_TEMP/gp_api.json"
|
|
echo "GOOGLE_PLAY_API_JWT_PATH=$GOOGLE_PLAY_API_JWT_PATH" >> $GITHUB_ENV
|
|
echo -n "$GOOGLE_PLAY_API_JWT_BASE64" | base64 --decode --output "$GOOGLE_PLAY_API_JWT_PATH"
|
|
|
|
GOOGLE_PLAY_KEYSTORE_PATH="$RUNNER_TEMP/gp_signing.jks"
|
|
echo "GOOGLE_PLAY_KEYSTORE_PATH=$GOOGLE_PLAY_KEYSTORE_PATH" >> $GITHUB_ENV
|
|
echo -n "$GOOGLE_PLAY_KEYSTORE_BASE64" | base64 --decode --output "$GOOGLE_PLAY_KEYSTORE_PATH"
|
|
- name: Generate debug apk
|
|
if: github.ref == 'refs/heads/main'
|
|
env:
|
|
TOKEN: ${{ secrets.MACHINE_USER_PAT }}
|
|
GOOGLE_PLAY_KEYSTORE_PASSWORD: ${{ secrets.GOOGLE_PLAY_KEYSTORE_PASSWORD }}
|
|
run: |
|
|
bundletool build-apks \
|
|
--bundle=build/app/outputs/bundle/debug/app-debug.aab \
|
|
--output=build/app/outputs/apk/debug/app-debug.apks \
|
|
--mode=universal \
|
|
--ks=$GOOGLE_PLAY_KEYSTORE_PATH \
|
|
--ks-key-alias=key \
|
|
--ks-pass=pass:$GOOGLE_PLAY_KEYSTORE_PASSWORD
|
|
unzip -p build/app/outputs/apk/debug/app-debug.apks universal.apk > build/app/outputs/apk/debug/app-debug.apk
|
|
- name: Collect debug apk
|
|
if: github.ref == 'refs/heads/main'
|
|
uses: actions/upload-artifact@4cec3d8aa04e39d1a68397de0c4cd6fb9dce8ec1 #4.6.1
|
|
with:
|
|
name: MobileNebulaDebug.apk
|
|
path: build/app/outputs/apk/debug/app-debug.apk
|
|
retention-days: 60
|
|
|
|
build-ios:
|
|
name: iOS
|
|
runs-on: macos-15
|
|
|
|
steps:
|
|
- name: Check out code
|
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #4.2.2
|
|
with:
|
|
show-progress: false
|
|
|
|
- name: Set up Go 1.22
|
|
uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 #5.3.0
|
|
with:
|
|
go-version: '1.22'
|
|
cache-dependency-path: nebula/go.sum
|
|
|
|
- name: Install flutter
|
|
uses: subosito/flutter-action@f2c4f6686ca8e8d6e6d0f28410eeef506ed66aff #v2.18.0
|
|
with:
|
|
flutter-version: '3.29.2'
|
|
|
|
- name: install dependencies
|
|
run: |
|
|
go install golang.org/x/mobile/cmd/gomobile@latest
|
|
gomobile init
|
|
flutter pub get
|
|
touch env.sh
|
|
|
|
- name: Build iOS
|
|
run: |
|
|
cd ios
|
|
pod install
|
|
xcodebuild -workspace Runner.xcworkspace -scheme Runner -configuration Release clean archive CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -archivePath "build/MobileNebula.xcarchive"
|