Skip to content

start v2 rewrite

start v2 rewrite #114

Workflow file for this run

name: App
on:
workflow_dispatch:
push:
paths:
- "app/**"
- "bun.lockb"
- ".github/workflows/app.yaml"
jobs:
build_web:
name: Build Web App
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Install Bun
uses: oven-sh/setup-bun@v1
- name: Setup | Install Dependencies
run: bun install
- name: Build | Vite Build
run: bun run build
working-directory: app
- name: Upload | Web
uses: actions/upload-artifact@v3
with:
name: web
path: app/dist
build_android:
name: Build Android App
needs: [build_web]
strategy:
matrix:
build-type: [debug, release]
runs-on: ubuntu-latest
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Install Java
uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "17"
cache: "gradle"
- name: Setup | Install Bun
uses: oven-sh/setup-bun@v1
- name: Setup | Install Dependencies
run: bun install
- name: Setup | Download Web Distribution
uses: actions/download-artifact@v2
with:
name: web
path: app/dist
- name: Build | Capacitor Sync
run: bunx cap sync android
working-directory: app
- name: Build | Assemble APK
run: ./gradlew assemble${{ matrix.build-type }}
working-directory: app/android
- name: Upload | APK
uses: actions/upload-artifact@v3
with:
name: android-apk-${{ matrix.build-type }}
path: app/android/app/build/outputs/apk/${{ matrix.build-type }}
- name: Build | Bundle
run: ./gradlew bundle${{ matrix.build-type }}
working-directory: app/android
- name: Upload | Bundle
uses: actions/upload-artifact@v3
with:
name: android-bundle-${{ matrix.build-type }}
path: app/android/app/build/outputs/bundle/${{ matrix.build-type }}
# build_ios:
# name: Build iOS App
# needs: [build_web]
# strategy:
# matrix:
# build-type: [debug, release]
# runs-on: macos-latest
# steps:
# - name: Setup | Checkout
# uses: actions/checkout@v3
# - name: Setup | Install Node
# uses: actions/setup-node@v3
# with:
# node-version: 16
# - uses: pnpm/action-setup@v2
# name: Setup | Install PNPM
# id: pnpm-install
# with:
# version: 7
# - name: Setup | Locate PNPM Store
# id: pnpm-cache
# shell: bash
# run: |
# echo "STORE_PATH=$(pnpm store path)" >> $GITHUB_OUTPUT
# - name: Setup | Install Apple certificate and provisioning profile
# env:
# BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
# P12_PASSWORD: ${{ secrets.P12_PASSWORD }}
# BUILD_PROVISION_PROFILE_BASE64: ${{ secrets.BUILD_PROVISION_PROFILE_BASE64 }}
# KEYCHAIN_PASSWORD: ${{ secrets.KEYCHAIN_PASSWORD }}
# run: |
# # create variables
# CERTIFICATE_PATH=$RUNNER_TEMP/build_certificate.p12
# PP_PATH=$RUNNER_TEMP/build_pp.mobileprovision
# KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
# # import certificate and provisioning profile from secrets
# echo -n "$BUILD_CERTIFICATE_BASE64" | base64 --decode --output $CERTIFICATE_PATH
# echo -n "$BUILD_PROVISION_PROFILE_BASE64" | base64 --decode --output $PP_PATH
# # create temporary keychain
# security create-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# security set-keychain-settings -lut 21600 $KEYCHAIN_PATH
# security unlock-keychain -p "$KEYCHAIN_PASSWORD" $KEYCHAIN_PATH
# # import certificate to keychain
# security import $CERTIFICATE_PATH -P "$P12_PASSWORD" -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
# security list-keychain -d user -s $KEYCHAIN_PATH
# # apply provisioning profile
# mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles
# cp $PP_PATH ~/Library/MobileDevice/Provisioning\ Profiles
# - uses: actions/cache@v3
# name: Setup | Cache PNPM Store
# with:
# path: ${{ steps.pnpm-cache.outputs.STORE_PATH }}
# key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
# restore-keys: |
# ${{ runner.os }}-pnpm-store-
# - uses: actions/cache@v3
# name: Setup | Cache CocoaPods
# with:
# path: Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Setup | Install Dependencies
# run: pnpm install
# - name: Setup | Download Web Distribution
# uses: actions/download-artifact@v2
# with:
# name: web
# path: app/dist
# - name: Build | Capacitor Sync
# run: npx cap sync ios
# working-directory: app
# - name: Build | Bundle
# run: xcodebuild -workspace ios/App/App.xcworkspace -scheme App -configuration ${{ matrix.build-type }} -sdk iphoneos -destination generic/platform=iOS archive -archivePath ios/build/App.xcarchive -allowProvisioningUpdates
# working-directory: app
# - name: Upload | Bundle
# uses: actions/upload-artifact@v3
# with:
# name: ios-bundle-${{ matrix.build-type }}
# path: app/ios/build/App.xcarchive
publish_web:
name: Publish to Cloudflare Pages
runs-on: ubuntu-latest
needs: [build_web]
steps:
- name: Setup | Checkout
uses: actions/checkout@v3
- name: Setup | Download Artifact
uses: actions/download-artifact@v2
with:
name: web
path: app/dist
- name: Publish | Cloudflare Pages
uses: cloudflare/pages-action@1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: holly
directory: app/dist
gitHubToken: ${{ secrets.GITHUB_TOKEN }}