Skip to content

Commit d26edb8

Browse files
author
farfromrefug
committed
chore: ci ios typings
1 parent 0dc1831 commit d26edb8

File tree

2 files changed

+113
-0
lines changed

2 files changed

+113
-0
lines changed

.github/workflows/ios_typings.yml

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: 'release'
2+
3+
on:
4+
workflow_dispatch:
5+
6+
jobs:
7+
release:
8+
runs-on: macos-latest
9+
steps:
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
12+
with:
13+
fetch-depth: "0"
14+
submodules: true
15+
16+
- name: setup node
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: lts/*
20+
registry-url: 'https://registry.npmjs.org'
21+
22+
- name: Install Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: 3.12
26+
27+
- uses: oNaiPs/secrets-to-env-action@v1
28+
with:
29+
secrets: ${{ toJSON(secrets) }}
30+
31+
- name: Enable CorePack
32+
run: |
33+
corepack enable
34+
yarn config get globalFolder # the yarn command will ensure the correct yarn version is downloaded and installed
35+
36+
- name: Install NativeScript
37+
run: |
38+
python3 -m pip install --upgrade pip six
39+
npm i -g @akylas/nativescript-cli --ignore-scripts --legacy-peer-deps
40+
ns package-manager set yarn2
41+
ns usage-reporting disable
42+
ns error-reporting disable
43+
44+
- name: Get yarn cache directory path
45+
id: yarn-cache-dir-path
46+
run: echo "::set-output name=dir::$(yarn config get globalFolder)"
47+
48+
- name: Get yarn cache directory path
49+
id: yarn-cache-dir-path
50+
run: echo "::set-output name=dir::$(yarn config get globalFolder)"
51+
52+
53+
- name: Install deps
54+
if: steps.yarn-node_modules.outputs.cache-hit != 'true'
55+
uses: bahmutov/npm-install@v1
56+
with:
57+
install-command: yarn install --silent
58+
env:
59+
YARN_ENABLE_IMMUTABLE_INSTALLS: false
60+
61+
- name: Run shell prepare script
62+
if: ${{ hashFiles('scripts/ci.prepare.sh') != '' }}
63+
run: |
64+
sh scripts/ci.prepare.sh --platform ios
65+
66+
- name: build project
67+
run: |
68+
npm run build
69+
70+
- name: build typings
71+
run: |
72+
cd demo-svelte
73+
TNS_TYPESCRIPT_DECLARATIONS_PATH="$(pwd)/typings" ns build ios
74+
75+
- uses: actions/upload-artifact@v4
76+
with:
77+
name: ios_typings
78+
path: demo-svelte/typings/*
79+

scripts/ci.prepare.sh

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/usr/bin/env bash
2+
3+
for i in "$@"; do
4+
case $i in
5+
-p|--platform)
6+
PLATFORM="$2"
7+
shift # past argument
8+
shift # past value
9+
;;
10+
-*|--*)
11+
echo "Unknown option $1"
12+
exit 1
13+
;;
14+
*)
15+
;;
16+
esac
17+
done
18+
19+
echo "PLATFORM = ${PLATFORM}"
20+
21+
if [[ -z "${CARTO_SDK_VERSION}" ]]; then
22+
CARTO_SDK_VERSION="5.0.0-rc.5"
23+
else
24+
CARTO_SDK_VERSION="${CARTO_SDK_VERSION}"
25+
fi
26+
27+
28+
if [ "$PLATFORM" = "android" ]; then
29+
wget https://github.com/Akylas/mobile-sdk/releases/download/v$CARTO_SDK_VERSION/carto-mobile-sdk-android-$CARTO_SDK_VERSION.aar
30+
mv carto-mobile-sdk-android-$CARTO_SDK_VERSION.aar ./packages/ui-carto/platforms/android
31+
else
32+
wget https://github.com/Akylas/mobile-sdk/releases/download/v$CARTO_SDK_VERSION/carto-mobile-sdk-ios-$CARTO_SDK_VERSION.zip
33+
unzip -o -d ./packages/ui-carto/platforms/ios carto-mobile-sdk-ios-$CARTO_SDK_VERSION.zip
34+
fi

0 commit comments

Comments
 (0)