forked from compnerd/swift-firebase
-
Notifications
You must be signed in to change notification settings - Fork 0
152 lines (121 loc) · 4.72 KB
/
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
149
150
151
152
name: build
on:
pull_request:
branches:
- main
workflow_dispatch:
jobs:
spm:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- branch: development
tag: DEVELOPMENT-SNAPSHOT-2024-02-08-a
options: -Xswiftc "-I${env:SDKROOT}\..\..\..\..\..\..\Toolchains\0.0.0+Asserts\usr\include"
name: SPM (Windows) - Swift ${{ matrix.tag }}
steps:
- uses: compnerd/gha-setup-swift@main
with:
tag: ${{ matrix.tag }}
branch: ${{ matrix.branch }}
- uses: actions/checkout@v3
- uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
with:
repo: thebrowsercompany/firebase-cpp-sdk
version: tags/20240709.0
file: firebase-windows-amd64.zip
- run: |
Expand-Archive -Path firebase-windows-amd64.zip -DestinationPath third_party
Rename-Item -Path third_party/firebase-windows-amd64 -NewName firebase-development
shell: powershell
- name: Build
run: swift build -v ${{ matrix.options }}
cmake:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- branch: development
tag: DEVELOPMENT-SNAPSHOT-2024-02-08-a
options: -I${env:SDKROOT}\..\..\..\..\..\..\Toolchains\0.0.0+Asserts\usr\include
name: CMake (Windows) - Swift ${{ matrix.tag }}
steps:
- uses: compnerd/gha-setup-vsdevenv@main
- uses: compnerd/gha-setup-swift@main
with:
tag: ${{ matrix.tag }}
branch: ${{ matrix.branch }}
- uses: actions/checkout@v3
- uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
with:
repo: thebrowsercompany/firebase-cpp-sdk
version: tags/20240709.0
file: firebase-windows-amd64.zip
- run: |
Expand-Archive -Path firebase-windows-amd64.zip -DestinationPath third_party
Rename-Item -Path third_party/firebase-windows-amd64 -NewName firebase-development
shell: powershell
- name: Configure
run: |
cmake -B out `
-D CMAKE_BUILD_TYPE=Release `
-G Ninja `
-S ${{ github.workspace }} `
-D CMAKE_Swift_FLAGS="${{ matrix.options }}" `
-D SWIFT_FIREBASE_BUILD_EXAMPLES=NO
- name: Build
run: cmake --build out
android:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
include:
- branch: development
tag: DEVELOPMENT-SNAPSHOT-2024-07-09-a
abi: arm64-v8a
options: -sdk ${env:SDKROOT}\..\..\..\Android.platform\Developer\SDKs\Android.sdk -sysroot ${env:ANDROID_NDK_ROOT}\toolchains\llvm\prebuilt\windows-x86_64\sysroot -I${env:SDKROOT}\..\..\..\..\..\..\Toolchains\0.0.0+Asserts\usr\include -Xlinker -zdefs
target: aarch64-unknown-linux-android28
name: CMake (Android) - Swift ${{ matrix.tag }}
steps:
- uses: compnerd/gha-setup-vsdevenv@main
- uses: compnerd/gha-setup-swift@main
with:
# tag: ${{ matrix.tag }}
# branch: ${{ atrix.branch }}
github-repo: thebrowsercompany/swift-build
github-token: ${{ secrets.GITHUB_TOKEN }}
release-asset-name: installer-amd64.exe
release-tag-name: "20240709.0"
- uses: actions/checkout@v3
- uses: dsaltares/fetch-gh-release-asset@a40c8b4a0471f9ab81bdf73a010f74cc51476ad4 # v1.1.1
with:
repo: thebrowsercompany/firebase-cpp-sdk
version: tags/20240709.0
file: firebase-android-arm64-v8a.zip
- run: |
Expand-Archive -Path firebase-android-${{ matrix.abi }}.zip -DestinationPath third_party
Rename-Item -Path third_party/firebase-android-${{ matrix.abi}} -NewName firebase-development
shell: powershell
- uses: nttld/setup-ndk@afb4c9964b521afb97c864b7d40b11e6911bd410 # v1.5.0
with:
ndk-version: r26d
- name: Configure
run: |
cmake -B out `
-D CMAKE_BUILD_TYPE=RelWithDebInfo `
-G Ninja `
-S ${{ github.workspace }} `
-D CMAKE_SYSTEM_NAME=Android `
-D CMAKE_ANDROID_ARCH_ABI=${{ matrix.abi }} `
-D CMAKE_ANDROID_API=21 `
-D CMAKE_ANDROID_NDK=${env:ANDROID_NDK_HOME} `
-D CMAKE_Swift_COMPILER_WORKS=YES `
-D CMAKE_Swift_COMPILER_TARGET=${{ matrix.target }} `
-D CMAKE_Swift_FLAGS="${{ matrix.options }}" `
-D SWIFT_FIREBASE_BUILD_EXAMPLES=NO
- name: Build
run: cmake --build out