-
Notifications
You must be signed in to change notification settings - Fork 0
83 lines (75 loc) · 3.66 KB
/
release_testflight.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
name: release
on:
push:
tags:
- '*'
jobs:
setup:
name: create release
runs-on: ubuntu-latest
steps:
- name: create_release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
release_tesflight:
needs: setup
runs-on: macos-13
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- name: release_tesflight
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DIG_IOS_DEV_64: ${{ secrets.DIG_IOS_DEV_64 }}
DIG_IOS_DIST_64: ${{ secrets.DIG_IOS_DIST_64 }}
P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
API_KEY_H: ${{ secrets.API_KEY_H }}
REFS_VERSION: ${{ github.ref }}
run: |
# select xcode 15
sudo xcode-select -s /Applications/Xcode_15.0.1.app/Contents/Developer
# create variables
DIG_IOS_DEV_PATH=$RUNNER_TEMP/dig_ios_dev_certificate.p12
DIG_IOS_DIST_PATH=$RUNNER_TEMP/dig_ios_dist_certificate.p12
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# import certificates, one for dev, one for distribution
echo -n "$DIG_IOS_DEV_64" | base64 --decode -o $DIG_IOS_DEV_PATH
echo -n "$DIG_IOS_DIST_64" | base64 --decode -o $DIG_IOS_DIST_PATH
ls $RUNNER_TEMP
# create temporary keychain
security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# import certificates to keychain
security import $DIG_IOS_DEV_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security import $DIG_IOS_DIST_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
# apply provisioning profile
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp app/dist/ios/c201552e-2c71-4513-af2f-6fbfc39a4988.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles
cp app/dist/ios/67f31053-7cc4-4b1b-bdf3-030ef5ecff39.mobileprovision ~/Library/MobileDevice/Provisioning\ Profiles
ls ~/Library/MobileDevice/Provisioning\ Profiles
# bump version in plist
export VERSION=$(echo $REFS_VERSION| cut -d'/' -f 3)
export VERSION=$(echo $VERSION| cut -d'.' -f 3)
echo $VERSION
sed -i.bak "s/<key>CFBundleVersion<\/key><string>[0-9]*<\/string>/<key>CFBundleVersion<\/key><string>$VERSION<\/string>/g" app/dist/ios/Info.plist
# build and upload
cd app
pmtech/pmbuild ios
pmtech/pmbuild ios -libs
echo "$API_KEY_H" >> code/api_key.h
xcodebuild archive -workspace build/ios/diig_ios.xcworkspace -configuration Release -scheme diig -archivePath build/ios/diig_ios OTHER_CODE_SIGN_FLAGS="--keychain $KEYCHAIN_PATH" PROVISIONING_PROFILE="c201552e-2c71-4513-af2f-6fbfc39a4988" CODE_SIGN_STYLE="Manual"
xcodebuild -exportArchive -archivePath build/ios/diig_ios.xcarchive -exportPath build/ios/export -exportOptionsPlist dist/ios/ExportOptionsAgent.plist OTHER_CODE_SIGN_FLAGS="--keychain $KEYCHAIN_PATH" PROVISIONING_PROFILE="67f31053-7cc4-4b1b-bdf3-030ef5ecff39" CODE_SIGN_STYLE="Manual"
xcrun altool --upload-app -f build/ios/export/diig.ipa -t ios -u ${{secrets.APP_EMAIL}} -p ${{secrets.APP_PASSWORD}}