Skip to content

Commit

Permalink
Use positional arguments in scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasanker committed Oct 14, 2023
1 parent 443f4ee commit 3c41c1c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 3 additions & 0 deletions .github/scripts/build-dev.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#! /bin/bash

BUILD_NAME=$1
BUILD_NUMBER=$2

flutter build ios --flavor development --release --no-codesign --build-name $BUILD_NAME --build-number $BUILD_NUMBER --target lib/main_development.dart
xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme development -configuration Release-development
xcodebuild -workspace ios/Runner.xcworkspace -scheme development -configuration Release-development DEVELOPMENT_TEAM=Y5U9T77F2K -sdk 'iphoneos' -destination 'generic/platform=iOS' -archivePath build-output/app.xcarchive PROVISIONING_PROFILE_SPECIFIER="development" clean archive CODE_SIGN_IDENTITY="iPhone Developer"
Expand Down
3 changes: 3 additions & 0 deletions .github/scripts/build-prod.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#! /bin/bash

BUILD_NAME=$1
BUILD_NUMBER=$2

sed -i '' 's/.env.develop/.env.production/' lib/env/env.dart
flutter build ios --flavor production --release --no-codesign --build-name $BUILD_NAME --build-number $BUILD_NUMBER --target lib/main_production.dart
xcodebuild -resolvePackageDependencies -workspace ios/Runner.xcworkspace -scheme production -configuration Release-production
Expand Down
12 changes: 4 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,17 +98,11 @@ jobs:

- name: Create Development build
if: env.DEV_RELEASE == 'true'
run: .github/scripts/build-dev.sh
env:
BUILD_NAME: ${{ needs.version.outputs.version }}
BUILD_NUMBER: ${{ needs.version.outputs.build_version }}
run: .github/scripts/build-dev.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }}

- name: Create Production build
if: env.PROD_RELEASE == 'true'
run: .github/scripts/build-prod.sh
env:
BUILD_NAME: ${{ needs.version.outputs.version }}
BUILD_NUMBER: ${{ needs.version.outputs.build_version }}
run: .github/scripts/build-prod.sh ${{ needs.version.outputs.version }} ${{ needs.version.outputs.build_version }}

- name: Upload iOS build
if: ${{ inputs.storeArtifacts }}
Expand Down Expand Up @@ -152,9 +146,11 @@ jobs:
- name: Build appbundle (dev)
if: env.DEV_RELEASE == 'true'
run: flutter build apk --flavor development --release --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_development.dart

- name: Build appbundle (prod)
if: env.PROD_RELEASE== 'true'
run: flutter build apk --flavor production --release --dart-define=IS_PROD=true --build-name ${{ needs.version.outputs.version }} --build-number ${{ needs.version.outputs.build_version }} --target lib/main_production.dart

- name: Upload Android build
if: ${{ inputs.storeArtifacts }}
uses: actions/upload-artifact@v3
Expand Down

0 comments on commit 3c41c1c

Please sign in to comment.