Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 23 additions & 34 deletions .github/workflows/bcny-firebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ name: firebase
on:
workflow_dispatch:

env:
GITHUB_TOKEN: ${{ github.token }}

jobs:
windows:
runs-on: windows-latest
Expand All @@ -19,55 +22,41 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 1
path: ${{ github.workspace }}/SourceCache/firebase-cpp-sdk
ref: refs/heads/compnerd/swift
repository: thebrowsercompany/firebase-cpp-sdk

- uses: compnerd/gha-setup-vsdevenv@main
with:
host_arch: amd64
components: 'Microsoft.VisualStudio.Component.VC.Tools.x86.x64;Microsoft.VisualStudio.Component.VC.Tools.ARM64'
arch: ${{ matrix.arch }}

- uses: actions/setup-python@v4
id: python
with:
python-version: 3.9
python-version: ${{ matrix.intentionally_broken_like_upstream }}
architecture: 'x64'

- name: Install absl-py
run: pip install absl-py
- name: Install Desktop SDK prerequisites
uses: nick-invision/retry@v2
with:
timeout_minutes: 15
max_attempts: 3
command: |
python3 scripts/gha/install_prereqs_desktop.py --gha_build --arch '${{ matrix.arch }}'

- name: Configure firebase
- name: Build SDK
run:
cmake -B ${{ github.workspace }}/BinaryCache/firebase `
-D BUILD_SHARED_LIBS=NO `
-D CMAKE_BUILD_TYPE=Release `
-D CMAKE_INSTALL_PREFIX=${{ github.workspace }}/BuildRoot/Library/firebase/usr `
-G "Visual Studio 17 2022" `
-A ${{ matrix.platform }} `
-S ${{ github.workspace }}/SourceCache/firebase-cpp-sdk `
-D FIREBASE_CPP_BUILD_PACKAGE=YES `
-D FIREBASE_GITHUB_ACTION_BUILD=YES `
-D FIREBASE_INCLUDE_LIBRARY_DEFAULT=OFF `
-D FIREBASE_INCLUDE_AUTH=YES `
-D FIREBASE_INCLUDE_FIRESTORE=YES `
-D FIREBASE_USE_BORINGSSL=YES `
-D MSVC_RUNTIME_LIBRARY_STATIC=NO `
-D Python3_EXECUTABLE=${{ steps.python.outputs.python-path }}
- name: Build firebase
run: cmake --build ${{ github.workspace }}/BinaryCache/firebase --config Release
python3 scripts/gha/build_desktop.py --arch "${{ matrix.arch }}" --config "Release" --msvc_runtime_library "dynamic" --target firebase_app firebase_auth firebase_firestore --gha_build --verbose

- name: Install firebase
run: cmake --build ${{ github.workspace }}/BinaryCache/firebase --config Release --target install
run: cmake --build ${{ github.workspace }}/build --config Release --target install

- name: Install firebase (manual)
run: |
Copy-Item "${{ github.workspace }}/BinaryCache/firebase/external/src/firestore/Firestore/core/include/firebase/firestore/firestore_errors.h" "${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore/firestore_errors.h"
Copy-Item "${{ github.workspace }}/BinaryCache/firebase/external/src/firestore/Firestore/core/include/firebase/firestore/geo_point.h" "${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore/geo_point.h"
Copy-Item "${{ github.workspace }}/BinaryCache/firebase/external/src/firestore/Firestore/core/include/firebase/firestore/timestamp.h" "${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore/timestamp.h"
New-Item -ItemType Directory -Path ${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore
New-Item -ItemType Directory -Path ${{ github.workspace }}/BuildRoot/Library/firebase/usr/libs/windows

Copy-Item "${{ github.workspace }}/build/external/src/firestore/Firestore/core/include/firebase/firestore/firestore_errors.h" "${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore/firestore_errors.h"
Copy-Item "${{ github.workspace }}/build/external/src/firestore/Firestore/core/include/firebase/firestore/geo_point.h" "${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore/geo_point.h"
Copy-Item "${{ github.workspace }}/build/external/src/firestore/Firestore/core/include/firebase/firestore/timestamp.h" "${{ github.workspace }}/BuildRoot/Library/firebase/usr/include/firebase/firestore/timestamp.h"

Write-Host "Copying static libraries ..."
$source = "${{ github.workspace }}/BinaryCache/firebase"
$source = "${{ github.workspace }}/build"
$libraries = Get-ChildItem -Path $source -File -Recurse -Filter *.lib
foreach ($library in $libraries) {
$destination = Join-Path -Path "${{ github.workspace }}/BuildRoot/Library/firebase/usr/libs/windows" -ChildPath $library.Name
Expand Down