-
Notifications
You must be signed in to change notification settings - Fork 0
119 lines (96 loc) · 3.23 KB
/
build-and-release-desktop.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
name: Build & release desktop app
on:
push:
branches:
- master
- develop
pull_request:
release:
types: [created]
env:
YARN_CACHE_FOLDER: ~/.yarn
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
build_on_linux:
name: "Build & release desktop app for ${{ matrix.os }}"
strategy:
matrix:
node-version: [16.x]
runtime: [ linux-x64, win-x64, osx-x64 ]
include:
- runtime: linux-x64
os: ubuntu-latest
- runtime: osx-x64
os: macos-latest
- runtime: win-x64
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- name: "Checkout"
uses: "actions/checkout@v2.0.0"
- name: "Setup NodeJS"
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Caching
uses: actions/cache@v2
with:
path: |
${{ env.YARN_CACHE_FOLDER }}
~/.cache/electron
~/.cache/electron-builder
key: ${{ runner.OS }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.OS }}-yarn-
- name: "Revert to Yarn 1"
run: yarn set version classic
- name: "local-app: Install dependencies"
run: yarn install --immutable
working-directory: "desktop/local-app"
- name: "local-app: Build"
run: yarn build
working-directory: "desktop/local-app"
- name: "Set desktop app version"
run: node helpers/set-version.js
working-directory: "desktop/electron"
- name: "Install dependencies"
run: yarn install --immutable
working-directory: "desktop/electron"
- name: "Build typescript"
run: yarn build
working-directory: "desktop/electron"
- name: "Install electron tools"
run: yarn electron-builder install-app-deps
working-directory: "desktop/electron"
- name: "Build app for testing"
run: yarn electron-builder --publish never
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: "desktop/electron"
if: ${{ github.event_name != 'release' }}
- name: "Build & release app"
run: yarn electron-builder --publish always
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: "desktop/electron"
if: ${{ github.event_name == 'release' }}
- name: Upload Linux .AppImage artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'ubuntu')
with:
name: workadventure-desktop-linux-x64.AppImage
path: desktop/electron/build/workadventure-desktop-*-x86_64.AppImage
- name: Upload Windows .exe artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'windows')
with:
name: workadventure-desktop-win-x64.exe
path: desktop/electron/build/workadventure-desktop-*.exe
- name: Upload MacOS .dmg artifact
uses: actions/upload-artifact@v2
if: startsWith(matrix.os, 'macos')
with:
name: workadventure-mac.dmg
path: desktop/electron/build/workadventure-desktop-*.dmg