From 3c41c1c4c22ad62d1ae03fc19585e2c1617dcee4 Mon Sep 17 00:00:00 2001 From: Jonas Anker Rasmussen Date: Sat, 14 Oct 2023 22:11:21 +0200 Subject: [PATCH] Use positional arguments in scripts --- .github/scripts/build-dev.sh | 3 +++ .github/scripts/build-prod.sh | 3 +++ .github/workflows/build.yml | 12 ++++-------- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/scripts/build-dev.sh b/.github/scripts/build-dev.sh index ea835c2b9..016fa33a0 100755 --- a/.github/scripts/build-dev.sh +++ b/.github/scripts/build-dev.sh @@ -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" diff --git a/.github/scripts/build-prod.sh b/.github/scripts/build-prod.sh index 789bba9b5..db111ed99 100755 --- a/.github/scripts/build-prod.sh +++ b/.github/scripts/build-prod.sh @@ -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 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eb6041973..e1ea81f3c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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 }} @@ -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