From 4b708b74a307e99404909ce57d1d405e285a8cc5 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Sat, 19 Apr 2025 23:38:08 +0200 Subject: [PATCH] try more modular approach --- .gitea/workflows/frontend_deploy-beta.yaml | 49 +++++++++++++++++++ .gitea/workflows/frontend_deploy-release.yaml | 47 ++++++++++++++++++ ...d.yaml => workflow_build-app-android.yaml} | 41 +++++++++------- ...p-ios.yaml => workflow_build-app-ios.yaml} | 45 ++++++++++------- frontend/android/fastlane/Fastfile | 1 + frontend/ios/fastlane/Fastfile | 5 +- status | 48 ------------------ 7 files changed, 150 insertions(+), 86 deletions(-) create mode 100644 .gitea/workflows/frontend_deploy-beta.yaml create mode 100644 .gitea/workflows/frontend_deploy-release.yaml rename .gitea/workflows/{frontend_build-app-android.yaml => workflow_build-app-android.yaml} (71%) rename .gitea/workflows/{frontend_build-app-ios.yaml => workflow_build-app-ios.yaml} (70%) delete mode 100644 status diff --git a/.gitea/workflows/frontend_deploy-beta.yaml b/.gitea/workflows/frontend_deploy-beta.yaml new file mode 100644 index 0000000..9f23fa5 --- /dev/null +++ b/.gitea/workflows/frontend_deploy-beta.yaml @@ -0,0 +1,49 @@ +on: + pull_request: + branches: + - main + paths: + - frontend/** + +name: Build and release release apps to production track + +jobs: + get-version: + name: Get version + runs-on: macos + steps: + - name: Fetch tags from main branch + # since this workflow is triggered by a pull request, we want to match the latest tag of the main branch + id: version + run: | + git fetch origin main --tags + LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) + # remove the 'v' prefix from the tag name + echo "BUILD_NAME=${LATEST_TAG//v}" >> $GITHUB_ENV + + build-android: + name: Build and upload android app + uses: ./.gitea/workflows/workflow_build-app-android.yaml + with: + type: beta + build_name: ${{ env.BUILD_NAME }} + secrets: + ANDROID_SECRET_PROPERTIES_BASE64: ${{ secrets.ANDROID_SECRET_PROPERTIES_BASE64 }} + ANDROID_GOOGLE_PLAY_JSON_BASE64: ${{ secrets.ANDROID_GOOGLE_PLAY_JSON_BASE64 }} + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + ANDROID_GOOGLE_MAPS_API_KEY: ${{ secrets.ANDROID_GOOGLE_MAPS_API_KEY }} + + build-ios: + name: Build and upload ios app + uses: ./.gitea/workflows/workflow_build-app-ios.yaml + with: + type: beta + build_name: ${{ env.BUILD_NAME }} + secrets: + MATCH_REPO_SSH_KEY: ${{ secrets.MATCH_REPO_SSH_KEY }} + GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} + IOS_ASC_KEY_ID: ${{ secrets.IOS_ASC_KEY_ID }} + IOS_ASC_ISSUER_ID: ${{ secrets.IOS_ASC_ISSUER_ID }} + IOS_ASC_KEY: ${{ secrets.IOS_ASC_KEY }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + IOS_GOOGLE_MAPS_API_KEY: ${{ secrets.IOS_GOOGLE_MAPS_API_KEY }} diff --git a/.gitea/workflows/frontend_deploy-release.yaml b/.gitea/workflows/frontend_deploy-release.yaml new file mode 100644 index 0000000..9783890 --- /dev/null +++ b/.gitea/workflows/frontend_deploy-release.yaml @@ -0,0 +1,47 @@ +on: + push: + tags: + - v* + +name: Build and release release apps to production track + +jobs: + get-version: + name: Get version + runs-on: macos + steps: + - name: Get version from git tag + id: version + env: + REF_NAME: ${{ gitea.ref_name }} + # remove the 'v' prefix from the tag name + run: | + echo "BUILD_NAME=${REF_NAME//v}" >> $GITHUB_ENV + + + build-android: + name: Build and upload android app + uses: ./.gitea/workflows/workflow_build-app-android.yaml + with: + type: release + build_name: ${{ env.BUILD_NAME }} + secrets: + ANDROID_SECRET_PROPERTIES_BASE64: ${{ secrets.ANDROID_SECRET_PROPERTIES_BASE64 }} + ANDROID_GOOGLE_PLAY_JSON_BASE64: ${{ secrets.ANDROID_GOOGLE_PLAY_JSON_BASE64 }} + ANDROID_KEYSTORE_BASE64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }} + ANDROID_GOOGLE_MAPS_API_KEY: ${{ secrets.ANDROID_GOOGLE_MAPS_API_KEY }} + + build-ios: + name: Build and upload ios app + uses: ./.gitea/workflows/workflow_build-app-ios.yaml + with: + type: release + build_name: ${{ env.BUILD_NAME }} + secrets: + MATCH_REPO_SSH_KEY: ${{ secrets.MATCH_REPO_SSH_KEY }} + GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} + IOS_ASC_KEY_ID: ${{ secrets.IOS_ASC_KEY_ID }} + IOS_ASC_ISSUER_ID: ${{ secrets.IOS_ASC_ISSUER_ID }} + IOS_ASC_KEY: ${{ secrets.IOS_ASC_KEY }} + MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }} + IOS_GOOGLE_MAPS_API_KEY: ${{ secrets.IOS_GOOGLE_MAPS_API_KEY }} diff --git a/.gitea/workflows/frontend_build-app-android.yaml b/.gitea/workflows/workflow_build-app-android.yaml similarity index 71% rename from .gitea/workflows/frontend_build-app-android.yaml rename to .gitea/workflows/workflow_build-app-android.yaml index 617bcba..2455bfb 100644 --- a/.gitea/workflows/frontend_build-app-android.yaml +++ b/.gitea/workflows/workflow_build-app-android.yaml @@ -1,18 +1,30 @@ on: - pull_request: - branches: - - main - paths: - - frontend/** + workflow_call: + inputs: + build_type: + description: 'Release type (release, beta)' + required: true + type: string + build_name: + description: 'Build name' + required: true + type: string + secrets: + ANDROID_SECRET_PROPERTIES_BASE64: + required: true + ANDROID_GOOGLE_PLAY_JSON_BASE64: + required: true + ANDROID_KEYSTORE_BASE64: + required: true + ANDROID_GOOGLE_MAPS_API_KEY: + required: true - -name: Build and release debug APK to testing track +name: Build and release android appbundle to specfied track defaults: run: working-directory: frontend/android - jobs: build: runs-on: macos @@ -52,15 +64,6 @@ jobs: ruby-version: 3.3 bundler-cache: true # runs 'bundle install' and caches installed gems automatically - - name: Fetch tags from main branch - # since this workflow is triggered by a pull request, we want to match the latest tag of the main branch - id: build_name - run: | - git fetch origin main --tags - LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) - # remove the 'v' prefix from the tag name - echo "BUILD_NAME=${LATEST_TAG//v}" >> $GITHUB_OUTPUT - - name: Add required secret files run: | echo "${{ secrets.ANDROID_SECRET_PROPERTIES_BASE64 }}" | base64 -d > secrets.properties @@ -68,8 +71,8 @@ jobs: echo "${{ secrets.ANDROID_KEYSTORE_BASE64 }}" | base64 -d > release.keystore - name: Run fastlane lane - run: bundle exec fastlane deploy_beta + run: bundle exec fastlane deploy_${{ inputs.build_type }} env: BUILD_NUMBER: ${{ gitea.run_number }} - BUILD_NAME: ${{ steps.build_name.outputs.BUILD_NAME }} + BUILD_NAME: ${{ inputs.build_name }} ANDROID_GOOGLE_MAPS_API_KEY: ${{ secrets.ANDROID_GOOGLE_MAPS_API_KEY }} diff --git a/.gitea/workflows/frontend_build-app-ios.yaml b/.gitea/workflows/workflow_build-app-ios.yaml similarity index 70% rename from .gitea/workflows/frontend_build-app-ios.yaml rename to .gitea/workflows/workflow_build-app-ios.yaml index 9eceb74..0d1a9f2 100644 --- a/.gitea/workflows/frontend_build-app-ios.yaml +++ b/.gitea/workflows/workflow_build-app-ios.yaml @@ -1,11 +1,31 @@ on: - pull_request: - branches: - - main - paths: - - frontend/** + workflow_call: + inputs: + build_type: + description: 'Release type (release, beta)' + required: true + type: string + build_name: + description: 'Build name' + required: true + type: string + secrets: + MATCH_REPO_SSH_KEY: + required: true + GOOGLE_MAPS_API_KEY: + required: true + IOS_ASC_KEY_ID: + required: true + IOS_ASC_ISSUER_ID: + required: true + IOS_ASC_KEY: + required: true + MATCH_PASSWORD: + required: true + IOS_GOOGLE_MAPS_API_KEY: + required: true -name: Build and release debugging app to ios testflight +name: Build and release ipa to specified track defaults: run: @@ -42,15 +62,6 @@ jobs: flutter clean bundle exec pod cache clean --all - - name: Fetch tags from main branch - # since this workflow is triggered by a pull request, we want to match the latest tag of the main branch - id: build_name - run: | - git fetch origin main --tags - LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1)) - # remove the 'v' prefix from the tag name - echo "BUILD_NAME=${LATEST_TAG//v}" >> $GITHUB_OUTPUT - - name: Setup SSH key for match git repo # and mark the host as known run: | @@ -61,10 +72,10 @@ jobs: MATCH_REPO_SSH_KEY: ${{ secrets.IOS_MATCH_REPO_SSH_KEY_BASE64 }} - name: Run fastlane lane - run: bundle exec fastlane deploy_beta + run: bundle exec fastlane deploy_${{ inputs.build_type }} env: BUILD_NUMBER: ${{ gitea.run_number }} - BUILD_NAME: ${{ steps.build_name.outputs.BUILD_NAME }} + BUILD_NAME: ${{ inputs.build_name }} GOOGLE_MAPS_API_KEY: ${{ secrets.GOOGLE_MAPS_API_KEY }} IOS_ASC_KEY_ID: ${{ secrets.IOS_ASC_KEY_ID }} IOS_ASC_ISSUER_ID: ${{ secrets.IOS_ASC_ISSUER_ID }} diff --git a/frontend/android/fastlane/Fastfile b/frontend/android/fastlane/Fastfile index 326cf13..d61c34c 100644 --- a/frontend/android/fastlane/Fastfile +++ b/frontend/android/fastlane/Fastfile @@ -48,6 +48,7 @@ platform :android do skip_upload_apk: true, skip_upload_changelogs: true, aab: "../build/app/outputs/bundle/release/app-release.aab", + metadata_path: "fastlane/metadata", ) end end diff --git a/frontend/ios/fastlane/Fastfile b/frontend/ios/fastlane/Fastfile index 9d10687..f78bd61 100644 --- a/frontend/ios/fastlane/Fastfile +++ b/frontend/ios/fastlane/Fastfile @@ -99,8 +99,9 @@ platform :ios do ) upload_to_app_store( - skip_screenshots: true, - skip_metadata: true, + overwrite_screenshots: true, + metadata_path: "fastlane/metadata", + screenshot_path: "fastlane/screenshots", precheck_include_in_app_purchases: false, submit_for_review: true, diff --git a/status b/status deleted file mode 100644 index 61bfc53..0000000 --- a/status +++ /dev/null @@ -1,48 +0,0 @@ -error: wrong number of arguments, should be from 1 to 2 -usage: git config [] - -Config file location - --[no-]global use global config file - --[no-]system use system config file - --[no-]local use repository config file - --[no-]worktree use per-worktree config file - -f, --[no-]file - use given config file - --[no-]blob read config from given blob object - -Action - --[no-]get get value: name [value-pattern] - --[no-]get-all get all values: key [value-pattern] - --[no-]get-regexp get values for regexp: name-regex [value-pattern] - --[no-]get-urlmatch get value specific for the URL: section[.var] URL - --[no-]replace-all replace all matching variables: name value [value-pattern] - --[no-]add add a new variable: name value - --[no-]unset remove a variable: name [value-pattern] - --[no-]unset-all remove all matches: name [value-pattern] - --[no-]rename-section rename section: old-name new-name - --[no-]remove-section remove a section: name - -l, --[no-]list list all - --[no-]fixed-value use string equality when comparing values to 'value-pattern' - -e, --[no-]edit open an editor - --[no-]get-color find the color configured: slot [default] - --[no-]get-colorbool find the color setting: slot [stdout-is-tty] - -Type - -t, --[no-]type - value is given this type - --bool value is "true" or "false" - --int value is decimal number - --bool-or-int value is --bool or --int - --bool-or-str value is --bool or string - --path value is a path (file or directory name) - --expiry-date value is an expiry date - -Other - -z, --[no-]null terminate values with NUL byte - --[no-]name-only show variable names only - --[no-]includes respect include directives on lookup - --[no-]show-origin show origin of config (file, standard input, blob, command line) - --[no-]show-scope show scope of config (worktree, local, global, system, command) - --[no-]default - with --get, use default value when missing entry -