CI: Build Electron
This has the setup for building for Linux, macOS, and Windows, but still likely needs some more setup. Related to #330
This commit is contained in:
parent
5ef333f149
commit
6c30eae65f
|
@ -83,4 +83,4 @@ jobs:
|
|||
# TODO: Still broken
|
||||
# - name: Build (iOS)
|
||||
# run: |
|
||||
# PL_SERVER_URL='${{ secrets.PL_SERVER_URL }}' npm run cordova:build:ios
|
||||
# PL_SERVER_URL='${{ secrets.PL_SERVER_URL }}' npm run cordova:build:iosz
|
||||
|
|
|
@ -0,0 +1,106 @@
|
|||
name: Build Electron
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
environment:
|
||||
type: environment
|
||||
targets:
|
||||
type: choice
|
||||
description: "Targets to build"
|
||||
default: "All"
|
||||
required: true
|
||||
options:
|
||||
- "All"
|
||||
- "Linux"
|
||||
- "macOS"
|
||||
- "Windows"
|
||||
|
||||
push:
|
||||
branches:
|
||||
- "v4"
|
||||
- "master"
|
||||
- "feature/**"
|
||||
- "fix/**"
|
||||
paths:
|
||||
- "packages/app/**"
|
||||
- "packages/core/**"
|
||||
- "packages/electron/**"
|
||||
- "packages/pwa/**"
|
||||
- "packages/locale/**"
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
if: ${{ github.event.inputs.targets == 'All' || github.event.inputs.targets == 'Linux' }}
|
||||
runs-on: ubuntu-latest
|
||||
environment: ${{ github.event.inputs.environment || 'Local' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm i -g npm@8.2.0
|
||||
npm ci
|
||||
- name: Build
|
||||
run: |
|
||||
PL_PWA_URL='${{ secrets.PL_PWA_URL }}' npm run electron:build
|
||||
- name: Archive AppImage
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: padloc-linux-${{ github.sha }}-unsigned.AppImage
|
||||
path: packages/electron/dist/*.AppImage
|
||||
if-no-files-found: error
|
||||
- name: Archive Unpacked
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: padloc-linux-${{ github.sha }}-unpacked
|
||||
path: packages/electron/dist/linux-unpacked
|
||||
if-no-files-found: error
|
||||
macos:
|
||||
if: ${{ github.event.inputs.targets == 'All' || github.event.inputs.targets == 'macOS' }}
|
||||
runs-on: macos-11
|
||||
environment: ${{ github.event.inputs.environment || 'Local' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm i -g npm@8.2.0
|
||||
npm ci
|
||||
- name: Build
|
||||
run: |
|
||||
PL_PWA_URL='${{ secrets.PL_PWA_URL }}' npm run electron:build
|
||||
env:
|
||||
CSC_IDENTITY_AUTO_DISCOVERY: false
|
||||
- name: Archive dmg
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: padloc-macos-${{ github.sha }}-unsigned.dmg
|
||||
path: packages/electron/dist/*.dmg
|
||||
if-no-files-found: error
|
||||
windows:
|
||||
if: ${{ github.event.inputs.targets == 'All' || github.event.inputs.targets == 'Windows' }}
|
||||
runs-on: windows-2019
|
||||
environment: ${{ github.event.inputs.environment || 'Local' }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-node@v2
|
||||
with:
|
||||
node-version-file: ".nvmrc"
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
npm i -g npm@8.2.0
|
||||
npm ci
|
||||
- name: Build
|
||||
run: |
|
||||
PL_PWA_URL='${{ secrets.PL_PWA_URL }}' npm run electron:build
|
||||
- name: Archive exe
|
||||
uses: actions/upload-artifact@v2
|
||||
with:
|
||||
name: padloc-windows-${{ github.sha }}-unsigned.exe
|
||||
path: packages/electron/dist/*.exe
|
||||
if-no-files-found: error
|
|
@ -3,4 +3,7 @@ packages/extension/dist/**/*
|
|||
packages/cordova/plugins/**/*
|
||||
packages/cordova/platforms/**/*
|
||||
packages/cordova/www/**/*
|
||||
packages/electron/app/**/*
|
||||
packages/electron/build/**/*
|
||||
packages/electron/dist/**/*
|
||||
package-lock.json
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
"pwa:start": "lerna run start --scope @padloc/pwa",
|
||||
"server:start": "lerna run start --scope @padloc/server --stream",
|
||||
"server:start-dry": "lerna run start-dry --stream --scope @padloc/server",
|
||||
"electron:build": "cd packages/electron && npm run build && cd ../..",
|
||||
"electron:build": "lerna run build --scope @padloc/electron",
|
||||
"web-extension:build": "lerna run build --scope @padloc/extension",
|
||||
"cordova:build": "lerna run build:android && lerna run build:ios",
|
||||
"cordova:build:android": "lerna run build:android",
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
"npm": "8.2.0"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "rm -rf app && webpack && node ./prepare-build.js && electron-builder --config build/build.json",
|
||||
"build": "rm -rf app build dist && webpack && node ./prepare-build.js && electron-builder --config build/build.json",
|
||||
"start": "webpack && electron app/main.js"
|
||||
},
|
||||
"author": "MaKleSoft UG",
|
||||
|
|
Loading…
Reference in New Issue