Skip to content

Commit

Permalink
chore: Add android and fix ios CD
Browse files Browse the repository at this point in the history
  • Loading branch information
lsaudon committed Jul 9, 2024
1 parent d81a8cc commit 59d1334
Showing 1 changed file with 39 additions and 14 deletions.
53 changes: 39 additions & 14 deletions .github/workflows/example_cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,67 @@ env:
FLUTTER_VERSION: 3.22.2

jobs:
continuous-delivery-ios:
continuous_delivery_android:
runs-on: ubuntu-latest
steps:
- name: 📚 Git checkout
uses: actions/checkout@v4
- name: 📂 Ajouter le fichier keystore
working-directory: example/android/app
run: echo "${{ secrets.DEV_ANDROID_KEYSTORE }}" | base64 --decode > example.keystore
- name: 📝 Ajouter le fichier properties
working-directory: example/android
run: echo ${{ secrets.DEV_ANDROID_KEY_PROPERTIES }} | base64 --decode > key.properties
- name: 🐦 Install flutter
uses: subosito/flutter-action@v2
with:
cache: true
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: 🧱 Construire l'application
working-directory: example
run: flutter build appbundle
env:
JAVA_HOME: /usr/lib/jvm/temurin-17-jdk-amd64
- name: 🗑️ Nettoyer les fichiers secrets
if: always()
run: rm -f example/android/app/example.keystore example/android/key.properties

continuous_delivery_ios:
runs-on: macos-latest
steps:
- name: 📚 Git checkout
uses: actions/checkout@v4
- name: 🗒️🔏 Ajouter le certificat de signature
run: |
# Créer un trousseau temporaire
keychainPassword=$(openssl rand -base64 50)
security create-keychain -p "$keychainPassword" temp.keychain
security set-keychain-settings -lut 21600 temp.keychain
security unlock-keychain -p "$keychainPassword" temp.keychain
# Importer le certificat de signature
echo "${{ secrets.DEV_IOS_P12_FILE }}" | base64 --decode -o certificat.p12
echo "${{ secrets.DEV_IOS_P12_FILE }}" | base64 --decode > certificat.p12
security import certificat.p12 -P "${{ secrets.DEV_IOS_P12_PASSWORD }}" -A -t cert -f pkcs12 -k temp.keychain
security list-keychain -d user -s temp.keychain
security set-key-partition-list -S apple-tool:,apple: -s -k "$keychainPassword" temp.keychain
- name: 📱🔏 Ajouter le profil de provisionnement et le fichier exportOptions
run: |
echo ${{ secrets.DEV_IOS_PROFILE }} | base64 --decode -o profile.mobileprovision
echo ${{ secrets.DEV_IOS_PROFILE }} | base64 --decode > profile.mobileprovision
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
uuid=`security cms -D -i profile.mobileprovision | grep -aA1 UUID | grep -o "[-a-zA-Z0-9]\{36\}"`
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/$uuid.mobileprovision
cp profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision
echo ${{ secrets.DEV_IOS_EXPORT_OPTIONS }} | base64 --decode -o exportOptions.plist
echo ${{ secrets.DEV_IOS_EXPORT_OPTIONS }} | base64 --decode > exportOptions.plist
- name: 🐦 Install flutter
uses: subosito/flutter-action@v2
with:
cache: true
channel: stable
flutter-version: ${{ env.FLUTTER_VERSION }}
- name: 📦 Installer les dépendances
run: |
cd example
flutter pub get
- name: 🧱 Construire l'application
working-directory: example
run: flutter build ipa --export-options-plist ../exportOptions.plist
- name: 🗑️ Nettoyer les fichiers secrets
if: always()
run: |
cd example
flutter build ipa --no-pub --release --export-options-plist ../exportOptions.plist -v
rm -f certificat.p12 profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/profile.mobileprovision exportOptions.plist
security delete-keychain temp.keychain

0 comments on commit 59d1334

Please sign in to comment.