-
Notifications
You must be signed in to change notification settings - Fork 0
69 lines (54 loc) · 2.31 KB
/
05-electron-build.yml
File metadata and controls
69 lines (54 loc) · 2.31 KB
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
# SPDX-License-Identifier: Unlicense OR 0BSD
# - https://docs.github.com/pt/actions
# - https://github.com/marketplace/actions/electron-builder-action
# - https://github.com/samuelmeuli/action-electron-builder/blob/master/action.yml
name: electron-build
on:
push:
branches:
- main
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
jobs:
release:
strategy:
matrix:
os: [macos-latest, ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
# package.json -> szwacz-electron-boilerplate/package.json:
working-directory: ./szwacz-electron-boilerplat/
# Not possible, see https://github.community/t/how-do-i-specify-job-dependency-running-in-another-workflow/16482/5
# needs: nodejs-build # .github/workflows/02-nodejs-build.yml
steps:
- name: Check out Git repository
uses: actions/checkout@v1
- name: Install Node.js, NPM and Yarn
# uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: 14
# package.json -> szwacz-electron-boilerplate/package.json:
cache-dependency-path: 'szwacz-electron-boilerplate/package-lock.json'
# @see https://github.com/marketplace/actions/snapcraft-action
# Reason: electron will try to deploy snap (but requires snapcraft installed)
- name: Install Snapcraft
uses: samuelmeuli/action-snapcraft@v1
- name: Build/release Electron app
uses: samuelmeuli/action-electron-builder@v1
with:
# GitHub token, automatically provided to the action
# (No need to define this secret in the repo settings)
github_token: ${{ secrets.github_token }}
# If the commit is tagged with a version (e.g. "v1.0.0"),
# release the app after building
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
# Directory where NPM/Yarn commands should be run
# default: "." (no subdirectory)
package_root: szwacz-electron-boilerplate/
# Name of the optional NPM build script which is executed before electron-builder (default: "build")
# build_script_name: release
# build_script_name: pack
build_script_name: pack2