Skip to content

Build source code and send to Capgo #1568

Build source code and send to Capgo

Build source code and send to Capgo #1568

Workflow file for this run

name: Build source code and send to Capgo
on:
push:
tags:
- '*'
jobs:
deploy:
runs-on: ubuntu-latest
name: "Build code and release"
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
version: 8
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Lint
id: lint_code
run: pnpm lint && pnpm lint-backend
- name: Build
id: build_code
run: pnpm mobile
env:
VITE_APP_URL: ${{ secrets.VITE_APP_URL }}
VITE_VAPID_KEY: ${{ secrets.VITE_VAPID_KEY }}
VITE_FIREBASE_CONFIG: ${{ secrets.VITE_FIREBASE_CONFIG }}
- name: Install Supabase CLI
uses: supabase/setup-cli@v1
with:
version: 1.99.5
- name: 🍜 Prepare Supabase
run: node scripts/prepare_supabase.mjs
# - name: Apply Supabase Migrations TODO: make this work
# run: supabase db push -p ${{ secrets.SUPABASE_DB_PASS }}
- name: Update functions Alpha
if: ${{ contains(github.ref, '-alpha.') }}
id: update_functions_preprod
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_TOKEN }}
BRANCH: development
run: supabase functions deploy
- name: Update functions
if: ${{ !contains(github.ref, '-alpha.') }}
id: update_functions_prod
env:
SUPABASE_ACCESS_TOKEN: ${{ secrets.SUPABASE_TOKEN }}
run: supabase functions deploy
- name: Create Release Alpha
if: ${{ contains(github.ref, '-alpha.') }}
id: create_release_prepro
run: pnpm dlx @capgo/cli@latest upload -a ${{ secrets.CAPGO_TOKEN }} -c alpha
- name: Create Release Production
if: ${{ !contains(github.ref, '-alpha.') }}
id: create_release_prod
run: pnpm dlx @capgo/cli@latest upload -a ${{ secrets.CAPGO_TOKEN }} -c production
build_android:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2
with:
version: 8
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
cache: 'pnpm'
- name: Install dependencies
id: install_code
run: pnpm install --frozen-lockfile
- name: Build
id: build_code
run: pnpm mobile
- name: Sync
id: sync_code
run: pnpm --package=@capacitor/cli dlx cap sync
- name: Setup java
uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '17'
- name: Decode Keystore File
uses: timheuer/base64-to-file@v1
id: android_keystore
with:
fileName: "android_keystore.keystore"
encodedString: ${{ secrets.ANDROID_KEYSTORE_FILE }}
- name: Decode Google Play Confi File
uses: timheuer/base64-to-file@v1
id: service_account_json_file
with:
fileName: "serviceAccount.json"
encodedString: ${{ secrets.PLAY_CONFIG_JSON }}
- uses: actions/cache@v3
with:
path: |
~/android/.gradle/*
~/android/gradle/wrapper/*
key: ${{ runner.os }}-gradle-${{ hashFiles('android/.gradle*', 'android/gradle/wrapper/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- uses: maierj/[email protected]
env:
KEYSTORE_PATH: ${{ steps.android_keystore.outputs.filePath }}
ANDROID_JSON_KEY_FILE: ${{ steps.service_account_json_file.outputs.filePath }}
DEVELOPER_PACKAGE_NAME: ${{ secrets.DEVELOPER_PACKAGE_NAME }}
KEYSTORE_KEY_ALIAS: ${{ secrets.KEYSTORE_KEY_ALIAS }}
KEYSTORE_KEY_PASSWORD: ${{ secrets.KEYSTORE_KEY_PASSWORD }}
KEYSTORE_STORE_PASSWORD: ${{ secrets.KEYSTORE_STORE_PASSWORD }}
with:
lane: android beta
- name: Upload release bundle
uses: actions/upload-artifact@v3
with:
name: android-release
path: ./android/app/build/outputs/bundle/release/app-release.aab
retention-days: 10
# build_ios:
# runs-on: macOS-latest
# steps:
# - uses: actions/checkout@v3
# - uses: pnpm/action-setup@v2
# with:
# version: 8
# - name: Use Node.js
# uses: actions/setup-node@v3
# with:
# node-version: 18
# cache: 'pnpm'
# - name: Install dependencies
# id: install_code
# run: pnpm install --frozen-lockfile
# - uses: actions/cache@v3
# with:
# path: ios/App/Pods
# key: ${{ runner.os }}-pods-${{ hashFiles('**/Podfile.lock') }}
# restore-keys: |
# ${{ runner.os }}-pods-
# - name: Build
# id: build_code
# run: pnpm mobile
# - name: Sync
# id: sync_code
# run: pnpm --package=@capacitor/cli dlx cap sync
# - uses: ruby/setup-ruby@v1
# with:
# ruby-version: '2.7.2'
# - uses: maierj/[email protected]
# env:
# DEVELOPER_APP_IDENTIFIER: ${{ secrets.DEVELOPER_APP_IDENTIFIER }}
# DEVELOPER_APP_ID: ${{ secrets.DEVELOPER_APP_ID }}
# PROVISIONING_PROFILE_SPECIFIER: match AppStore ${{ secrets.DEVELOPER_APP_IDENTIFIER }}
# TEMP_KEYCHAIN_USER: ${{ secrets.TEMP_KEYCHAIN_USER }}
# TEMP_KEYCHAIN_PASSWORD: ${{ secrets.TEMP_KEYCHAIN_PASSWORD }}
# APPLE_ISSUER_ID: ${{ secrets.APPSTORE_ISSUER_ID }}
# APPLE_KEY_ID: ${{ secrets.APPSTORE_KEY_ID }}
# APPLE_KEY_CONTENT: ${{ secrets.APPSTORE_PRIVATE_KEY }}
# CERTIFICATE_STORE_URL: https://github.com/${{ secrets.CERTIFICATE_STORE_REPO }}.git
# GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
# GIT_TOKEN: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
# FASTLANE_APPLE_ID: ${{ secrets.FASTLANE_APPLE_ID }}
# MATCH_USERNAME: ${{ secrets.FASTLANE_APPLE_ID }}
# MATCH_PASSWORD: ${{ secrets.MATCH_PASSWORD }}
# APP_STORE_CONNECT_TEAM_ID: ${{ secrets.APP_STORE_CONNECT_TEAM_ID }}
# DEVELOPER_PORTAL_TEAM_ID: ${{ secrets.DEVELOPER_PORTAL_TEAM_ID }}
# with:
# lane: closed_beta
# # subdirectory: 'ios'
# - name: Upload release bundle
# uses: actions/upload-artifact@v3
# with:
# name: ios-release
# path: ./App.ipa
# retention-days: 10