Skip to content

Commit 477c861

Browse files
authored
Support capacitor v6 and v7 #344
ref DEV-2507
2 parents c88cf33 + 918f87f commit 477c861

38 files changed

+2470
-4475
lines changed

.bundle/config

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
BUNDLE_PATH: "vendor/bundle"

.github/workflows/ci.yaml

Lines changed: 68 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
## Why do we specify bundler-cache: false?
2+
##
3+
## Ideally we should turn this on.
4+
## But this flag runs bundle install and cache, which does not suit our use case here.
5+
## See https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically
6+
17
name: CI
28

39
on:
@@ -12,12 +18,17 @@ on:
1218

1319
jobs:
1420
test:
15-
runs-on: ubuntu-22.04
21+
runs-on: macos-14
1622
steps:
17-
- uses: actions/checkout@v3
18-
- uses: actions/setup-node@v3
23+
- uses: actions/checkout@v4
24+
- uses: actions/setup-node@v4
1925
with:
2026
node-version-file: "./.tool-versions"
27+
- uses: ruby/setup-ruby@v1
28+
with:
29+
bundler-cache: false
30+
- run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
31+
- run: bundle install
2132
- run: npm ci
2233
- run: npm ci
2334
working-directory: ./website
@@ -34,18 +45,20 @@ jobs:
3445
if: ${{ !cancelled() }}
3546
- run: npm run test
3647
if: ${{ !cancelled() }}
48+
- run: npm run verify
49+
if: ${{ !cancelled() }}
3750
- run: npm run bundle
3851
if: ${{ !cancelled() }}
3952
- run: make docs
4053
if: ${{ !cancelled() }}
4154

4255
webapp-image:
43-
runs-on: ubuntu-22.04
56+
runs-on: ubuntu-24.04
4457
needs: test
4558
steps:
46-
- uses: actions/checkout@v3
59+
- uses: actions/checkout@v4
4760
- run: make build-image
48-
- uses: docker/login-action@v2
61+
- uses: docker/login-action@v3
4962
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.event_name == 'push' }}
5063
with:
5164
registry: quay.io
@@ -59,13 +72,16 @@ jobs:
5972
test_react_native_android:
6073
# When we change the runner image, the available Android build tools versions will also change.
6174
# We need to update build.gradle too.
62-
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
63-
runs-on: macos-13
75+
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
76+
runs-on: macos-14
6477
steps:
65-
- uses: actions/checkout@v3
66-
- uses: actions/setup-node@v3
78+
- uses: actions/checkout@v4
79+
- uses: actions/setup-node@v4
6780
with:
6881
node-version-file: "./.tool-versions"
82+
- uses: ruby/setup-ruby@v1
83+
with:
84+
bundler-cache: false
6985
- run: npm ci
7086
- run: npm run build
7187
- working-directory: ./example/reactnative
@@ -75,13 +91,16 @@ jobs:
7591
run: ./gradlew :app:assembleRelease
7692

7793
test_capacitor_ios:
78-
runs-on: macos-13
94+
runs-on: macos-14
7995
steps:
80-
- uses: actions/checkout@v3
81-
- uses: actions/setup-node@v3
96+
- uses: actions/checkout@v4
97+
- uses: actions/setup-node@v4
8298
with:
8399
node-version-file: "./.tool-versions"
84-
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
100+
- uses: ruby/setup-ruby@v1
101+
with:
102+
bundler-cache: false
103+
- run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
85104
- run: npm ci
86105
- run: npm run build
87106
- working-directory: ./example/capacitor
@@ -94,12 +113,15 @@ jobs:
94113
working-directory: ./example/capacitor/ios/App
95114
run: xcodebuild -quiet -workspace App.xcworkspace -scheme App -sdk iphonesimulator build
96115
test_capacitor_android:
97-
runs-on: macos-13
116+
runs-on: macos-14
98117
steps:
99-
- uses: actions/checkout@v3
100-
- uses: actions/setup-node@v3
118+
- uses: actions/checkout@v4
119+
- uses: actions/setup-node@v4
101120
with:
102121
node-version-file: "./.tool-versions"
122+
- uses: ruby/setup-ruby@v1
123+
with:
124+
bundler-cache: false
103125
- run: npm ci
104126
- run: npm run build
105127
- working-directory: ./example/capacitor
@@ -117,23 +139,17 @@ jobs:
117139
needs: test
118140
# When we change the runner image, the ruby version will change too.
119141
# We need to update .tool-versions to make them the same.
120-
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
121-
runs-on: macos-13
142+
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
143+
runs-on: macos-14
122144
steps:
123-
- uses: actions/checkout@v3
124-
- uses: actions/setup-node@v3
145+
- uses: actions/checkout@v4
146+
- uses: actions/setup-node@v4
125147
with:
126148
node-version-file: "./.tool-versions"
127149
- uses: ruby/setup-ruby@v1
128150
with:
129-
# Do not specify ruby-version so that it picks the version declared in .tool-versions
130-
# See https://github.com/ruby/setup-ruby?tab=readme-ov-file#supported-version-syntax
131-
# ruby-version: "Unspecified intentionally. See the above comment"
132-
# Ideally we should turn this on
133-
# But this flag runs bundle install and cache, which does not suit our use case here.
134-
# See https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically
135151
bundler-cache: false
136-
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
152+
- run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
137153
- run: npm install -g appcenter-cli
138154
- run: npm ci
139155
- run: npm run build
@@ -191,13 +207,16 @@ jobs:
191207
needs: test
192208
# When we change the runner image, the available Android build tools versions will also change.
193209
# We need to update build.gradle too.
194-
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
195-
runs-on: macos-13
210+
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
211+
runs-on: macos-14
196212
steps:
197-
- uses: actions/checkout@v3
198-
- uses: actions/setup-node@v3
213+
- uses: actions/checkout@v4
214+
- uses: actions/setup-node@v4
199215
with:
200216
node-version-file: "./.tool-versions"
217+
- uses: ruby/setup-ruby@v1
218+
with:
219+
bundler-cache: false
201220
- run: npm install -g appcenter-cli
202221
- run: npm ci
203222
- run: npm run build
@@ -218,14 +237,14 @@ jobs:
218237
echo -n "$ANDROID_KEYSTORE_BASE64" | base64 --decode -o $KEYSTORE_PATH
219238
- name: Run zipalign
220239
run: |
221-
"$ANDROID_HOME/build-tools/33.0.2/zipalign" -c -v 4 ./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk
240+
"$ANDROID_HOME/build-tools/33.0.3/zipalign" -c -v 4 ./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk
222241
- name: Run apksigner
223242
env:
224243
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.REACT_NATIVE_ANDROID_KEYSTORE_PASSWORD }}
225244
ANDROID_KEY_ALIAS: ${{ secrets.REACT_NATIVE_ANDROID_KEY_ALIAS }}
226245
ANDROID_KEY_PASSWORD: ${{ secrets.REACT_NATIVE_ANDROID_KEY_PASSWORD }}
227246
run: |
228-
"$ANDROID_HOME/build-tools/33.0.2/apksigner" sign \
247+
"$ANDROID_HOME/build-tools/33.0.3/apksigner" sign \
229248
--ks $RUNNER_TEMP/keystore.jks \
230249
--ks-key-alias "$ANDROID_KEY_ALIAS" \
231250
--ks-pass "pass:$ANDROID_KEYSTORE_PASSWORD" \
@@ -239,13 +258,16 @@ jobs:
239258
capacitor_ios:
240259
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.ref == 'refs/heads/master' && github.event_name == 'push' }}
241260
needs: test
242-
runs-on: macos-13
261+
runs-on: macos-14
243262
steps:
244-
- uses: actions/checkout@v3
245-
- uses: actions/setup-node@v3
263+
- uses: actions/checkout@v4
264+
- uses: actions/setup-node@v4
246265
with:
247266
node-version-file: "./.tool-versions"
248-
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
267+
- uses: ruby/setup-ruby@v1
268+
with:
269+
bundler-cache: false
270+
- run: sudo xcode-select -s /Applications/Xcode_15.4.app/Contents/Developer
249271
- run: npm install -g appcenter-cli
250272
- run: npm ci
251273
- run: npm run build
@@ -301,12 +323,15 @@ jobs:
301323
capacitor_android:
302324
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.ref == 'refs/heads/master' && github.event_name == 'push' }}
303325
needs: test
304-
runs-on: macos-13
326+
runs-on: macos-14
305327
steps:
306-
- uses: actions/checkout@v3
307-
- uses: actions/setup-node@v3
328+
- uses: actions/checkout@v4
329+
- uses: actions/setup-node@v4
308330
with:
309331
node-version-file: "./.tool-versions"
332+
- uses: ruby/setup-ruby@v1
333+
with:
334+
bundler-cache: false
310335
- run: npm install -g appcenter-cli
311336
- run: npm ci
312337
- run: npm run build
@@ -333,14 +358,14 @@ jobs:
333358
echo -n "$ANDROID_KEYSTORE_BASE64" | base64 --decode -o $KEYSTORE_PATH
334359
- name: Run zipalign
335360
run: |
336-
"$ANDROID_HOME/build-tools/33.0.2/zipalign" -c -v 4 ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk
361+
"$ANDROID_HOME/build-tools/35.0.1/zipalign" -c -v 4 ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk
337362
- name: Run apksigner
338363
env:
339364
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.CAPACITOR_ANDROID_KEYSTORE_PASSWORD }}
340365
ANDROID_KEY_ALIAS: ${{ secrets.CAPACITOR_ANDROID_KEY_ALIAS }}
341366
ANDROID_KEY_PASSWORD: ${{ secrets.CAPACITOR_ANDROID_KEY_PASSWORD }}
342367
run: |
343-
"$ANDROID_HOME/build-tools/33.0.2/apksigner" sign \
368+
"$ANDROID_HOME/build-tools/35.0.1/apksigner" sign \
344369
--ks $RUNNER_TEMP/keystore.jks \
345370
--ks-key-alias "$ANDROID_KEY_ALIAS" \
346371
--ks-pass "pass:$ANDROID_KEYSTORE_PASSWORD" \

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ dist/
1414
xcuserdata/
1515
xcshareddata/
1616
temp/
17+
18+
# Ruby
19+
vendor/bundle/

.tool-versions

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
nodejs 20.9.0
1+
nodejs 20.18.3
22
yarn 1.22.22
33
kubectl 1.21.8
4-
# https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md?plain=1#L31
5-
ruby 3.0.7
4+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md#ruby
5+
ruby 3.3.7

Gemfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
## NOTE(louis): This Gemfile is intended for the whole project, except ./example/reactnative
2+
3+
source 'https://rubygems.org'
4+
5+
# Ruby 3.3 is the default.
6+
# https://github.com/actions/runner-images/blob/main/images/macos/macos-14-arm64-Readme.md
7+
# https://github.com/actions/runner-images/issues/11345
8+
ruby "~> 3.3"
9+
10+
gem 'cocoapods', '~> 1.16'

0 commit comments

Comments
 (0)