-
Notifications
You must be signed in to change notification settings - Fork 12
148 lines (130 loc) · 5.26 KB
/
test_ios_build.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
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
name: Gradle Snapshot Build
on:
push:
branches:
- test_ios_build
jobs:
build:
strategy:
matrix:
type: [iOS]
include:
# - type: PublishLibrary
# publish: release
# os: macos-latest
# - type: Android
# android: apk
# os: macos-latest
# - type: Windows
# desktop: msi
# os: windows-latest
# - type: Linux
# desktop: deb
# os: ubuntu-latest
# - type: macOS
# desktop: dmg
# os: macos-latest
- type: iOS
iOS: ipa
os: macos-latest
runs-on: ${{ matrix.os }}
permissions:
contents: read
packages: write
steps:
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
# with:
# cache-disabled: true
# - name: clean dir
# run: |
# ls -a
# rm -rf ${{ github.workspace }}/*
# rm -rf ~/.gradle
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: sync_master_target
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: '17'
distribution: 'temurin'
- name: Set up Xcode
if: ${{ matrix.iOS }}
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest-stable'
- name: Build Gallery for iOS
if: ${{ matrix.iOS }}
run: |
# rm -rf ~/.gradle/caches/
# ./gradlew :gallery:kspCommonMainKotlinMetadata
# ./gradlew :gallery:linkDebugFrameworkIosFat
xcodebuild -scheme iosApp -configuration Debug -sdk iphoneos -archivePath gallery/iosApp/build/Gallery.xcarchive archive -workspace gallery/iosApp/iosApp.xcodeproj/project.xcworkspace
xcodebuild -exportArchive -archivePath gallery/iosApp/build/Gallery.xcarchive -exportPath build/Gallery -allowProvisioningUpdates
# xcodebuild -workspace gallery/iosApp/iosApp.xcodeproj/project.xcworkspace -scheme iosApp -configuration Debug -derivedDataPath gallery/iosApp/build CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO
- name: Updaload iOS Artifact
if: ${{ matrix.iOS }}
uses: actions/upload-artifact@v4
with:
name: Gallery-${{ matrix.type }}-${{ github.run_id }}
path: ${{ github.workspace }}/gallery/iosApp/build/
- name: Publish Library
if: ${{ matrix.publish }}
run: |
./gradlew publishToMavenLocal
./gradlew publish
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
SIGNING_KEY_ID: ${{ secrets.SIGNING_KEY_ID }}
SIGNING_KEY: ${{ secrets.SIGNING_KEY }}
SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }}
- name: Upload Library Artifact
if: ${{ matrix.publish }}
uses: actions/upload-artifact@v4
with:
name: Repository-${{ github.run_id }}
path: ~/.m2/repository
- name: Build Gallery for ${{ matrix.type }}
if: ${{ matrix.android }}
run: |
echo "$ANDROID_KEYSTORE" | base64 --decode > ${{ github.workspace }}/android_sign_key.jks
./gradlew :gallery:assembleRelease
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
ANDROID_SIGNING_FILE: ${{ github.workspace }}/android_sign_key.jks
ANDROID_SIGNING_PASSWORD: ${{ secrets.KEYSTORE_PASSWORD }}
ANDROID_SIGNING_KEY_ALIAS: ${{ secrets.KEY_ALIAS }}
ANDROID_SIGNING_KEY_PASSWORD: ${{ secrets.KEY_PASSWORD }}
- name: Upload android build artifacts
if: ${{ matrix.android }}
uses: actions/upload-artifact@v4
with:
name: Gallery-${{ matrix.type }}-${{ github.run_id }}
path: ${{github.workspace}}/gallery/build/outputs/**/*.${{ matrix.android }}
- name: Build Gallery for ${{ matrix.type }}
if: ${{ matrix.desktop }}
run: |
./gradlew :gallery:packageReleaseDistributionForCurrentOS
- name: Upload desktop build artifacts
if: ${{ matrix.desktop }}
uses: actions/upload-artifact@v4
with:
name: Gallery-${{ matrix.type }}-${{ github.run_id }}
path: ${{github.workspace}}/gallery/build/compose/binaries/main-release/${{ matrix.desktop }}/*.${{ matrix.desktop }}
- name: Upload Failed Project
if: failure()
uses: actions/upload-artifact@v4
with:
name: Project-${{ matrix.type }}-${{ github.run_id }}
path: ${{ github.workspace }}