Skip to content

Commit

Permalink
Add production_delivery and promotion workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
steffenkleinle committed Jan 3, 2025
1 parent 4405a44 commit f09446b
Show file tree
Hide file tree
Showing 8 changed files with 193 additions and 8 deletions.
101 changes: 98 additions & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ jobs:
directory: android
- run:
command: bundle exec fastlane android upload aab_path:attached_workspace/app-release.aab production_delivery:"<< parameters.production_delivery >>" version_name:${NEW_VERSION_NAME} version_code:${NEW_VERSION_CODE}
name: '[FL] Play Store Upload'
name: '[FL] Google PlayStore Upload'
working_directory: android
- run:
command: echo "export ANDROID_RELEASE_ID='$(yarn --silent github-release create android ${NEW_VERSION_NAME} ${NEW_VERSION_CODE} --production-delivery << parameters.production_delivery >> --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME} --release-notes "Release v${NEW_VERSION_NAME}+${NEW_VERSION_CODE}")'" >> ${BASH_ENV}
Expand Down Expand Up @@ -382,14 +382,14 @@ jobs:
steps:
- run:
command: bundle exec fastlane ios production_upload ipa_path:attached_workspace/app-release.ipa version_name:${NEW_VERSION_NAME}
name: '[FL] Production Upload'
name: '[FL] Apple AppStore Upload'
working_directory: ios
- unless:
condition: << parameters.production_delivery >>
steps:
- run:
command: bundle exec fastlane ios beta_upload ipa_path:attached_workspace/app-release.ipa
name: '[FL] Beta Upload (TestFlight)'
name: '[FL] Apple Testflight Upload'
working_directory: ios
- run:
command: echo "export IOS_RELEASE_ID='$(yarn --silent github-release create ios ${NEW_VERSION_NAME} ${NEW_VERSION_CODE} --production-delivery << parameters.production_delivery >> --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME} --release-notes "Release v${NEW_VERSION_NAME}+${NEW_VERSION_CODE}")'" >> ${BASH_ENV}
Expand All @@ -399,6 +399,49 @@ jobs:
command: yarn github-release-asset upload ios --releaseId ${IOS_RELEASE_ID} --files "$(ls ~/attached_workspace/*.ipa)" --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
name: Add Build to Github Release
working_directory: tools
promote_android:
docker:
- image: cimg/android:2024.08.1-node
environment:
FASTLANE_SKIP_UPDATE_CHECK: true
resource_class: small
shell: /bin/bash -eo pipefail
steps:
- checkout
- install_node_modules
- install_fastlane:
directory: android
- run:
command: bundle exec fastlane android promote
name: '[FL] Google PlayStore Promotion'
working_directory: native
- run:
command: yarn github-promote-release promote --platform android --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
name: Remove Beta Flag from Github Release
working_directory: tools
promote_ios:
environment:
FASTLANE_SKIP_UPDATE_CHECK: true
macos:
xcode: 16.1.0
parameters:
production_delivery:
description: Whether to deliver the build to production.
type: boolean
steps:
- checkout
- install_node_modules
- install_fastlane:
directory: ios
- run:
command: bundle exec fastlane ios promote
name: '[FL] Apple AppStore Promotion'
working_directory: native
- run:
command: yarn github-promote-release promote --platform ios --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
name: Remove Beta Flag from Github Release
working_directory: tools
- notify
parameters:
api_triggered:
default: false
Expand Down Expand Up @@ -480,4 +523,56 @@ workflows:
- main
- << pipeline.git.branch >>
- not: << pipeline.parameters.api_triggered >>
production_delivery:
jobs:
- bump_version:
context:
- github
prepare_delivery: true
- build_android:
context:
- app_signing_android
requires:
- bump_version
- deliver_android:
context:
- github
- gruene_google_playstore
production_delivery: true
requires:
- build_android
- build_ios:
context:
- app_signing_ios
requires:
- bump_version
- deliver_ios:
context:
- github
- gruene_apple_appstore
production_delivery: true
requires:
- build_ios
when:
and:
- << pipeline.parameters.api_triggered >>
- equal:
- << pipeline.parameters.workflow_type >>
- production_delivery
promotion:
jobs:
- promote_android:
context:
- github
- gruene_google_playstore
- promote_ios:
context:
- github
- gruene_apple_appstore
when:
and:
- << pipeline.parameters.api_triggered >>
- equal:
- << pipeline.parameters.workflow_type >>
- promotion

2 changes: 1 addition & 1 deletion .circleci/src/jobs/deliver_android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ steps:
- install_fastlane:
directory: android
- run:
name: '[FL] Play Store Upload'
name: '[FL] Google PlayStore Upload'
command: bundle exec fastlane android upload aab_path:attached_workspace/app-release.aab production_delivery:"<< parameters.production_delivery >>" version_name:${NEW_VERSION_NAME} version_code:${NEW_VERSION_CODE}
working_directory: android
- run:
Expand Down
4 changes: 2 additions & 2 deletions .circleci/src/jobs/deliver_ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ steps:
condition: << parameters.production_delivery >>
steps:
- run:
name: '[FL] Production Upload'
name: '[FL] Apple AppStore Upload'
command: bundle exec fastlane ios production_upload ipa_path:attached_workspace/app-release.ipa version_name:${NEW_VERSION_NAME}
working_directory: ios
- unless:
condition: << parameters.production_delivery >>
steps:
- run:
name: '[FL] Beta Upload (TestFlight)'
name: '[FL] Apple Testflight Upload'
command: bundle exec fastlane ios beta_upload ipa_path:attached_workspace/app-release.ipa
working_directory: ios
- run:
Expand Down
19 changes: 19 additions & 0 deletions .circleci/src/jobs/promote_android.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
docker:
- image: cimg/android:2024.08.1-node
resource_class: small
shell: /bin/bash -eo pipefail
environment:
FASTLANE_SKIP_UPDATE_CHECK: true
steps:
- checkout
- install_node_modules
- install_fastlane:
directory: android
- run:
name: '[FL] Google PlayStore Promotion'
command: bundle exec fastlane android promote
working_directory: native
- run:
name: Remove Beta Flag from Github Release
command: yarn github-promote-release promote --platform android --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
working_directory: tools
22 changes: 22 additions & 0 deletions .circleci/src/jobs/promote_ios.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
parameters:
production_delivery:
description: Whether to deliver the build to production.
type: boolean
macos:
xcode: 16.1.0
environment:
FASTLANE_SKIP_UPDATE_CHECK: true
steps:
- checkout
- install_node_modules
- install_fastlane:
directory: ios
- run:
name: '[FL] Apple AppStore Promotion'
command: bundle exec fastlane ios promote
working_directory: native
- run:
name: Remove Beta Flag from Github Release
command: yarn github-promote-release promote --platform ios --github-private-key ${GITHUB_PRIVATE_KEY} --owner ${CIRCLE_PROJECT_USERNAME} --repo ${CIRCLE_PROJECT_REPONAME}
working_directory: tools
- notify
35 changes: 35 additions & 0 deletions .circleci/src/workflows/production_delivery.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
when:
and:
- << pipeline.parameters.api_triggered >>
- equal: [<< pipeline.parameters.workflow_type >>, production_delivery]
jobs:
- bump_version:
context:
- github
prepare_delivery: true

- build_android:
context:
- app_signing_android
requires:
- bump_version
- deliver_android:
production_delivery: true
context:
- github
- gruene_google_playstore
requires:
- build_android

- build_ios:
context:
- app_signing_ios
requires:
- bump_version
- deliver_ios:
production_delivery: true
context:
- github
- gruene_apple_appstore
requires:
- build_ios
14 changes: 14 additions & 0 deletions .circleci/src/workflows/promotion.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
when:
and:
- << pipeline.parameters.api_triggered >>
- equal: [<< pipeline.parameters.workflow_type >>, promotion]
jobs:
- promote_android:
context:
- github
- gruene_google_playstore

- promote_ios:
context:
- github
- gruene_apple_appstore
4 changes: 2 additions & 2 deletions tools/trigger-pipeline.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const CIRCLECI_URL = 'https://circleci.com/api/v2/project/github/verdigado/gruen
const WORKFLOW_TYPES = [
'none',
'beta_delivery',
// 'production_delivery',
// 'promotion'
'production_delivery',
'promotion'
]

program
Expand Down

0 comments on commit f09446b

Please sign in to comment.