-
Notifications
You must be signed in to change notification settings - Fork 30
132 lines (109 loc) · 4.47 KB
/
windows.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
name: Build Smanga Windows
on:
workflow_dispatch:
jobs:
build:
name: Build Smanga Windows
runs-on: windows-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Setup node
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
-
name: Build adonis
run: |
git clone -b main https://github.com/lkw199711/smanga-adonis.git smanga-adonis-build
Set-Location -Path smanga-adonis-build/
Copy-Item -Path .env.example -Destination .env -Force
npm install
npx prisma generate --schema=./prisma/sqlite/schema.prisma
npx prisma migrate deploy --schema=./prisma/sqlite/schema.prisma
npm run build
Set-Location -Path build/
Copy-Item -Path ../prisma/ -Destination ./ -Recurse
Copy-Item -Path ../data/ -Destination ./ -Recurse
Copy-Item -Path ../node_modules/ -Destination ./ -Recurse
Copy-Item -Path ../.env.example -Destination .env -Force
npm ci
-
name: Build webui
run: |
git clone -b electron https://github.com/lkw199711/smanga.git smanga-webui-build
Set-Location -Path smanga-webui-build/
npm install
npm run build-docker
-
name: Build exe
run: |
git clone -b main https://github.com/lkw199711/smanga-electron.git windows
Set-Location -Path windows/
Copy-Item -Path ../smanga-adonis-build/build -Destination ./smanga-adonis-build/ -Recurse
Get-ChildItem smanga-adonis-build/ -Force
Copy-Item -Path ../smanga-webui-build/dist/docker -Destination ./smanga-webui-build/ -Recurse
Get-ChildItem smanga-webui-build/ -Force
Copy-Item -Path smanga-adonis-build/prisma/ -Destination ./ -Recurse
Copy-Item -Path smanga-adonis-build/data/ -Destination ./ -Recurse
Copy-Item -Path smanga-adonis-build/node_modules/ -Destination ./ -Recurse
Copy-Item -Path ../smanga-adonis-build/.env.example -Destination .env -Force
Set-Location -Path smanga-adonis-build/
npx prisma generate --schema=./prisma/sqlite/schema.prisma
npx prisma migrate deploy --schema=./prisma/sqlite/schema.prisma
Set-Location -Path ..
Get-ChildItem -Force
npm install
npm run make
Copy-Item -Path .\smanga-adonis-build\node_modules\* -Destination .\out\smanga-electron-win32-x64\resources\app.asar.unpacked\smanga-adonis-build\node_modules -Recurse -Force
Copy-Item -Path .\smanga-adonis-build\data -Destination .\out\smanga-electron-win32-x64\ -Recurse -Force
Copy-Item -Path .\smanga-adonis-build\prisma -Destination .\out\smanga-electron-win32-x64\ -Recurse -Force
Copy-Item -Path ..\smanga-adonis-build\.env.example -Destination .\out\smanga-electron-win32-x64\.env -Force
Get-ChildItem .\out\smanga-electron-win32-x64 -Force
Compress-Archive -Path .\out\smanga-electron-win32-x64 -DestinationPath .\smanga-electron-win32-x64.zip
shell: pwsh
-
name: Upload Windows File
uses: actions/upload-artifact@v3
with:
name: windows
path: windows/smanga-electron-win32-x64.zip
release:
needs: ['build']
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Set Version
id: set-version
run: |
SMANGA_VERSION=$(jq -r '.version' package.json)
echo "version=${SMANGA_VERSION}" >> $GITHUB_OUTPUT
-
name: Download Artifact
uses: actions/download-artifact@v3
-
name: Delete Release
uses: dev-drprasad/delete-tag-and-release@v1.1
with:
tag_name: ${{ steps.set-version.outputs.version }}
delete_release: true
github_token: ${{ secrets.GITHUB_TOKEN }}
-
name: Generate Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.set-version.outputs.version }}
name: ${{ steps.set-version.outputs.version }}
draft: false
prerelease: false
make_latest: true
files: |
windows/smanga-electron-win32-x64.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}