Skip to content

Commit

Permalink
Configure using AppStore API for fastlane and bitrise (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
alphatroya authored Oct 8, 2020
1 parent 329ee7c commit fe03c40
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 7 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.5] - 2020-10-08
### Changed
- Изменил конфигурации bitrise и fastlane на использование [AppStore API](https://docs.fastlane.tools/app-store-connect-api/)

## [1.2.4] - 2020-10-05
### Changed
- Обновил AppIcon утилиту до 1.0.5 версии, так как предыдущая не собиралась на Swift 5.3
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# My iOS app template

[![Build Status](https://travis-ci.com/alphatroya/swift-project-template.svg?branch=master)](https://travis-ci.com/alphatroya/swift-project-template)
![Build project and run tests](https://github.com/alphatroya/swift-project-template/workflows/Build%20project%20and%20run%20tests/badge.svg)

## Description

Expand Down
1 change: 1 addition & 0 deletions hooks/post_gen_project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ make swiftgen
curl -L 'https://www.gitignore.io/api/swift,macos,fastlane' > .gitignore
echo '.idea' >> .gitignore
echo 'Templates' >> .gitignore
echo 'fastlane/api-key.json' >> .gitignore

make icon

Expand Down
18 changes: 13 additions & 5 deletions {{ cookiecutter.name }}/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# {{ cookiecutter.name }}

/// A place for CI status badge
<!--- A place for CI status badge --->

## Bootstrapping development environment
```sh
Expand All @@ -9,19 +9,27 @@ make bootstrap

## Bitrise CI configuration

Paste [bitrise.yml](https://github.com/alphatroya/swift-project-template/wiki/Bitrise%20config) content in the bitrise project settings page.
Configure Bitrise for using stored in repository `bitrise.yml` file.

Also, some environment parameters need to be set:
Also, some secret environment parameters need to be set:

- `$MATCH_PASSWORD`: password to the [match](https://docs.fastlane.tools/actions/match/) repo
- `$FASTLANE_PASSWORD`: AppleID password
- `$APPSTORE_API_KEY_ENCRYPT_PWD`: password for the encrypted `api-key.json` file

## Template info

The project was generated using the [cookiecutter tool](https://github.com/audreyr/cookiecutter)
and [this](https://github.com/alphatroya/swift-project-template) swift template.

Template version: 1.2.4
Template version: 1.2.5

## AppStore credentials

Interaction with AppStore needs credentials. This project uses the official [AppStore API](https://docs.fastlane.tools/app-store-connect-api). For proper project deployment process, the project owner needs to create the `fastlane/app-key.json` file with access keys and encrypt by gpg tool with a strong password.
```sh
gpg -c fastlane/api-key.json
```
The resulted encrypted file should be committed to the repository.

## Copyright

Expand Down
10 changes: 10 additions & 0 deletions {{ cookiecutter.name }}/bitrise.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ workflows:
- activate-ssh-key:
{% raw -%}run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'{%- endraw %}
- git-clone: {}
- decrypt-file@0:
inputs:
- encrypted_file_path: fastlane/api-key.json.gpg
- output_file_path: fastlane/api-key.json
- decrypt_passphrase: $APPSTORE_API_KEY_ENCRYPT_PWD
- cache-pull: {}
- bitrise-step-install-bundler: {}
- fastlane:
Expand Down Expand Up @@ -78,6 +83,11 @@ workflows:
- activate-ssh-key:
{% raw -%}run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'{%- endraw %}
- git-clone: {}
- decrypt-file@0:
inputs:
- encrypted_file_path: fastlane/api-key.json.gpg
- output_file_path: fastlane/api-key.json
- decrypt_passphrase: $APPSTORE_API_KEY_ENCRYPT_PWD
- cache-pull: {}
- bitrise-step-install-bundler: {}
- fastlane:
Expand Down
6 changes: 5 additions & 1 deletion {{ cookiecutter.name }}/fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@ platform :ios do
match(
type: "development",
clone_branch_directly: false,
api_key_path: "fastlane/api-key.json",
)
match(
type: "appstore",
clone_branch_directly: false,
api_key_path: "fastlane/api-key.json",
)
end

Expand All @@ -29,7 +31,8 @@ platform :ios do
)
match(
type: "development",
force_for_new_devices: true
force_for_new_devices: true,
api_key_path: "fastlane/api-key.json",
)
end

Expand Down Expand Up @@ -61,6 +64,7 @@ platform :ios do
)

pilot(
api_key_path: "fastlane/api-key.json",
distribute_external: true,
beta_app_feedback_email: '{{ cookiecutter.apple_id }}',
beta_app_description: 'Beta build for testing',
Expand Down

0 comments on commit fe03c40

Please sign in to comment.