Skip to content

Commit d09c961

Browse files
committed
Add validation for nupkg layout in CI workflows and document sample iOS workflow
1 parent 137dfb7 commit d09c961

4 files changed

Lines changed: 157 additions & 6 deletions

File tree

.github/workflows/ci.yml

Lines changed: 40 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,47 @@ jobs:
4848
-c Release \
4949
-o artifacts/nuget
5050
51-
- name: Build iOS sample
51+
- name: Validate nupkg layout
5252
run: |
53-
dotnet build samples/Kapusch.Facebook.iOS.Sample/Kapusch.Facebook.iOS.Sample.csproj \
54-
-c Debug \
55-
-p:RuntimeIdentifier=iossimulator-arm64 \
56-
-p:EnableCodeSigning=false
53+
python3 - <<'PY'
54+
import glob, sys, zipfile
55+
56+
nupkgs = glob.glob("artifacts/nuget/*.nupkg")
57+
if not nupkgs:
58+
print("ERROR: no .nupkg found under artifacts/nuget/")
59+
sys.exit(1)
60+
61+
nupkg = sorted(nupkgs)[-1]
62+
print(f"Validating {nupkg}")
63+
64+
z = zipfile.ZipFile(nupkg)
65+
names = set(z.namelist())
66+
67+
required = [
68+
"buildTransitive/Kapusch.Facebook.iOS.targets",
69+
"kfb.xcframework/Info.plist",
70+
"fb/FBAEMKit.xcframework/Info.plist",
71+
"fb/FBSDKCoreKit.xcframework/Info.plist",
72+
"fb/FBSDKCoreKit_Basics.xcframework/Info.plist",
73+
"fb/FBSDKGamingServicesKit.xcframework/Info.plist",
74+
"fb/FBSDKLoginKit.xcframework/Info.plist",
75+
"fb/FBSDKShareKit.xcframework/Info.plist",
76+
]
77+
78+
missing = [p for p in required if p not in names]
79+
if missing:
80+
print("ERROR: missing required paths in nupkg:")
81+
for p in missing:
82+
print(f" - {p}")
83+
sys.exit(1)
84+
85+
# Guardrail: ensure the wrapper is not flattened at the package root.
86+
if "Info.plist" in names:
87+
print("ERROR: wrapper appears flattened (found 'Info.plist' at package root).")
88+
sys.exit(1)
89+
90+
print("OK: nupkg layout looks correct.")
91+
PY
5792
5893
- uses: actions/upload-artifact@v4
5994
with:

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,47 @@ jobs:
7171
-o artifacts/nuget \
7272
/p:PackageVersion="${{ steps.version.outputs.version }}"
7373
74+
- name: Validate nupkg layout
75+
run: |
76+
python3 - <<'PY'
77+
import glob, sys, zipfile
78+
79+
nupkgs = glob.glob("artifacts/nuget/*.nupkg")
80+
if not nupkgs:
81+
print("ERROR: no .nupkg found under artifacts/nuget/")
82+
sys.exit(1)
83+
84+
nupkg = sorted(nupkgs)[-1]
85+
print(f"Validating {nupkg}")
86+
87+
z = zipfile.ZipFile(nupkg)
88+
names = set(z.namelist())
89+
90+
required = [
91+
"buildTransitive/Kapusch.Facebook.iOS.targets",
92+
"kfb.xcframework/Info.plist",
93+
"fb/FBAEMKit.xcframework/Info.plist",
94+
"fb/FBSDKCoreKit.xcframework/Info.plist",
95+
"fb/FBSDKCoreKit_Basics.xcframework/Info.plist",
96+
"fb/FBSDKGamingServicesKit.xcframework/Info.plist",
97+
"fb/FBSDKLoginKit.xcframework/Info.plist",
98+
"fb/FBSDKShareKit.xcframework/Info.plist",
99+
]
100+
101+
missing = [p for p in required if p not in names]
102+
if missing:
103+
print("ERROR: missing required paths in nupkg:")
104+
for p in missing:
105+
print(f" - {p}")
106+
sys.exit(1)
107+
108+
if "Info.plist" in names:
109+
print("ERROR: wrapper appears flattened (found 'Info.plist' at package root).")
110+
sys.exit(1)
111+
112+
print("OK: nupkg layout looks correct.")
113+
PY
114+
74115
- name: Push to GitHub Packages
75116
env:
76117
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/sample-ios.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: sample-ios (manual)
2+
3+
on:
4+
workflow_dispatch:
5+
6+
permissions:
7+
contents: read
8+
9+
jobs:
10+
build_sample_ios:
11+
runs-on: macos-15
12+
env:
13+
DOTNET_MULTILEVEL_LOOKUP: 0
14+
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
15+
DOTNET_CLI_TELEMETRY_OPTOUT: 1
16+
DOTNET_NOLOGO: true
17+
DOTNET_CLI_WORKLOAD_UPDATE_NOTIFICATION_LEVEL: Disable
18+
19+
steps:
20+
- uses: actions/checkout@v4
21+
22+
- name: Setup Xcode 26.0
23+
uses: maxim-lobanov/setup-xcode@v1
24+
with:
25+
xcode-version: "26.0"
26+
27+
- uses: actions/setup-dotnet@v4
28+
with:
29+
dotnet-version: "10.0.x"
30+
31+
- name: Pin workload update mode (manifests)
32+
shell: bash
33+
run: |
34+
dotnet workload config --update-mode manifests
35+
dotnet workload config --update-mode
36+
37+
- name: Purge incompatible iOS packs (cache defense)
38+
shell: bash
39+
run: |
40+
set -euo pipefail
41+
PACKS_DIR="$HOME/.dotnet/packs"
42+
for v in 26.2; do
43+
if [ -d "$PACKS_DIR" ] && compgen -G "$PACKS_DIR/Microsoft.iOS.*_${v}*" > /dev/null; then
44+
echo "Removing cached iOS ${v} packs from $PACKS_DIR"
45+
rm -rf "$PACKS_DIR"/Microsoft.iOS.*_${v}*
46+
fi
47+
done
48+
49+
- name: Install iOS workload
50+
shell: bash
51+
run: |
52+
dotnet workload install ios --skip-manifest-update
53+
54+
- name: Diagnostics (.NET + workloads)
55+
shell: bash
56+
run: |
57+
dotnet --info
58+
dotnet workload list
59+
60+
- name: Build iOS wrapper
61+
run: |
62+
bash src/Kapusch.FacebookApisForiOSComponents/Native/iOS/build.sh
63+
64+
- name: Collect Facebook xcframeworks
65+
run: |
66+
bash src/Kapusch.FacebookApisForiOSComponents/Native/iOS/collect-facebook-xcframeworks.sh
67+
68+
- name: Build iOS sample (simulator, no signing)
69+
run: |
70+
dotnet build samples/Kapusch.Facebook.iOS.Sample/Kapusch.Facebook.iOS.Sample.csproj \
71+
-c Debug \
72+
-p:RuntimeIdentifier=iossimulator-arm64 \
73+
-p:EnableCodeSigning=false
74+

samples/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ Principles:
88

99
## iOS
1010

11-
- `samples/Kapusch.Facebook.iOS.Sample/` — minimal UIKit app that links against the wrapper + Facebook xcframeworks.
11+
- `samples/Kapusch.Facebook.iOS.Sample/` — minimal UIKit app that links against the wrapper + Facebook xcframeworks (local validation).
12+
- Manual CI: `.github/workflows/sample-ios.yml` (run via `workflow_dispatch`).

0 commit comments

Comments
 (0)