2022-03-05 20:00:26 +00:00
|
|
|
name: CI
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- main
|
|
|
|
pull_request:
|
|
|
|
workflow_dispatch:
|
|
|
|
|
|
|
|
env:
|
2022-03-05 20:02:43 +00:00
|
|
|
NODE_VERSION: 16
|
2022-03-05 20:00:26 +00:00
|
|
|
|
|
|
|
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
|
2022-03-05 20:04:53 +00:00
|
|
|
run: npm i; cd NUXT; npm i
|
2022-03-10 17:51:40 +00:00
|
|
|
- name: Set App Version
|
|
|
|
working-directory: NUXT
|
|
|
|
run: sed -i 's/dev-local/${{ github.sha }}/' nuxt.config.js
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Build web assets
|
2022-03-05 20:21:38 +00:00
|
|
|
working-directory: NUXT
|
|
|
|
run: npm run generate
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-03-05 20:02:00 +00:00
|
|
|
name: dist
|
|
|
|
path: dist
|
2022-03-05 20:00:26 +00:00
|
|
|
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:
|
2022-03-05 20:08:37 +00:00
|
|
|
name: dist
|
|
|
|
path: dist
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Install dependencies
|
2022-03-05 20:11:22 +00:00
|
|
|
run: npm i
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Set up JDK 1.8
|
|
|
|
uses: actions/setup-java@v1
|
|
|
|
with:
|
|
|
|
java-version: 1.8
|
|
|
|
- name: Copy web assets to native platform
|
2022-03-05 20:24:56 +00:00
|
|
|
run: npx cap copy android
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Update native platform
|
2022-03-05 20:21:38 +00:00
|
|
|
run: npx cap update android
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Build with Gradle
|
|
|
|
working-directory: android
|
2022-03-06 18:01:01 +00:00
|
|
|
run: chmod +x gradlew; ./gradlew clean assembleRelease -x test -Pandroid.injected.signing.store.file=/home/runner/work/VueTube/VueTube/android/key.jks -Pandroid.injected.signing.store.password=${{ secrets.ANDROID_STORE_PASSWORD }} -Pandroid.injected.signing.key.alias=${{ secrets.ANDROID_KEY_ALIAS }} -Pandroid.injected.signing.key.password=${{ secrets.ANDROID_KEY_PASSWORD }}
|
2022-03-06 00:08:23 +00:00
|
|
|
- name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
2022-03-06 16:55:16 +00:00
|
|
|
name: android
|
2022-03-06 18:06:17 +00:00
|
|
|
path: android/app/build/outputs/apk/release/app-release.apk
|
2022-03-06 00:08:23 +00:00
|
|
|
|
2022-03-05 20:00:26 +00:00
|
|
|
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:
|
2022-03-05 20:08:37 +00:00
|
|
|
name: dist
|
|
|
|
path: dist
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Set up Node.js ${{ env.NODE_VERSION }}
|
|
|
|
uses: actions/setup-node@v2
|
|
|
|
with:
|
|
|
|
node-version: ${{ env.NODE_VERSION }}
|
|
|
|
- name: Install dependencies
|
2022-03-05 20:11:22 +00:00
|
|
|
run: npm i
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Copy web assets to native platform
|
2022-03-05 20:24:56 +00:00
|
|
|
run: npx cap copy ios
|
2022-03-05 20:00:26 +00:00
|
|
|
- name: Update native platform
|
2022-03-05 20:21:38 +00:00
|
|
|
run: npx cap update ios
|
2022-03-05 20:00:26 +00:00
|
|
|
- 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=""
|
2022-03-05 23:32:19 +00:00
|
|
|
# - name: Upload artifacts
|
|
|
|
# uses: actions/upload-artifact@v2
|
|
|
|
# with:
|
|
|
|
# name: iOS
|
|
|
|
# path: ~/Library/Developer/Xcode/DerivedData
|