193 lines
7.2 KiB
YAML
193 lines
7.2 KiB
YAML
name: Build Electron
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
environment:
|
|
type: environment
|
|
default: "Local"
|
|
targets:
|
|
type: choice
|
|
description: "Targets to build"
|
|
default: "All"
|
|
required: true
|
|
options:
|
|
- "All"
|
|
- "Linux"
|
|
- "macOS"
|
|
- "Windows"
|
|
|
|
push:
|
|
branches:
|
|
- "main"
|
|
- "feature/**"
|
|
- "fix/**"
|
|
paths:
|
|
- "packages/electron/**"
|
|
- "assets/**"
|
|
|
|
env:
|
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
jobs:
|
|
linux:
|
|
if: ${{ !github.event.inputs.targets || 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"
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
~/.nvm
|
|
node_modules
|
|
packages/electron/node_modules
|
|
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
- name: Install Flatpak build tools
|
|
run: |
|
|
sudo apt install flatpak flatpak-builder
|
|
flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
- name: Install dependencies
|
|
run: |
|
|
npm i -g npm@8.2.0
|
|
npm ci
|
|
- name: Build
|
|
run: |
|
|
npm run electron:build
|
|
npm run electron:build:flatpak
|
|
env:
|
|
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
|
- 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 deb
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: padloc-linux-${{ github.sha }}-unsigned.deb
|
|
path: packages/electron/dist/*.deb
|
|
if-no-files-found: error
|
|
- name: Archive snap
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: padloc-linux-${{ github.sha }}-unsigned.snap
|
|
path: packages/electron/dist/*.snap
|
|
if-no-files-found: error
|
|
- name: Archive flatpak
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: padloc-linux-${{ github.sha }}-unsigned.flatpak
|
|
path: packages/electron/dist/*.flatpak
|
|
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_unsigned:
|
|
if: ${{ !github.event.inputs.targets || 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"
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
~/.nvm
|
|
node_modules
|
|
packages/electron/node_modules
|
|
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
- name: Install dependencies
|
|
run: |
|
|
npm i -g npm@8.2.0
|
|
npm ci
|
|
- name: Build
|
|
run: |
|
|
npm run electron:build
|
|
env:
|
|
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
|
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
|
|
macos_signed:
|
|
if: ${{ !github.event.inputs.targets || 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"
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
~/.nvm
|
|
node_modules
|
|
packages/electron/node_modules
|
|
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
- name: Install dependencies
|
|
run: |
|
|
npm i -g npm@8.2.0
|
|
npm ci
|
|
- name: Build
|
|
run: |
|
|
npm run electron:build
|
|
env:
|
|
CSC_LINK: ${{ secrets.PL_MACOS_SIGNING_CERT_BASE64 }}
|
|
CSC_KEY_PASSWORD: ${{ secrets.PL_MACOS_SIGNING_CERT_PASSWORD }}
|
|
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
|
- name: Archive dmg
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: padloc-macos-${{ github.sha }}-signed.dmg
|
|
path: packages/electron/dist/*.dmg
|
|
if-no-files-found: error
|
|
windows:
|
|
if: ${{ !github.event.inputs.targets || 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"
|
|
- uses: actions/cache@v2
|
|
with:
|
|
path: |
|
|
~/.npm
|
|
~/.nvm
|
|
node_modules
|
|
packages/electron/node_modules
|
|
key: ${{ runner.os }}-${{ hashFiles('**/package-lock.json') }}
|
|
- name: Install dependencies
|
|
run: |
|
|
npm i -g npm@8.2.0
|
|
npm ci
|
|
- name: Build
|
|
run: |
|
|
npm run electron:build
|
|
env:
|
|
PL_PWA_URL: ${{ secrets.PL_PWA_URL }}
|
|
- 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
|