mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 01:22:46 +02:00
cb7771916b
set-output is deprecated and the warning fails the secret check. Instead match ElementX by comparing the pull request repo to make sure it matches the workflow's repo.
100 lines
3.7 KiB
YAML
100 lines
3.7 KiB
YAML
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:
|
|
|
|
env:
|
|
# Make the git branch for a PR available to our Fastfile
|
|
MX_GIT_BRANCH: ${{ github.event.pull_request.head.ref }}
|
|
|
|
jobs:
|
|
build:
|
|
# Don't run for forks as secrets are unavailable.
|
|
if: |
|
|
github.event.pull_request.head.repo.full_name == github.repository &&
|
|
(github.event_name == 'push' ||
|
|
(github.event_name == 'pull_request' && contains(github.event.pull_request.labels.*.name, 'Trigger-PR-Build')))
|
|
|
|
name: Release
|
|
runs-on: macos-12
|
|
|
|
concurrency:
|
|
# Only allow a single run of this workflow on each branch, automatically cancelling older runs.
|
|
group: alpha-${{ github.head_ref }}
|
|
cancel-in-progress: true
|
|
|
|
steps:
|
|
- uses: actions/checkout@v2
|
|
|
|
# Common cache
|
|
# Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job
|
|
- name: Cache CocoaPods libraries
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: Pods
|
|
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pods-
|
|
|
|
- name: Cache Ruby gems
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: vendor/bundle
|
|
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-gems-
|
|
|
|
# Make sure we use the latest version of MatrixSDK
|
|
- name: Reset MatrixSDK pod
|
|
run: rm -rf Pods/MatrixSDK
|
|
|
|
# Common setup
|
|
# Note: GH actions do not support yaml anchor yet. We need to duplicate this for every job
|
|
- name: Brew bundle
|
|
run: brew bundle
|
|
- name: Bundle install
|
|
run: |
|
|
bundle config path vendor/bundle
|
|
bundle install --jobs 4 --retry 3
|
|
- name: Use right MatrixSDK versions
|
|
run: bundle exec fastlane point_dependencies_to_related_branches
|
|
|
|
# Import alpha release private signing certificate
|
|
- 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
|
|
# 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
|
|
- name: Build Ad-hoc release and send it to Diawi
|
|
run: bundle exec fastlane alpha
|
|
env:
|
|
APPSTORECONNECT_KEY_ID: ${{ secrets.APPSTORECONNECT_KEY_ID }}
|
|
APPSTORECONNECT_KEY_ISSUER_ID: ${{ secrets.APPSTORECONNECT_KEY_ISSUER_ID }}
|
|
APPSTORECONNECT_KEY_CONTENT: ${{ secrets.APPSTORECONNECT_KEY_CONTENT }}
|
|
DIAWI_API_TOKEN: ${{ secrets.DIAWI_API_TOKEN }}
|
|
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}
|
|
|
|
- name: Add or update PR comment with Ad-hoc release informations
|
|
uses: NejcZdovc/comment-pr@v1
|
|
with:
|
|
message: |
|
|
: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.
|
|
|
|

|
|
|
|
If you can't scan the QR code you can install the build via this link: ${{ env.DIAWI_FILE_LINK }}
|
|
# 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 }}
|