Build Smanga Windows #4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
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 | |
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 }} |