mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 03:06:37 +00:00
vector-im/element-x-ios/issues/11 - ElementX PR build setup
This commit is contained in:
@@ -0,0 +1,90 @@
|
||||
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:
|
||||
|
||||
jobs:
|
||||
check-secret:
|
||||
runs-on: macos-12
|
||||
outputs:
|
||||
out-key: ${{ steps.out-key.outputs.defined }}
|
||||
steps:
|
||||
- id: out-key
|
||||
env:
|
||||
P12_KEY: ${{ secrets.ALPHA_CERTIFICATES_P12 }}
|
||||
P12_PASSWORD_KEY: ${{ secrets.ALPHA_CERTIFICATES_P12_PASSWORD }}
|
||||
if: "${{ env.P12_KEY != '' || env.P12_PASSWORD_KEY != '' }}"
|
||||
run: echo "::set-output name=defined::true"
|
||||
build:
|
||||
# Run job if secrets are available (not available for forks).
|
||||
needs: [check-secret]
|
||||
if: needs.check-secret.outputs.out-key == 'true'
|
||||
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
|
||||
|
||||
- name: Cache Ruby gems
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: vendor/bundle
|
||||
key: ${{ runner.os }}-gems-${{ hashFiles('**/Gemfile.lock') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-gems-
|
||||
|
||||
# Common setup
|
||||
- name: Brew bundle
|
||||
run:
|
||||
brew bundle
|
||||
|
||||
- name: Bundle install
|
||||
run: |
|
||||
bundle config path vendor/bundle
|
||||
bundle install --jobs 4 --retry 3
|
||||
|
||||
# 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:
|
||||
# Automatically 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 }}
|
||||
GITHUB_PR_NUMBER: ${{ github.event.number }}
|
||||
|
||||
- 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 }}
|
||||
Reference in New Issue
Block a user