mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-29 02:07:39 +08:00
CircleCI: Try to build it on osx
This commit is contained in:
@ -1,22 +1,16 @@
|
|||||||
version: 2
|
version: 2.1
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build_android:
|
||||||
docker:
|
docker:
|
||||||
- image: vhanda/flutter-android:latest
|
- image: vhanda/flutter-android:latest
|
||||||
steps:
|
steps:
|
||||||
- checkout
|
- checkout
|
||||||
- run:
|
- run:
|
||||||
name: Setup Flutter Env
|
name: Setup GitJournal Build Env
|
||||||
command: /opt/flutter/bin/cache/dart-sdk/bin/dart ./scripts/setup_env.dart
|
command: /opt/flutter/bin/cache/dart-sdk/bin/dart ./scripts/setup_env.dart
|
||||||
- run:
|
- run:
|
||||||
name: SSH Problem
|
name: SSH Problem
|
||||||
command: echo 'Host *\n StrictHostKeyChecking no' > ~/.ssh/config
|
command: echo 'Host *\n StrictHostKeyChecking no' > ~/.ssh/config
|
||||||
- run:
|
|
||||||
name: Current Directory
|
|
||||||
command: pwd
|
|
||||||
- run:
|
|
||||||
name: List Directory
|
|
||||||
command: ls -l
|
|
||||||
- run:
|
- run:
|
||||||
name: Test
|
name: Test
|
||||||
command: flutter test -j 1 --coverage --machine | tojunit --output junit.xml
|
command: flutter test -j 1 --coverage --machine | tojunit --output junit.xml
|
||||||
@ -51,3 +45,37 @@ jobs:
|
|||||||
- run:
|
- run:
|
||||||
name: Publish Alpha
|
name: Publish Alpha
|
||||||
command: cd android && fastlane alphaBuild
|
command: cd android && fastlane alphaBuild
|
||||||
|
build_ios:
|
||||||
|
macos:
|
||||||
|
xcode: 11.3.1
|
||||||
|
steps:
|
||||||
|
- checkout
|
||||||
|
- run:
|
||||||
|
name: Install gpg
|
||||||
|
command: brew install gnupg git-crypt md5sha1sum wget
|
||||||
|
- run:
|
||||||
|
name: Install Flutter
|
||||||
|
command: ./scripts/ios_install_flutter.sh
|
||||||
|
- run:
|
||||||
|
name: Setup Environment Variables
|
||||||
|
command: |
|
||||||
|
echo "export PATH=flutter/bin:$PATH" >> $BASH_ENV
|
||||||
|
- run:
|
||||||
|
name: Unlock Secrets
|
||||||
|
command: ./scripts/decrypt_secrets.sh
|
||||||
|
- run:
|
||||||
|
name: Setup GitJournal Build Env
|
||||||
|
command: ./flutter/bin/cache/dart-sdk/bin/dart ./scripts/setup_env.dart
|
||||||
|
- run:
|
||||||
|
name: Setup provisioning profile
|
||||||
|
command: ./scripts/add_ios_keys.sh
|
||||||
|
- run:
|
||||||
|
name: Build App
|
||||||
|
command: ./scripts/build_ios.sh
|
||||||
|
|
||||||
|
workflows:
|
||||||
|
version: 2
|
||||||
|
build_all:
|
||||||
|
jobs:
|
||||||
|
- build_android
|
||||||
|
- build_ios
|
||||||
|
BIN
ios/keys/fastlane_password
Normal file
BIN
ios/keys/fastlane_password
Normal file
Binary file not shown.
@ -1,10 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
if [ -z ${FASTLANE_PASSWORD+x} ]; then
|
|
||||||
echo "Must set FASTLANE_PASSWORD"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
set -eo pipefail
|
set -eo pipefail
|
||||||
|
|
||||||
cd "$(dirname "$0")"
|
cd "$(dirname "$0")"
|
||||||
@ -18,6 +13,8 @@ if [[ $(git status -s | grep -v '??') ]]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
flutter pub get
|
||||||
|
|
||||||
# Download the required libraries
|
# Download the required libraries
|
||||||
export LIBS_URL="https://github.com/GitJournal/ios-libraries/releases/download/v1.1/libs.zip"
|
export LIBS_URL="https://github.com/GitJournal/ios-libraries/releases/download/v1.1/libs.zip"
|
||||||
|
|
||||||
@ -43,7 +40,9 @@ echo "Build Number: $BUILD_NUM"
|
|||||||
BUILD_NAME=$(cat pubspec.yaml | grep version | awk '{ print $2 }' | awk -F "+" '{ print $1 }')
|
BUILD_NAME=$(cat pubspec.yaml | grep version | awk '{ print $2 }' | awk -F "+" '{ print $1 }')
|
||||||
echo "Build Name: $BUILD_NAME"
|
echo "Build Name: $BUILD_NAME"
|
||||||
|
|
||||||
flutter build ios --release --no-codesign --build-number=$BUILD_NUM --build-name=$BUILD_NAME
|
flutter build ios --release --no-codesign --build-number="$BUILD_NUM" --build-name="$BUILD_NAME"
|
||||||
|
|
||||||
cd ios
|
cd ios
|
||||||
|
|
||||||
|
export FASTLANE_PASSWORD=$(cat keys/fastlane_password)
|
||||||
bundle exec fastlane release
|
bundle exec fastlane release
|
||||||
|
10
scripts/ios_install_flutter.sh
Executable file
10
scripts/ios_install_flutter.sh
Executable file
@ -0,0 +1,10 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -eux
|
||||||
|
|
||||||
|
wget https://storage.googleapis.com/flutter_infra/releases/stable/macos/flutter_macos_1.22.4-stable.zip
|
||||||
|
unzip flutter_macos_1.22.4-stable.zip
|
||||||
|
export PATH="$PATH:$(pwd)/flutter/bin"
|
||||||
|
|
||||||
|
flutter precache
|
||||||
|
flutter doctor
|
Reference in New Issue
Block a user