This commit is contained in:
Front 2022-03-05 15:57:49 -05:00
commit 709c7643b9
2 changed files with 100 additions and 32 deletions

100
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,100 @@
name: CI
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
env:
NODE_VERSION: 16
jobs:
build:
name: Build web assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm i; cd NUXT; npm i
- name: Build web assets
working-directory: NUXT
run: npm run generate
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: dist
path: dist
android:
name: Build Android platform
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm i
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Copy web assets to native platform
run: npx cap copy android
- name: Update native platform
run: npx cap update android
- name: Build with Gradle
working-directory: android
run: chmod +x gradlew; ./gradlew build
ios:
name: Build iOS platform
runs-on: macos-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download artifacts
uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm i
- name: Copy web assets to native platform
run: npx cap copy ios
- name: Update native platform
run: npx cap update ios
- name: Add empty `GoogleService-Info.plist`
run: echo "$GOOGLE_SERVICE_INFO_PLIST" > ios/App/App/GoogleService-Info.plist
env:
GOOGLE_SERVICE_INFO_PLIST: ${{secrets.GOOGLE_SERVICE_INFO_PLIST}}
- name: Build and archive with xcodebuild
working-directory: ios
run: xcodebuild
-workspace App/App.xcworkspace
-scheme App
-archivePath App/build/App.xarchive
clean build archive
CODE_SIGN_IDENTITY=""
CODE_SIGNING_REQUIRED=NO
CODE_SIGNING_ALLOWED="NO"
CODE_SIGN_ENTITLEMENTS=""

View File

@ -1,32 +0,0 @@
name: Publish Native Android Library
on: workflow_dispatch
jobs:
publish-android:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
with:
ref: main
- name: set up JDK 11
uses: actions/setup-java@v2
with:
java-version: '11'
distribution: 'zulu'
- name: Grant execute permission for gradlew
run: chmod +x ./android/gradlew
- name: Grant execute permission for publishing script
run: chmod +x ./scripts/publish-android.sh
- name: Run publish script
working-directory: ./scripts
env:
ANDROID_OSSRH_USERNAME: ${{ secrets.ANDROID_OSSRH_USERNAME }}
ANDROID_OSSRH_PASSWORD: ${{ secrets.ANDROID_OSSRH_PASSWORD }}
ANDROID_SIGNING_KEY_ID: ${{ secrets.ANDROID_SIGNING_KEY_ID }}
ANDROID_SIGNING_PASSWORD: ${{ secrets.ANDROID_SIGNING_PASSWORD }}
ANDROID_SIGNING_KEY: ${{ secrets.ANDROID_SIGNING_KEY }}
ANDROID_SONATYPE_STAGING_PROFILE_ID: ${{ secrets.ANDROID_SONATYPE_STAGING_PROFILE_ID }}
run: ./publish-android.sh