-
-
Notifications
You must be signed in to change notification settings - Fork 24
125 lines (109 loc) · 3.36 KB
/
build.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
120
121
122
123
124
125
name: build and release
on:
push:
tags:
- v[0-9]+.[0-9]+.[0-9]+*
workflow_dispatch: # Allows manual triggering
jobs:
macos:
strategy:
matrix:
os-version: ['12', '14']
include:
- os-version: '12'
arch: x86_64
- os-version: '14'
arch: aarch64
runs-on: macos-${{ matrix.os-version }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
DeskThingServer
- name: Install Node.js, NPM
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd DeskThingServer
npm ci
- name: Build/release Electron app
uses: paneron/[email protected]
with:
github_token: ${{ secrets.github_token }}
package_manager: npm
package_root: ${{ github.workspace }}/DeskThingServer
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Upload binaries to artifacts
uses: actions/upload-artifact@v4
with:
name: deskthing-macos-${{ matrix.arch }}
path: ${{ github.workspace }}/DeskThingServer/dist/deskthing-*.dmg
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
name: Build ${{ matrix.os }}
steps:
- name: Check out Git repository
uses: actions/checkout@v4
with:
sparse-checkout: |
.github
DeskThingServer
- name: Install Node.js, NPM
uses: actions/setup-node@v4
with:
node-version: 20
- name: Install dependencies
run: |
cd DeskThingServer
npm ci
- name: Build/release Electron app
uses: paneron/[email protected]
with:
github_token: ${{ secrets.github_token }}
package_manager: npm
package_root: ${{ github.workspace }}/DeskThingServer
release: ${{ startsWith(github.ref, 'refs/tags/v') }}
- name: Upload windows binaries to artifacts
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: deskthing-${{matrix.os}}
path: ${{ github.workspace }}/DeskThingServer/dist/deskthing*.exe
- name: Upload linux binaries to artifacts
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: deskthing-${{matrix.os}}
path: ${{ github.workspace }}/DeskThingServer/dist/deskthing*
publish:
needs: [release, macos]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Get Current Release
id: get_current_release
uses: joutvhu/get-release@v1
with:
latest: true
pattern: '^v.*'
prerelease: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
- uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_current_release.outputs.tag_name }}
files: |
deskthing-macos-aarch64/*
deskthing-macos-x86_64/*
deskthing-ubuntu-latest/*
deskthing-windows-latest/*