diff --git a/README.md b/README.md index 09e8a1d..2e6905a 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ Simple iOS Project with working bitrise.yml included in the root of the project ## Bitrise Setup +Something else in here for the merge conflict. + Create a new project in Bitrise using this repo as you normally would. Use the `bitrise.yml` from the repo to define your workflows. In order to sign the app during the `deploy` workflow archive step, you must set a valid provisioning profile and signing certificate in the `bitrise.yml` (`BITRISE_PROFILE_ID` and `BITRISE_CODE_SIGNING_IDENTITY` env vars) and upload those to your account. More details can be found in the [internal wiki](https://bitrise.atlassian.net/wiki/spaces/~833061986/pages/1554875463/Demo+App-Bitrise+Deploy+Workflow). diff --git a/bitrise.yml b/bitrise.yml index 1e5ae42..6227ae4 100644 --- a/bitrise.yml +++ b/bitrise.yml @@ -2,6 +2,10 @@ format_version: '8' default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git project_type: ios +include: + - path: included.yml + branch: include + repository: Bitrise-iOS-Sample trigger_map: - push_branch: "*" workflow: primary diff --git a/included.yml b/included.yml new file mode 100644 index 0000000..7a2f79c --- /dev/null +++ b/included.yml @@ -0,0 +1,12 @@ +format_version: 14 + +app: + envs: + - USERNAME: UserName + +workflows: + test: + steps: + - script: + inputs: + - content: echo "Hello ${USERNAME}!" diff --git a/included2.yml b/included2.yml new file mode 100644 index 0000000..226e831 --- /dev/null +++ b/included2.yml @@ -0,0 +1,224 @@ +format_version: 13 +step_bundles: + authenticate_and_clone: + steps: + - authenticate-host-with-netrc@0: + inputs: + - host: github.com + - username: username + - password: "$GIT_HTTP_PASSWORD" + - git-clone@6: + inputs: + - clone_depth: '1' + clone_ci_scripts_repository: + envs: + - MOBILE_CI_REPO: mobile-ci + - MOBILE_CI_SCRIPTS_BRANCH: master + steps: + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + + git clone https://github.com/$MOBILE_CI_REPO.git $WORKDIR/../mobile-ci + cd $WORKDIR/../mobile-ci + git checkout $MOBILE_CI_SCRIPTS_BRANCH + git pull origin $MOBILE_CI_SCRIPTS_BRANCH + title: Clone mobile-ci repo + restore_install_save_node_cache_mac: + steps: + - restore-cache@2: + inputs: + - key: asdf-node-mac-m1 + title: Restore asdf node cache + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + + echo "legacy_version_file = yes" >> /Users/vagrant/.asdfrc + cat /Users/vagrant/.asdfrc + NODE_VERSION=$(cat .nvmrc | sed 's/^v//') + asdf install nodejs $NODE_VERSION + asdf global nodejs $NODE_VERSION + asdf reshim + npm install --global yarn@1.18.0 + title: Install node versions using asdf + - save-cache@1: + inputs: + - paths: "/Users/vagrant/.asdf/installs/nodejs/" + - verbose: 'true' + - is_key_unique: 'true' + - key: asdf-node-mac-m1 + run_if: '{{enveq "IS_DEVELOP_HEALTH_CHECK_JOB" "true"}}' + title: Save asdf node cache + restore_install_save_yarn_cache: + steps: + - restore-cache@2: + inputs: + - key: '{{ .OS }}-{{ .Arch }}-npm-cache-{{ checksum "yarn.lock"}}' + title: Restore yarn cache + - yarn@0: + inputs: + - cache_local_deps: 'yes' + - save-npm-cache@1: + run_if: '{{enveq "IS_DEVELOP_HEALTH_CHECK_JOB" "true"}}' + restore_install_save_ruby_cache: + steps: + - restore-cache@2: + inputs: + - key: asdf-ruby-mac-m1 + title: Restore asdf ruby cache + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + + asdf install ruby 3.3.0 + asdf global ruby 3.3.0 + asdf reshim + title: Install ruby using asdf + - save-cache@1: + inputs: + - paths: "/Users/vagrant/.asdf/installs/ruby/" + - is_key_unique: 'true' + - key: asdf-ruby-mac-m1 + run_if: '{{enveq "IS_DEVELOP_HEALTH_CHECK_JOB" "true"}}' + title: Save asdf ruby cache + generate_aws_codeartifact_token: + envs: + - AWS_DOMAIN: ci + - AWS_DOMAIN_OWNER: 123456789 + - AWS_REGION: us-west-12 + steps: + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + + CODEARTIFACT_AUTH_TOKEN=$(aws codeartifact get-authorization-token --domain $AWS_DOMAIN --domain-owner $AWS_DOMAIN_OWNER --region $AWS_REGION --query authorizationToken --output text) + envman add --key CODEARTIFACT_AUTH_TOKEN --value $CODEARTIFACT_AUTH_TOKEN + title: Generate Code Artifact Token + sentry_sourcemap_upload_android: + steps: +workflows: + test2: + steps: + - script: + inputs: + - content: echo "Hello world!" + deploy_android: + meta: + bitrise.io: + machine_type_id: g2.mac.x-large + stack: osx-xcode-16.2.x + steps: + - bundle::authenticate_and_clone: {} + - bundle::clone_ci_scripts_repository: {} + - set-java-version@1: + inputs: + - set_java_version: "17" + - bundle::restore_install_save_node_cache_mac: null + - bundle::restore_install_save_yarn_cache: {} + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + + # Get the current version from app.json + echo "$VERSION && $VERSIONCODE && $JSVERSION" + # update version versionCode and jsVersion in app.json + jq '.expo.version = "'$VERSION'"' app.json > app2.json && mv app2.json app.json + jq '.expo.runtimeVersion = "'$VERSION'"' app.json > app2.json && mv app2.json app.json + jq '.expo.versionCode = '$VERSIONCODE'' app.json > app2.json && mv app2.json app.json + jq '.expo.jsVersion = '$JSVERSION'' app.json > app2.json && mv app2.json app.json + cat app.json + title: Increment app version + - script@1: + inputs: + - content: | + #!/usr/bin/env bash + set -exo pipefail + yarn useProductionEnv + source $WORKDIR/../mobile-ci/bitrise/android/scripts/setup-project.sh --run-expo-prebuild + title: Setup mobile project + - bundle::restore_install_save_ruby_cache: {} + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + + echo $GOOGLE_PLAYSTORE_SERVICE_JSON + echo $GOOGLE_PLAYSTORE_SERVICE_JSON >> mobile-team.json + echo $GOOGLE_PLAYSTORE_SERVICE_JSON >> ./fastlane/mobile-team.json + cat mobile-team.json + title: Extract Playstore API JSON file + - restore-cache@2: + inputs: + - key: '{{ .OS }}-{{ .Arch }}-gradle-cache-{{ checksum "**/*.gradle*" "**/gradle-wrapper.properties" + "**/gradle.properties" "**/gradle/libs.versions.toml" }}' + title: Restore gradle cache + - restore-cache@2: + inputs: + - key: daily-metro-cache-mac-android + - verbose: "true" + title: Restore Metro JS cache for android + - bundle::generate_aws_codeartifact_token: {} + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + + export ENVFILE=.env.production + export ENV_NAME="production" + export SENTRY_DISABLE_AUTO_UPLOAD=false + gem install bundler:2.4.10 + bundle _2.4.10_ install + bundle _2.4.10_ exec fastlane android build_release_bundle + title: Build Android App + - save-gradle-cache@1: {} + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -exo pipefail + bundle _2.4.10_ exec fastlane android release_playstore + run_if: '{{or (enveq "DEBUG_RUN" "false") (enveq "DEBUG_RUN" "")}}' + title: Release Android App + - script@1: + inputs: + - content: |- + #!/usr/bin/env bash + set -ex + + envman add --key RELEASE_ANDROID_STATUS --value $BITRISE_BUILD_STATUS + echo "envman add --key RELEASE_ANDROID_STATUS --value $BITRISE_BUILD_STATUS" >> deploy_android_env.txt + is_always_run: true + title: Set Release Android status + - bundle::sentry_sourcemap_upload_android: {} + - share-pipeline-variable@1: + inputs: + - variables: RELEASE_ANDROID_STATUS + is_always_run: true + - deploy-to-bitrise-io@2: + inputs: + - pipeline_intermediate_files: $WORKDIR/deploy_android_env.txt:DEPLOY_ANDROID_ENV + - debug_mode: "true" + - notify_user_groups: none + - zip_name: "" + is_always_run: true + is_skippable: true + - deploy-to-bitrise-io@2: + inputs: + - pipeline_intermediate_files: $ANDROID_RELEASE_AAB_PATH:ANDROID_BUILD + - debug_mode: "true" + - notify_user_groups: none + - zip_name: "" + is_always_run: true + is_skippable: true