Skip to content

Bump vite from 5.2.12 to 5.4.6 in /example/capacitor #659

Bump vite from 5.2.12 to 5.4.6 in /example/capacitor

Bump vite from 5.2.12 to 5.4.6 in /example/capacitor #659

Workflow file for this run

name: CI
on:
push:
branches:
- '*'
- '!gh-pages'
pull_request:
branches:
- '*'
- '!gh-pages'
jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: npm ci
- run: npm ci
working-directory: ./website
- run: npm audit
if: ${{ !cancelled() }}
- run: npm audit
working-directory: ./website
if: ${{ !cancelled() }}
- run: npm run format
if: ${{ !cancelled() }}
- run: npm run lint
if: ${{ !cancelled() }}
- run: npm run typecheck
if: ${{ !cancelled() }}
- run: npm run test
if: ${{ !cancelled() }}
- run: npm run bundle
if: ${{ !cancelled() }}
- run: make docs
if: ${{ !cancelled() }}
webapp-image:
runs-on: ubuntu-22.04
needs: test
steps:
- uses: actions/checkout@v3
- run: make build-image
- uses: docker/login-action@v2
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.event_name == 'push' }}
with:
registry: quay.io
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
- run: make push-image
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.event_name == 'push' }}
# react_native_ios cannot be built on simulator due to WeChat SDK
test_react_native_android:
# When we change the runner image, the available Android build tools versions will also change.
# We need to update build.gradle too.
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: npm ci
- run: npm run build
- working-directory: ./example/reactnative
run: yarn
- name: Build unsigned APK
working-directory: ./example/reactnative/android
run: ./gradlew :app:assembleRelease
test_capacitor_ios:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- run: npm ci
- run: npm run build
- working-directory: ./example/capacitor
run: npm ci
- working-directory: ./example/capacitor
run: npm run build
- working-directory: ./example/capacitor
run: npx cap sync
- name: Run xcodebuild
working-directory: ./example/capacitor/ios/App
run: xcodebuild -quiet -workspace App.xcworkspace -scheme App -sdk iphonesimulator build
test_capacitor_android:
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: npm ci
- run: npm run build
- working-directory: ./example/capacitor
run: npm ci
- working-directory: ./example/capacitor
run: npm run build
- working-directory: ./example/capacitor
run: npx cap sync
- name: Build unsigned APK
working-directory: ./example/capacitor/android
run: ./gradlew :app:assembleRelease
react_native_ios:
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.ref == 'refs/heads/master' && github.event_name == 'push' }}
needs: test
# When we change the runner image, the ruby version will change too.
# We need to update .tool-versions to make them the same.
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- uses: ruby/setup-ruby@v1
with:
# Do not specify ruby-version so that it picks the version declared in .tool-versions
# See https://github.com/ruby/setup-ruby?tab=readme-ov-file#supported-version-syntax
# ruby-version: "Unspecified intentionally. See the above comment"
# Ideally we should turn this on
# But this flag runs bundle install and cache, which does not suit our use case here.
# See https://github.com/ruby/setup-ruby?tab=readme-ov-file#caching-bundle-install-automatically
bundler-cache: false
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- run: npm install -g appcenter-cli
- run: npm ci
- run: npm run build
- working-directory: ./example/reactnative
run: yarn
- working-directory: ./example/reactnative
# Install cocoapods from the Gemfile
run: bundle install
- working-directory: ./example/reactnative
# Run the specific cocoapods
run: bundle exec pod install --project-directory=ios
- name: Install the Apple certificate and provisioning profile
env:
IOS_CERTIFICATE_BASE64: ${{ secrets.REACT_NATIVE_IOS_CERTIFICATE_BASE64 }}
IOS_PROVISIONING_PROFILE_BASE64: ${{ secrets.REACT_NATIVE_IOS_PROVISIONING_PROFILE_BASE64 }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$IOS_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$IOS_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PP_PATH
security create-keychain -p "" $KEYCHAIN_PATH
security set-keychain-settings $KEYCHAIN_PATH
security unlock-keychain -p "" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Set CFBundleVersion
working-directory: ./example/reactnative/ios
run: |
BUILD_NUMBER=$(date +%s)
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $BUILD_NUMBER" ./reactNativeExample/Info.plist
- name: Run xcodebuild archive
working-directory: ./example/reactnative/ios
run: xcodebuild -workspace reactNativeExample.xcworkspace -scheme reactNativeExample -configuration Release -archivePath "$RUNNER_TEMP/reactNativeExample.xcarchive" archive
- name: Run xcodebuild -exportArchive
working-directory: ./example/reactnative/ios
run: xcodebuild -exportArchive -archivePath "$RUNNER_TEMP/reactNativeExample.xcarchive" -exportPath "$RUNNER_TEMP/reactNativeExample.export" -exportOptionsPlist "./ExportOptions.plist"
- name: Distribute to App Center
env:
APPCENTER_ACCESS_TOKEN: ${{ secrets.REACT_NATIVE_IOS_APPCENTER_ACCESS_TOKEN }}
run: appcenter distribute release --debug --silent --file "$RUNNER_TEMP/reactNativeExample.export/reactNativeExample.ipa" --store "App Store Connect Users" --app "Oursky/Authgear-demo-RN-iOS" --release-notes "no release notes"
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
react_native_android:
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.ref == 'refs/heads/master' && github.event_name == 'push' }}
needs: test
# When we change the runner image, the available Android build tools versions will also change.
# We need to update build.gradle too.
# See https://github.com/actions/runner-images/blob/main/images/macos/macos-13-Readme.md
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: npm install -g appcenter-cli
- run: npm ci
- run: npm run build
- working-directory: ./example/reactnative
run: yarn
- name: Set versionCode
run: |
VERSION_CODE=$(date +%s)
sed -I "" "s/versionCode 1/versionCode $VERSION_CODE/" ./example/reactnative/android/app/build.gradle
- name: Build unsigned APK
working-directory: ./example/reactnative/android
run: ./gradlew :app:assembleRelease
- name: Install keystore
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.REACT_NATIVE_ANDROID_KEYSTORE_BASE64 }}
run: |
KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
echo -n "$ANDROID_KEYSTORE_BASE64" | base64 --decode -o $KEYSTORE_PATH
- name: Run zipalign
run: |
"$ANDROID_HOME/build-tools/33.0.2/zipalign" -c -v 4 ./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk
- name: Run apksigner
env:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.REACT_NATIVE_ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.REACT_NATIVE_ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.REACT_NATIVE_ANDROID_KEY_PASSWORD }}
run: |
"$ANDROID_HOME/build-tools/33.0.2/apksigner" sign \
--ks $RUNNER_TEMP/keystore.jks \
--ks-key-alias "$ANDROID_KEY_ALIAS" \
--ks-pass "pass:$ANDROID_KEYSTORE_PASSWORD" \
--key-pass "pass:$ANDROID_KEY_PASSWORD" \
--out ./example/reactnative/android/app/build/outputs/apk/release/app-release-signed.apk \
./example/reactnative/android/app/build/outputs/apk/release/app-release-unsigned.apk
- name: Distribute to App Center
env:
APPCENTER_ACCESS_TOKEN: ${{ secrets.REACT_NATIVE_ANDROID_APPCENTER_ACCESS_TOKEN }}
run: appcenter distribute release --debug --silent --file ./example/reactnative/android/app/build/outputs/apk/release/app-release-signed.apk --group "Collaborators" --app "Oursky/Authgear-demo-RN-Android" --release-notes "no release notes"
capacitor_ios:
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.ref == 'refs/heads/master' && github.event_name == 'push' }}
needs: test
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: sudo xcode-select -s /Applications/Xcode_15.2.app/Contents/Developer
- run: npm install -g appcenter-cli
- run: npm ci
- run: npm run build
- working-directory: ./example/capacitor
run: npm ci
- working-directory: ./example/capacitor
run: npm audit
- working-directory: ./example/capacitor
run: npm run build
- working-directory: ./example/capacitor
run: npx cap sync
- name: Install the Apple certificate and provisioning profile
env:
IOS_CERTIFICATE_BASE64: ${{ secrets.CAPACITOR_IOS_CERTIFICATE_BASE64 }}
IOS_PROVISIONING_PROFILE_BASE64: ${{ secrets.CAPACITOR_IOS_PROVISIONING_PROFILE_BASE64 }}
run: |
CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
echo -n "$IOS_CERTIFICATE_BASE64" | base64 --decode -o $CERTIFICATE_PATH
echo -n "$IOS_PROVISIONING_PROFILE_BASE64" | base64 --decode -o $PP_PATH
security create-keychain -p "" $KEYCHAIN_PATH
security set-keychain-settings $KEYCHAIN_PATH
security unlock-keychain -p "" $KEYCHAIN_PATH
security import $CERTIFICATE_PATH -P "" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH
mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
- name: Set CFBundleVersion
working-directory: ./example/capacitor/ios/App
run: |
BUILD_NUMBER=$(date +%s)
/usr/libexec/Plistbuddy -c "Set CFBundleVersion $BUILD_NUMBER" ./App/Info.plist
- name: Run xcodebuild archive
working-directory: ./example/capacitor/ios/App
run: xcodebuild -workspace App.xcworkspace -scheme App -configuration Release -archivePath "$RUNNER_TEMP/App.xcarchive" archive
- name: Run xcodebuild -exportArchive
working-directory: ./example/capacitor/ios/App
run: xcodebuild -exportArchive -archivePath "$RUNNER_TEMP/App.xcarchive" -exportPath "$RUNNER_TEMP/App.export" -exportOptionsPlist "./ExportOptions.plist"
- name: Distribute to App Center
env:
APPCENTER_ACCESS_TOKEN: ${{ secrets.CAPACITOR_IOS_APPCENTER_ACCESS_TOKEN }}
run: appcenter distribute release --debug --silent --file "$RUNNER_TEMP/App.export/App.ipa" --store "App Store Connect Users" --app "Oursky/Authgear-Demo-Capacitor-iOS" --release-notes "no release notes"
- name: Clean up keychain and provisioning profile
if: ${{ always() }}
run: |
security delete-keychain $RUNNER_TEMP/app-signing.keychain-db
rm ~/Library/MobileDevice/Provisioning\ Profiles/build_pp.mobileprovision
capacitor_android:
if: ${{ github.repository == 'authgear/authgear-sdk-js' && github.ref == 'refs/heads/master' && github.event_name == 'push' }}
needs: test
runs-on: macos-13
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: "./.tool-versions"
- run: npm install -g appcenter-cli
- run: npm ci
- run: npm run build
- working-directory: ./example/capacitor
run: npm ci
- working-directory: ./example/capacitor
run: npm audit
- working-directory: ./example/capacitor
run: npm run build
- working-directory: ./example/capacitor
run: npx cap sync
- name: Set versionCode
run: |
VERSION_CODE=$(date +%s)
sed -I "" "s/versionCode 1/versionCode $VERSION_CODE/" ./example/capacitor/android/app/build.gradle
- name: Build unsigned APK
working-directory: ./example/capacitor/android
run: ./gradlew :app:assembleRelease
- name: Install keystore
env:
ANDROID_KEYSTORE_BASE64: ${{ secrets.CAPACITOR_ANDROID_KEYSTORE_BASE64 }}
run: |
KEYSTORE_PATH=$RUNNER_TEMP/keystore.jks
echo -n "$ANDROID_KEYSTORE_BASE64" | base64 --decode -o $KEYSTORE_PATH
- name: Run zipalign
run: |
"$ANDROID_HOME/build-tools/33.0.2/zipalign" -c -v 4 ./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk
- name: Run apksigner
env:
ANDROID_KEYSTORE_PASSWORD: ${{ secrets.CAPACITOR_ANDROID_KEYSTORE_PASSWORD }}
ANDROID_KEY_ALIAS: ${{ secrets.CAPACITOR_ANDROID_KEY_ALIAS }}
ANDROID_KEY_PASSWORD: ${{ secrets.CAPACITOR_ANDROID_KEY_PASSWORD }}
run: |
"$ANDROID_HOME/build-tools/33.0.2/apksigner" sign \
--ks $RUNNER_TEMP/keystore.jks \
--ks-key-alias "$ANDROID_KEY_ALIAS" \
--ks-pass "pass:$ANDROID_KEYSTORE_PASSWORD" \
--key-pass "pass:$ANDROID_KEY_PASSWORD" \
--out ./example/capacitor/android/app/build/outputs/apk/release/app-release-signed.apk \
./example/capacitor/android/app/build/outputs/apk/release/app-release-unsigned.apk
- name: Distribute to App Center
env:
APPCENTER_ACCESS_TOKEN: ${{ secrets.CAPACITOR_ANDROID_APPCENTER_ACCESS_TOKEN }}
run: appcenter distribute release --debug --silent --file ./example/capacitor/android/app/build/outputs/apk/release/app-release-signed.apk --group "Collaborators" --app "Oursky/Authgear-Demo-Capacitor-Android" --release-notes "no release notes"