Skip to content

Commit

Permalink
cleanup and move to release-please
Browse files Browse the repository at this point in the history
  • Loading branch information
Grodien committed Aug 6, 2024
1 parent 01ced68 commit b790c1a
Show file tree
Hide file tree
Showing 2 changed files with 81 additions and 42 deletions.
45 changes: 8 additions & 37 deletions .github/workflows/flutter_ios_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,18 @@ jobs:
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.22.2'
- name: Install the Apple signing certificate and appstore connect key
- name: Install the Apple signing certificate
env:
SBB_APPSTORE_BASE64: ${{ secrets.SBB_APPSTORE_BASE64 }}
SBB_APPSTORE_P12_PASSWORD: ${{ secrets.SBB_APPSTORE_P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPSTORE_CONNECT_PRIVATE_KEY_BASE64: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY_BASE64 }}
run: |
# create variables
SBB_CERTIFICATE_PATH=$RUNNER_TEMP/sbb_appstore.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
APPSTORE_CONNECT_PRIVATE_KEY_PATH=~/AuthKey.p8
# import certificate and private key from secrets
# import certificate from secrets
echo -n "$SBB_APPSTORE_BASE64" | base64 --decode -o $SBB_CERTIFICATE_PATH
echo -n "$APPSTORE_CONNECT_PRIVATE_KEY_BASE64" | base64 --decode -o $APPSTORE_CONNECT_PRIVATE_KEY_PATH
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
Expand Down Expand Up @@ -80,35 +77,9 @@ jobs:
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
- run: flutter test
- name: Build and Deploy iOS App DEV
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
run: |
flutter build ipa --flavor dev -t lib/main_dev.dart --release --export-options-plist=ios/exportOptionsRelease.plist
xcodebuild -exportArchive -archivePath "build/ios/archive/DAS Dev.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -authenticationKeyIssuerID "$APPSTORE_CONNECT_ISSUER_ID" -authenticationKeyID "$APPSTORE_CONNECT_KEY_ID" -authenticationKeyPath ~/AuthKey.p8
- name: Build and Deploy iOS App INTE
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
run: |
flutter build ipa --flavor inte -t lib/main_inte.dart --release
xcodebuild -exportArchive -archivePath "build/ios/archive/DAS Inte.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -authenticationKeyIssuerID "$APPSTORE_CONNECT_ISSUER_ID" -authenticationKeyID "$APPSTORE_CONNECT_KEY_ID" -authenticationKeyPath ~/AuthKey.p8
- name: Build and Deploy iOS App PROD
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
run: |
flutter build ipa --flavor prod -t lib/main_prod.dart --release
xcodebuild -exportArchive -archivePath "build/ios/archive/DAS.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -authenticationKeyIssuerID "$APPSTORE_CONNECT_ISSUER_ID" -authenticationKeyID "$APPSTORE_CONNECT_KEY_ID" -authenticationKeyPath ~/AuthKey.p8
- name: Archive Apps
uses: actions/upload-artifact@v4
with:
name: Build
path: |
das_client/build/ios/archive/**
das_client/build/ios/ipa/**
das_client/build/ios/iphoneos/**
retention-days: 1


- name: Build iOS App DEV
run: flutter build ios --flavor dev -t lib/main_dev.dart --release
- name: Build iOS App INTE
run: flutter build ios --flavor inte -t lib/main_inte.dart --release
- name: Build iOS App PROD
run: flutter build ios --flavor prod -t lib/main_prod.dart --release
78 changes: 73 additions & 5 deletions .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,85 @@ jobs:
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '11'
java-version: '17'
- uses: subosito/flutter-action@v2
with:
flutter-version: '3.19.2'
- run: flutter pub get
- run: flutter test
- run: flutter build appbundle
flutter-version: '3.22.2'
- name: Upload Release Artifact
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: gh release upload ${{ needs.release-please.outputs.das_client--tag_name }} build/app/outputs/bundle/release/app-release.aab
- name: Install the Apple signing certificate and appstore connect key
env:
SBB_APPSTORE_BASE64: ${{ secrets.SBB_APPSTORE_BASE64 }}
SBB_APPSTORE_P12_PASSWORD: ${{ secrets.SBB_APPSTORE_P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
APPSTORE_CONNECT_PRIVATE_KEY_BASE64: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY_BASE64 }}
run: |
# create variables
SBB_CERTIFICATE_PATH=$RUNNER_TEMP/sbb_appstore.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
APPSTORE_CONNECT_PRIVATE_KEY_PATH=~/AuthKey.p8
# import certificate and private key from secrets
echo -n "$SBB_APPSTORE_BASE64" | base64 --decode -o $SBB_CERTIFICATE_PATH
echo -n "$APPSTORE_CONNECT_PRIVATE_KEY_BASE64" | base64 --decode -o $APPSTORE_CONNECT_PRIVATE_KEY_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 $SBB_CERTIFICATE_PATH -P "$SBB_APPSTORE_P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple: -k "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
- name: 'Download Provisioning Profiles DEV'
uses: apple-actions/download-provisioning-profiles@v3
with:
bundle-id: 'ch.sbb.das.dev'
issuer-id: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
- name: 'Download Provisioning Profiles INTE'
uses: apple-actions/download-provisioning-profiles@v3
with:
bundle-id: 'ch.sbb.das.inte'
issuer-id: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
- name: 'Download Provisioning Profiles PROD'
uses: apple-actions/download-provisioning-profiles@v3
with:
bundle-id: 'ch.sbb.das'
issuer-id: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
api-key-id: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
api-private-key: ${{ secrets.APPSTORE_CONNECT_PRIVATE_KEY }}
- run: |
flutter pub get
flutter pub run build_runner build --delete-conflicting-outputs
- name: Build and Deploy iOS App DEV
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
run: |
flutter build ipa --flavor dev -t lib/main_dev.dart --release
xcodebuild -exportArchive -archivePath "build/ios/archive/DAS Dev.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -authenticationKeyIssuerID "$APPSTORE_CONNECT_ISSUER_ID" -authenticationKeyID "$APPSTORE_CONNECT_KEY_ID" -authenticationKeyPath ~/AuthKey.p8
- name: Build and Deploy iOS App INTE
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
run: |
flutter build ipa --flavor inte -t lib/main_inte.dart --release
xcodebuild -exportArchive -archivePath "build/ios/archive/DAS Inte.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -authenticationKeyIssuerID "$APPSTORE_CONNECT_ISSUER_ID" -authenticationKeyID "$APPSTORE_CONNECT_KEY_ID" -authenticationKeyPath ~/AuthKey.p8
- name: Build and Deploy iOS App PROD
env:
APPSTORE_CONNECT_KEY_ID: ${{ secrets.APPSTORE_CONNECT_KEY_ID }}
APPSTORE_CONNECT_ISSUER_ID: ${{ secrets.APPSTORE_CONNECT_ISSUER_ID }}
run: |
flutter build ipa --flavor prod -t lib/main_prod.dart --release
xcodebuild -exportArchive -archivePath "build/ios/archive/DAS.xcarchive" -exportOptionsPlist ios/exportOptionsRelease.plist -authenticationKeyIssuerID "$APPSTORE_CONNECT_ISSUER_ID" -authenticationKeyID "$APPSTORE_CONNECT_KEY_ID" -authenticationKeyPath ~/AuthKey.p8
backend-release:
needs: release-please
if: needs.release-please.outputs.playground-backend--release_created
Expand Down

0 comments on commit b790c1a

Please sign in to comment.