-
-
Notifications
You must be signed in to change notification settings - Fork 23
153 lines (136 loc) · 4.79 KB
/
develop.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
name: 🌸 Build
permissions:
contents: write
on:
push:
branches: [ "main" ]
paths-ignore:
- 'doc/**'
- '.editorconfig'
- '.gitignore'
- 'Copyright'
- 'README.md'
- 'RELEASE_NOTES'
pull_request:
branches: [ "main" ]
paths-ignore:
- 'doc/**'
- '.editorconfig'
- '.gitignore'
- 'Copyright'
- 'README.md'
- 'RELEASE_NOTES'
jobs:
build:
name: 🌸 Build
runs-on: macos-14
steps:
- name: 👀 Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
submodules: recursive
token: ${{ secrets.GH_PAT }}
- name: 🐧 set up Swift
uses: swift-actions/setup-swift@v2
with:
swift-version: "5.10.1"
- name: ☕️ set up JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'zulu'
cache: gradle
- name: 🔨 Select Xcode version
run: |
# ls /Applications/
sudo xcode-select --switch /Applications/Xcode_15.4.app
export TOOLCHAINS=swift
swift --version
- name: 🕸️ Cache node modules
uses: actions/cache@v2
with:
path: node_modules
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: 🕸️ Cache CocoaPods
uses: actions/cache@v2
with:
path: ios/Pods
key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
restore-keys: |
${{ runner.os }}-pods-
- name: 🧱 Install Dependencies
run: |
npm install
cd ios && pod install
- name: 🧬 Build
env:
scheme: ${{ 'default' }}
DEVELOPER_DIR: /Applications/Xcode_15.4.app/Contents/Developer
run: |
exec &> build.log
rm -rf ios/iPlayClient.xcworkspace/xcshareddata/swiftpm/Package.resolved
make all
- name: ⬆️ Upload Build Log if Build Fails
if: failure()
run: |
buildtime=$(date '+%Y%m%d.%H%M')
python -m pip install requests
echo "Uploaded build.log"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/build.log" \
--file "$PWD/build.log" \
--token "${{ secrets.CLIENT_ID }}"
# - name: ✈️ Upload app to TestFlight
# uses: apple-actions/upload-testflight-build@v1
# with:
# app-path: build/iPlay.ipa
# issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
# api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
# api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}
# - name: ⬆️ Upload Build Artifact To GitHub
# uses: actions/upload-artifact@v3
# with:
# name: artifact
# path: |
# build/*.apk
# build/*.ipa
# build/*.aab
- name: 🎊 Release Notes
run: |
echo "version_code=$(git rev-list --count HEAD)" >> $GITHUB_ENV
echo "build_id=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
echo version_name="v1.0 $(git rev-parse --short HEAD)" >> $GITHUB_ENV
- name: 🎉 Publish Release
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/heads/main')
with:
name: ${{ env.version_name }}
tag_name: v1.0.${{ env.version_code }}
make_latest: true
files: |
build/*.apk
build/*.ipa
build/*.aab
- name: ⬆️ Upload Build Artifact
env:
scheme: ${{ 'default' }}
run: |
buildtime=$(date '+%Y%m%d.%H%M')
python -m pip install requests
echo "Uploading build artifacts..."
# echo "Uploaded iPlay.ipa"
# python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay.ipa" \
# --file "$PWD/build/iPlay.ipa" \
# --token "${{ secrets.CLIENT_ID }}"
echo "Uploaded iPlay.apk"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay-x86_64.apk" \
--file "$PWD/build/iPlay-x86_64.apk" \
--token "${{ secrets.CLIENT_ID }}"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay-arm64-v8a.apk" \
--file "$PWD/build/iPlay-arm64-v8a.apk" \
--token "${{ secrets.CLIENT_ID }}"
python ./tools/upload.py --url "https://drive.endemy.me/od_bot/build/iPlay/$buildtime/iPlay-armeabi-v7a.apk" \
--file "$PWD/build/iPlay-armeabi-v7a.apk" \
--token "${{ secrets.CLIENT_ID }}"