generated from xwiki-contrib/github-template-repository
-
Notifications
You must be signed in to change notification settings - Fork 7
109 lines (105 loc) · 3.05 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
101
102
103
104
105
106
107
108
109
name: Electron Build for all platforms
on:
push:
branches:
- '**'
tags:
- '**'
## Don't build concurrently for a given branch.
## Only the most recent version is built.
concurrency:
group: ${{ github.ref }}
permissions: write-all
jobs:
electron-prepare:
runs-on: ubuntu-latest
# Cleanup the release note artifacts before building new ones. Otherwise, the action-gh-release step fails because
# an artifact already exists.
steps:
- uses: liudonghua123/delete-release-action@v1
with:
release_name: ${{ github.ref }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
electron-linux:
runs-on: ubuntu-latest
needs: electron-prepare
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/[email protected]
with:
cache: 'pnpm'
- id: restore-cache-electron-linux
uses: actions/cache@v4
with:
path: |
.nx/
key: ${{ github.ref }}-restore-cache-electron-linux
- run: pnpm install
- run: pnpm run build
- run: pnpm run --filter @xwiki/cristal-electron build:linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
files: |
electron/dist/cristal-*.*
electron/dist/latest.yml
electron/dist/latest-linux.yml
tag_name: ${{ github.ref }}
draft: true
electron-mac:
runs-on: macos-latest
needs: electron-prepare
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/[email protected]
with:
cache: 'pnpm'
- id: restore-cache-electron-mac
uses: actions/cache@v4
with:
path: |
.nx/
key: ${{ github.ref }}-restore-cache-electron-mac
- run: pnpm install
- run: pnpm run build
- run: pnpm run --filter @xwiki/cristal-electron build:mac
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
files: electron/dist/cristal-*.dmg
tag_name: ${{ github.ref }}
draft: true
electron-win:
runs-on: windows-latest
needs: electron-prepare
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/[email protected]
with:
cache: 'pnpm'
- id: restore-cache-electron-win
uses: actions/cache@v4
with:
path: |
.nx/
!.nx/workspace-data/d
key: ${{ github.ref }}-restore-cache-electron-win
env:
NX_DISABLE_DB: true
NX_DB_CACHE: false
- run: pnpm install
- run: pnpm run build
- run: pnpm run --filter @xwiki/cristal-electron build:win
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: softprops/action-gh-release@v2
with:
files: electron/dist/cristal-*.*
tag_name: ${{ github.ref }}
draft: true