Skip to content

Commit 9a7c1f4

Browse files
Include Swift in full SDK generation
1 parent a100f02 commit 9a7c1f4

7 files changed

Lines changed: 43 additions & 20 deletions

File tree

.github/workflows/check-codegen.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ jobs:
1515
steps:
1616
- uses: actions/checkout@v6
1717
with:
18-
submodules: recursive
1918
persist-credentials: true
2019

2120
- name: Check all submodules up-to-date
21+
env:
22+
SWIFT_SUBMODULE_DEPLOY_KEY: ${{ secrets.SWIFT_SUBMODULE_DEPLOY_KEY }}
2223
run: |
23-
git submodule update --recursive --remote
24+
./scripts/checkout-submodules.bash --remote
2425
git diff --exit-code
2526
2627
check-swagger:
@@ -35,8 +36,11 @@ jobs:
3536
runs-on: macos-latest
3637
steps:
3738
- uses: actions/checkout@v6
38-
with:
39-
submodules: recursive
39+
40+
- name: Checkout submodules
41+
env:
42+
SWIFT_SUBMODULE_DEPLOY_KEY: ${{ secrets.SWIFT_SUBMODULE_DEPLOY_KEY }}
43+
run: ./scripts/checkout-submodules.bash
4044

4145
- uses: actions/setup-java@v5
4246
with:

.github/workflows/check-urls.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ jobs:
1717
runs-on: ubuntu-latest
1818
steps:
1919
- uses: actions/checkout@v6
20-
with:
21-
submodules: recursive
20+
21+
- name: Checkout submodules
22+
env:
23+
SWIFT_SUBMODULE_DEPLOY_KEY: ${{ secrets.SWIFT_SUBMODULE_DEPLOY_KEY }}
24+
run: ./scripts/checkout-submodules.bash
2225

2326
- name: Check all URLs
2427
run: ./scripts/check_all_urls.sh

codegen/generate-swift.bash

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,5 @@ mv "$tempDir/.openapi-generator/FILES" "$targetDir/.openapi-generator/"
4545
cp ../LICENSE "$targetDir/"
4646

4747
rm -rf "$tempDir"
48+
49+
pushd "$targetDir" && make after-gen && popd >/dev/null

scripts/check-urls.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
URLS_TO_IGNORE = frozenset(
3838
[
3939
"https://api.aspose.cloud",
40+
# Temporary while the Swift SDK repository is private during bootstrap.
41+
"https://github.com/aspose-barcode-cloud/Aspose.BarCode-Cloud-SDK-for-Swift.git",
4042
"https://www.aspose.cloud/404",
4143
"https://www.aspose.cloud/404/",
4244
]

scripts/checkout-submodules.bash

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
set -euo pipefail
3+
4+
submodule_args=(--init --recursive)
5+
if [ "$#" -gt 0 ]; then
6+
submodule_args+=("$@")
7+
fi
8+
9+
if [ -n "${SWIFT_SUBMODULE_DEPLOY_KEY:-}" ]; then
10+
ssh_dir="$HOME/.ssh"
11+
key_file="$ssh_dir/aspose_barcode_cloud_swift_submodule"
12+
13+
mkdir -p "$ssh_dir"
14+
chmod 700 "$ssh_dir"
15+
printf '%s\n' "$SWIFT_SUBMODULE_DEPLOY_KEY" > "$key_file"
16+
chmod 600 "$key_file"
17+
ssh-keyscan github.com >> "$ssh_dir/known_hosts" 2>/dev/null
18+
19+
git config submodule.submodules/swift.url git@github.com:aspose-barcode-cloud/Aspose.BarCode-Cloud-SDK-for-Swift.git
20+
export GIT_SSH_COMMAND="ssh -i $key_file -o IdentitiesOnly=yes -o UserKnownHostsFile=$ssh_dir/known_hosts"
21+
fi
22+
23+
git submodule update "${submodule_args[@]}"

scripts/generate-all.bash

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,9 @@ set -euo pipefail
44

55
pushd "$( dirname "${BASH_SOURCE[0]}" )/../codegen"
66

7-
generators=(
8-
android
9-
dart
10-
dotnet
11-
go
12-
java
13-
node
14-
php
15-
python
16-
)
17-
18-
for gen in "${generators[@]}"
7+
for gen in generate-*.bash
198
do
20-
"./generate-${gen}.bash"
9+
"./${gen}"
2110
done
2211

2312
popd >/dev/null

submodules/swift

Submodule swift updated from e326ac2 to 06580d6

0 commit comments

Comments
 (0)