2021-08-13 07:25:32 +00:00
|
|
|
name: Build alpha release
|
|
|
|
|
|
|
|
on:
|
|
|
|
|
|
|
|
# Triggers the workflow on any pull request
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
# Allows you to run this workflow manually from the Actions tab
|
|
|
|
workflow_dispatch:
|
|
|
|
|
2021-08-13 15:33:22 +00:00
|
|
|
env:
|
|
|
|
# Make the git branch for a PR available to our Fastfile
|
|
|
|
MX_GIT_BRANCH: ${{ github.event.pull_request.head.ref }}
|
|
|
|
|
2021-08-13 07:25:32 +00:00
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
name: Release
|
2021-10-01 08:47:41 +00:00
|
|
|
runs-on: macos-11
|
2021-11-05 15:07:08 +00:00
|
|
|
|
|
|
|
concurrency:
|
2021-11-08 18:27:46 +00:00
|
|
|
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
|
|
|
|
group: alpha-${{ github.head_ref }}
|
2021-11-05 15:07:08 +00:00
|
|
|
cancel-in-progress: true
|
2021-08-13 07:25:32 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v2
|
|
|
|
|
|
|
|
# Common cache
|
|
|
|
# Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job
|
2021-08-13 15:18:48 +00:00
|
|
|
- name: Cache CocoaPods libraries
|
|
|
|
uses: actions/cache@v2
|
2021-08-13 07:25:32 +00:00
|
|
|
with:
|
|
|
|
path: Pods
|
|
|
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-pods-
|
|
|
|
|
2021-08-13 15:18:48 +00:00
|
|
|
- name: Cache Ruby gems
|
|
|
|
uses: actions/cache@v2
|
2021-08-13 07:25:32 +00:00
|
|
|
with:
|
|
|
|
path: vendor/bundle
|
|
|
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
|
|
restore-keys: |
|
|
|
|
${{ runner.os }}-gems-
|
|
|
|
|
2021-12-03 17:56:29 +00:00
|
|
|
# Make sure we use the latest version of MatrixSDK
|
|
|
|
- name: Reset MatrixSDK pod
|
|
|
|
run: rm -rf Pods/MatrixSDK
|
2021-08-13 15:18:48 +00:00
|
|
|
|
2021-08-13 07:25:32 +00:00
|
|
|
# Common setup
|
|
|
|
# Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job
|
|
|
|
- name: Bundle install
|
|
|
|
run: |
|
|
|
|
bundle config path vendor/bundle
|
|
|
|
bundle install --jobs 4 --retry 3
|
|
|
|
|
2021-12-03 17:56:29 +00:00
|
|
|
- name: Use right MatrixSDK versions
|
2021-08-13 15:18:48 +00:00
|
|
|
run: bundle exec fastlane point_dependencies_to_related_branches
|
|
|
|
|
|
|
|
# Import alpha release private signing certificate
|
2021-08-13 07:25:32 +00:00
|
|
|
- name: Import signing certificate
|
|
|
|
uses: apple-actions/import-codesign-certs@v1
|
|
|
|
with:
|
|
|
|
p12-file-base64: ${{ secrets.ALPHA_CERTIFICATES_P12 }}
|
|
|
|
p12-password: ${{ secrets.ALPHA_CERTIFICATES_P12_PASSWORD }}
|
|
|
|
|
|
|
|
# Main step
|
2021-08-13 09:52:47 +00:00
|
|
|
# The Ad-hoc release link will be referenced as 'DIAWI_FILE_LINK'
|
|
|
|
# and QR link as 'DIAWI_QR_CODE_LINK' when the Diawi upload succeed
|
2021-08-13 07:25:32 +00:00
|
|
|
- name: Build Ad-hoc release and send it to Diawi
|
|
|
|
run: bundle exec fastlane alpha
|
|
|
|
env:
|
|
|
|
# Automaticaly bypass 2FA upgrade if possible on Apple account.
|
|
|
|
SPACESHIP_SKIP_2FA_UPGRADE: true
|
|
|
|
APPLE_ID: ${{ secrets.FASTLANE_USER }}
|
|
|
|
FASTLANE_USER: ${{ secrets.FASTLANE_USER }}
|
|
|
|
FASTLANE_PASSWORD: ${{ secrets.FASTLANE_PASSWORD }}
|
|
|
|
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
|
|
|
|
|
|
|
|
- name: Add or update PR comment with Ad-hoc release informations
|
|
|
|
uses: NejcZdovc/comment-pr@v1
|
|
|
|
with:
|
|
|
|
message: |
|
2021-08-13 13:55:35 +00:00
|
|
|
:iphone: Scan the QR code below to install the build for this PR.
|
|
|
|
:lock: This build is for internal testing purpose. Only devices listed in the ad-hoc provisioning profile can install Element Alpha.
|
|
|
|
|
|
|
|
![QR code](${{ env.DIAWI_QR_CODE_LINK }})
|
|
|
|
|
|
|
|
If you can't scan the QR code you can install the build via this link: ${{ env.DIAWI_FILE_LINK }}
|
2021-08-13 07:25:32 +00:00
|
|
|
# Enables to identify and update existing Ad-hoc release message on new commit in the PR
|
|
|
|
identifier: "GITHUB_COMMENT_ADHOC_RELEASE"
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|