chore: publish v3.0.0 #28
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build example | |
on: | |
push: | |
paths-ignore: | |
- '**/*.md' | |
branches: | |
- main | |
defaults: | |
run: | |
working-directory: example | |
jobs: | |
# Create example build for Android | |
build-apk: | |
name: Build Android APK | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup Web environment to install packages. | |
- name: Setup Web environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'yarn' | |
# Setup Java environment in order to build the Android app. | |
- name: Setup Java 17 | |
uses: actions/setup-java@v4 | |
with: | |
distribution: 'zulu' | |
java-version: '17' | |
- name: Setup Gradle | |
uses: gradle/actions/setup-gradle@v3 | |
with: | |
add-job-summary: 'on-failure' | |
- name: Install plugin packages | |
working-directory: . | |
run: yarn install --frozen-lockfile | |
- name: Build the plugin | |
working-directory: . | |
run: yarn build | |
- name: Install example packages | |
run: yarn install --frozen-lockfile | |
- name: Build the example project | |
run: yarn build | |
- name: Sync to copy web assets into the platform | |
run: npx cap sync android | |
- name: Build Android debug APK | |
working-directory: example/android | |
run: ./gradlew assembleDebug | |
- name: Save apk file as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cap_safearea_plugin_example_android | |
path: example/android/app/build/outputs/apk/debug/app-debug.apk | |
# Build iOS .app build that can drag and dropped into a iOS simulator | |
build-ios-simulator: | |
name: Create an iOS Simulator build | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
# Setup Web environment to install packages. | |
- name: Setup Web environment | |
uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
cache: 'yarn' | |
- name: Restore Pods cache | |
uses: actions/cache@v4 | |
with: | |
path: | | |
ios/Pods | |
~/Library/Caches/CocoaPods | |
~/.cocoapods | |
key: ${{ runner.os }}-pods-${{ hashFiles('ios/Podfile.lock') }} | |
restore-keys: ${{ runner.os }}-pods- | |
- name: Install plugin packages | |
working-directory: . | |
run: yarn install --frozen-lockfile | |
- name: Build the plugin | |
working-directory: . | |
run: yarn build | |
- name: Install example packages | |
run: yarn install --frozen-lockfile | |
- name: Build the example project | |
run: yarn build | |
- name: Sync to copy web assets into the platform | |
run: npx cap sync ios | |
- name: Install xcpretty | |
run: gem install xcpretty | |
- name: Run simulator build command | |
working-directory: example/ios/App | |
run: | | |
set -o pipefail | |
xcodebuild \ | |
-scheme App \ | |
-workspace App.xcworkspace \ | |
-sdk iphonesimulator \ | |
-configuration Release \ | |
-derivedDataPath build | xcpretty | |
- name: Store build .app file as zip | |
working-directory: example/ios/App | |
run: | | |
cd build/Build/Products/Release-iphonesimulator | |
mv App.app safearea_plugin_example_ios.app | |
mkdir -p output | |
zip -r -y -o output/safearea_plugin_example_ios.zip safearea_plugin_example_ios.app | |
- name: Save build file as artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: cap_safearea_plugin_example_ios | |
path: example/ios/App/build/Build/Products/Release-iphonesimulator/output |