-
Notifications
You must be signed in to change notification settings - Fork 4
100 lines (96 loc) · 2.71 KB
/
build-electron.yml
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: build-electron
on:
workflow_call:
env:
USE_HARD_LINKS: false
jobs:
# Build the dna & happ
call-build-webhapps:
uses: ./.github/workflows/build-webhapps.yml
# upload the app package for each target os
build-binaries:
needs: call-build-webhapps
strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
- windows-latest
runs-on: ${{ matrix.os }}
steps:
# Checkout repo
- uses: actions/checkout@v3
# Set NPM shell (windows-only)
- name: Set NPM shell (windows-only)
if: ${{ runner.os == 'Windows' }}
shell: bash
run: |
npm config set script-shell "C:\\Program Files\\git\\bin\\bash.exe"
# Download previously uploaded artifacts
- uses: actions/download-artifact@master
with:
name: all-happ-artifact
path: artifacts
# Display artifacts folder
- name: Display artifacts folder
run: ls
working-directory: artifacts
# Dispatch artifacts
- name: Dispatch artifacts
run: |
cp artifacts/where.happ ./electron/bin
cp artifacts/where_zome_hash.txt ./electron/bin
cp artifacts/ludotheque_zome_hash.txt ./electron/bin
# Install npm dependencies
- name: Install npm dependencies
run: |
npm install
# Download submodules
- name: Download submodules
shell: bash
run: |
npm run install:submodules
# Build webapp
- name: Build webapp
run: |
npm run build:webapp
# Build electron app
- name: Build electron app
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run build -w electron
# Dist Electron
- name: Dist Electron
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm run dist:electron
# List out-builder folder
- name: list out-builder folder
continue-on-error: true
run: ls -R
working-directory: electron/out-builder
# list bin folder
- name: list bin folder
continue-on-error: true
run: ls
working-directory: electron/bin
# Move binary for each platform
- name: Move binary
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cp electron/out-builder/Where* ./artifacts
# List uploaded files
- name: List artifacts folder
run: ls -R
working-directory: artifacts
# "upload" artifacts
- uses: actions/upload-artifact@master
with:
name: all-happ-artifact
path: artifacts