-
Notifications
You must be signed in to change notification settings - Fork 5
98 lines (83 loc) · 3.79 KB
/
build_random_pro.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: Build Random Pro
on:
pull_request:
types: [opened, synchronize]
jobs:
build:
runs-on: macos-latest
environment:
name: build_Random_Pro
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up API keys
run: |
echo "API_KEY_YANDEX_METRICA=${{ secrets.API_KEY_YANDEX_METRICA }}" >> $GITHUB_ENV
echo "API_KEY_APPHUD=${{ secrets.API_KEY_APPHUD }}" >> $GITHUB_ENV
echo "API_KEY_KINOPOISK=${{ secrets.API_KEY_KINOPOISK }}" >> $GITHUB_ENV
echo "API_KEY_MOST_POPULAR_MOVIES=${{ secrets.API_KEY_MOST_POPULAR_MOVIES }}" >> $GITHUB_ENV
echo "FANCY_BACKEND=${{ secrets.FANCY_BACKEND }}" >> $GITHUB_ENV
- name: Import certificate and provisioning profiles
env:
IOS_CERTIFICATE: ${{ secrets.IOS_CERTIFICATE }}
IOS_PROVISIONING_PROFILE: ${{ secrets.IOS_PROVISIONING_PROFILE }}
RANDOM_YES_NO_WIDGET_PROFILE: ${{ secrets.RANDOM_YES_NO_WIDGET_PROFILE }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
run: |
echo "$IOS_CERTIFICATE" | base64 --decode > /tmp/Certificate.p12
echo "$IOS_PROVISIONING_PROFILE" | base64 --decode > /tmp/Profile.mobileprovision
echo "$RANDOM_YES_NO_WIDGET_PROFILE" | base64 --decode > /tmp/RandomYesNoWidgetProfile.mobileprovision
security create-keychain -p "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain
security default-keychain -s ~/Library/Keychains/build.keychain
security unlock-keychain -p "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain
security set-keychain-settings -lut 3600 ~/Library/Keychains/build.keychain
security import /tmp/Certificate.p12 -k ~/Library/Keychains/build.keychain -P "" -T /usr/bin/codesign -A
security set-key-partition-list -S apple-tool:,apple: -s -k "$KEYCHAIN_PASSWORD" ~/Library/Keychains/build.keychain
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp /tmp/Profile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/
cp /tmp/RandomYesNoWidgetProfile.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles/
PROVISIONING_PROFILE_UUID=$(grep -a -A 1 "UUID" /tmp/Profile.mobileprovision | tail -1 | awk -F '<string>' '{print $2}' | awk -F '</string>' '{print $1}')
RANDOM_YES_NO_WIDGET_PROFILE_UUID=$(grep -a -A 1 "UUID" /tmp/RandomYesNoWidgetProfile.mobileprovision | tail -1 | awk -F '<string>' '{print $2}' | awk -F '</string>' '{print $1}')
echo "PROVISIONING_PROFILE_UUID=$PROVISIONING_PROFILE_UUID" >> $GITHUB_ENV
echo "RANDOM_YES_NO_WIDGET_PROFILE_UUID=$RANDOM_YES_NO_WIDGET_PROFILE_UUID" >> $GITHUB_ENV
- name: Set up Tuist
run: |
curl -Ls https://install.tuist.io | bash
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 2.7
- name: Set up fastlane
run: |
gem install bundler
bundle install --jobs 4 --retry 3
- name: Run Danger
env:
GITHUB_TOKEN: ${{ secrets.TOKEN_GITHUB }}
run: bundle exec danger
- name: Tuist fetch
run: |
tuist fetch
- name: Tuist generate
run: |
tuist generate
- name: Run tests
run: |
bundle exec fastlane test
- name: Build and archive the app
run: |
bundle exec fastlane build
env:
APP_IDENTIFIER: ${{ secrets.APP_IDENTIFIER }}
PROVISIONING_PROFILE_UUID: ${{ env.PROVISIONING_PROFILE_UUID }}
SIGNING_CERTIFICATE: ${{ secrets.SIGNING_CERTIFICATE }}
- name: Upload App build artifact
uses: actions/upload-artifact@v3
with:
name: Random
path: "Random.ipa"
- name: Upload dSYM build artifact
uses: actions/upload-artifact@v3
with:
name: Random.app.dSYM
path: "Random.app.dSYM.zip"