Files
echoes-of-the-ash/.gitlab-ci.yml

82 lines
1.7 KiB
YAML

stages:
- build-web
- build-desktop
variables:
npm_config_cache: "$CI_PROJECT_DIR/.npm"
ELECTRON_CACHE: "$CI_PROJECT_DIR/.cache/electron"
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- pwa/node_modules/
- pwa/.npm/
- pwa/.cache/
# Build the web application first
build:web:
stage: build-web
image: node:20-alpine
script:
- cd pwa
- npm install
- npm run build
artifacts:
paths:
- pwa/dist/
expire_in: 1 hour
rules:
- if: '$CI_COMMIT_TAG'
tags:
- docker
# Build Linux AppImage and .deb
build:linux:
stage: build-desktop
image: electronuserland/builder:wine
dependencies:
- build:web
script:
- cd pwa
# Clean install to fix optional dependencies issue
- rm -rf node_modules package-lock.json
- npm install
- npm run electron:build:linux
# Compress artifacts to reduce size
- cd dist-electron
- apt-get update && apt-get install -y zip
- zip linux-builds.zip *.AppImage *.deb
artifacts:
paths:
- pwa/dist-electron/linux-builds.zip
expire_in: 1 week
rules:
- if: '$CI_COMMIT_TAG'
tags:
- docker
# Build Windows executable
build:windows:
stage: build-desktop
image: electronuserland/builder:wine
dependencies:
- build:web
script:
- cd pwa
# Clean install to fix optional dependencies issue
- rm -rf node_modules package-lock.json
- npm install
- npm run electron:build:win
# Compress artifacts to reduce size
- cd dist-electron
- apt-get update && apt-get install -y zip
- zip windows-builds.zip *.exe || true
artifacts:
paths:
- pwa/dist-electron/windows-builds.zip
expire_in: 1 week
rules:
- if: '$CI_COMMIT_TAG'
tags:
- docker