Skip to content

Commit f127185

Browse files
jonsimantovtom-andersen
authored andcommitted
Add step to C++ packaging to create Windows package. (#1370)
* Add step to C++ packaging to create Windows package. * Don't trigger integration tests until the Windows artifact is created too.
1 parent f32a90c commit f127185

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

.github/workflows/cpp-packaging.yml

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,51 @@ jobs:
759759
name: firebase_cpp_sdk.zip
760760
path: firebase_cpp_sdk.zip
761761

762+
create_windows_only_package:
763+
name: create-windows-only-package
764+
runs-on: ubuntu-20.04
765+
needs: [merge_packages]
766+
steps:
767+
- name: download SDK zip
768+
uses: actions/download-artifact@v3
769+
with:
770+
name: firebase_cpp_sdk.zip
771+
- name: unzip SDK and remove non-Windows files
772+
run: |
773+
set -x
774+
unzip -q firebase_cpp_sdk.zip -d windows-sdk
775+
cd windows-sdk
776+
# Rename the top-level directory.
777+
mv firebase_cpp_sdk firebase_cpp_sdk_windows
778+
cd firebase_cpp_sdk_windows
779+
# Remove all non-Windows files.
780+
rm -rf xcframeworks frameworks libs/linux libs/ios libs/tvos libs/darwin libs/android Android
781+
cat > readme_windows.md <<EOF
782+
# Firebase C++ SDK - Windows only
783+
784+
This package contains only the subset of the Firebase C++ SDK needed for use on
785+
Windows. For general SDK information, see the accompanying readme.md file.
786+
EOF
787+
cd ..
788+
zip -9 -r -y ../firebase_cpp_sdk_windows.zip firebase_cpp_sdk_windows
789+
cd ..
790+
- name: compute Windows SDK hash
791+
shell: bash
792+
run: |
793+
${{ env.hashCommand }} --tag firebase_cpp_sdk_windows.zip > firebase_cpp_sdk_windows_hash.txt
794+
echo "::warning ::$(cat firebase_cpp_sdk_windows_hash.txt)"
795+
- name: upload Windows hash
796+
uses: actions/upload-artifact@v3
797+
with:
798+
name: firebase_cpp_sdk_windows_hash.txt
799+
path: firebase_cpp_sdk_windows_hash.txt
800+
- name: upload Windows SDK zip
801+
uses: actions/upload-artifact@v3
802+
with:
803+
name: firebase_cpp_sdk_windows.zip
804+
path: firebase_cpp_sdk_windows.zip
805+
806+
762807
cleanup_packaging_artifacts:
763808
# Clean up intermediate artifacts from packaging step.
764809
# This can happen after the final package merge is finished.
@@ -782,7 +827,7 @@ jobs:
782827

783828
trigger_integration_tests:
784829
# Trigger the integration_tests workflow.
785-
needs: [merge_packages, download_sdk_package, cleanup_packaging_artifacts]
830+
needs: [merge_packages, download_sdk_package, create_windows_only_package, cleanup_packaging_artifacts]
786831
if: (github.event.inputs.skipIntegrationTests == 0 || github.event.inputs.skipIntegrationTests == '') && !cancelled() && !failure()
787832
runs-on: ubuntu-20.04
788833
steps:

0 commit comments

Comments
 (0)