forked from VueTubeApp/VueTube
-
-
Notifications
You must be signed in to change notification settings - Fork 2
139 lines (130 loc) · 4.7 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: CI
on:
push:
branches:
- main
- dev
env:
NODE_VERSION: 16
GOOGLE_SERVICE_INFO_PLIST: ${{secrets.GOOGLE_SERVICE_INFO_PLIST}}
jobs:
build:
name: Build web assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm i; cd NUXT; npm i
- name: Set App Version
working-directory: NUXT
run: sed -i 's/dev-local/${{ github.sha }}/' nuxt.config.js
- name: Build web assets
working-directory: NUXT
run: npm run generate
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dist
path: dist
android:
name: Build Android platform
runs-on: ubuntu-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install dependencies
run: npm i
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'oracle'
- 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 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 }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: app-release.apk
path: android/app/build/outputs/apk/release/app-release.apk
- name: Download APK using GitHub API
run: |
TOKEN="${{ secrets.TOKEN_SECRET }}"
OWNER="pixkk"
REPO="VueTube"
WORKFLOW_RUN_ID="${{ github.run_id }}"
ARTIFACTS=$(curl -H "Authorization: token $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$OWNER/$REPO/actions/runs/$WORKFLOW_RUN_ID/artifacts)
ARTIFACT_ID=$(echo $ARTIFACTS | jq '.artifacts[] | select(.name == "app-release") | .id')
curl -L -H "Authorization: token $TOKEN" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/$OWNER/$REPO/actions/artifacts/$ARTIFACT_ID/zip \
--output artifact.zip
unzip artifact.zip -d extracted
mv extracted/app-release.apk ./app-release.apk
ios:
name: Build iOS platform
runs-on: macos-latest
needs: [build]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: dist
path: dist
- name: Set up Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v4
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: Set up XCode
uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: latest-stable
- name: Add `GoogleService-Info.plist`
run: echo "${{ env.GOOGLE_SERVICE_INFO_PLIST }}" > ios/App/App/GoogleService-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=""
- name: Make IPA
run: mkdir Payload && mv ~/Library/Developer/Xcode/DerivedData/App-*/Build/Products/Debug-iphoneos/App.app/ Payload && zip -r Payload.zip Payload && mv Payload.zip VueTube.ipa
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: VueTube.ipa
path: VueTube.ipa