-
Notifications
You must be signed in to change notification settings - Fork 2
193 lines (154 loc) · 5.08 KB
/
build-and-publish.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
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
name: Main
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Install Quasar CLI
run: npm install -g @quasar/cli
- name: Build Quasar Electron App for Linux
run: quasar build -m electron
- name: Create ZIP Archive for Linux
run: |
cd dist/electron/Packaged
zip -r QChatGPT-linux-x64.zip QChatGPT-linux-x64
- name: Upload Linux Build Artifacts
uses: actions/upload-artifact@v2
with:
name: qchatgpt-linux
path: dist/electron/Packaged/QChatGPT-linux-x64.zip
build-windows:
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Install Quasar CLI
run: npm install -g @quasar/cli
- name: Build Quasar Electron App for Windows
run: quasar build -m electron
- name: Create ZIP Archive for Windows
run: |
cd dist/electron/Packaged
Get-ChildItem -Force # Check directory structure
Compress-Archive -Path QChatGPT-win32-x64 -DestinationPath QChatGPT-win32-x64.zip
- name: Upload Windows Build Artifacts
uses: actions/upload-artifact@v2
with:
name: qchatgpt-windows
path: dist/electron/Packaged/QChatGPT-win32-x64.zip
build-macos:
runs-on: macos-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Install Quasar CLI
run: npm install -g @quasar/cli
- name: Build Quasar Electron App for MacOS
run: quasar build -m electron
- name: Create ZIP Archive for MacOS
run: |
cd dist/electron/Packaged
ls -la # Check directory structure
zip -r QChatGPT-darwin-arm64.zip QChatGPT-darwin-arm64
- name: Upload MacOS Build Artifacts
uses: actions/upload-artifact@v2
with:
name: qchatgpt-macos
path: dist/electron/Packaged/QChatGPT-darwin-arm64.zip
build-android:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20.x'
- name: Install dependencies
run: npm install
- name: Install Quasar CLI
run: npm install -g @quasar/cli
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: '17'
- name: Set up Android SDK
uses: android-actions/setup-android@v2
with:
api-level: 35
build-tools: 35.0.0
- name: Build Quasar Capacitor App for Android
run: quasar build -m capacitor -T android --skip-pkg
- name: Create APK for Android
run: |
cd src-capacitor/android
chmod +x ./gradlew
./gradlew assembleDebug
- name: Rename APK and create zip
run: |
cd src-capacitor/android/app/build/outputs/apk/debug
mv app-debug.apk QChatGPT.apk
zip QChatGPT-android.zip QChatGPT.apk
- name: Upload Android Build Artifacts
uses: actions/upload-artifact@v2
with:
name: qchatgpt-android
path: src-capacitor/android/app/build/outputs/apk/debug/QChatGPT-android.zip
publish:
name: Publish Version
needs: [build-linux, build-windows, build-macos, build-android]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download Linux Build Artifacts
uses: actions/download-artifact@v2
with:
name: qchatgpt-linux
- name: Download Windows Build Artifacts
uses: actions/download-artifact@v2
with:
name: qchatgpt-windows
- name: Download MacOS Build Artifacts
uses: actions/download-artifact@v2
with:
name: qchatgpt-macos
- name: Download Android Build Artifacts
uses: actions/download-artifact@v2
with:
name: qchatgpt-android
- name: Get version from package.json
id: get_version
run: echo "VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
- name: Create Version
env:
GH_TOKEN: ${{ secrets.PAT_TOKEN }}
run: |
ls -la # Check directory structure
gh release create "v${{ env.VERSION }}" QChatGPT-linux-x64.zip QChatGPT-win32-x64.zip QChatGPT-darwin-arm64.zip QChatGPT-android.zip -t "Version ${{ env.VERSION }}" -n "Version notes for ${{ env.VERSION }}" --target main