-
-
Notifications
You must be signed in to change notification settings - Fork 6
94 lines (81 loc) · 2.35 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
name: Build and Release
on:
push:
tags:
- 'v*.*.*' # Triggers on version tags
- 'v*.*.*-*' # Trigger for pre-release tags
workflow_dispatch: # Allows manual triggering
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest] # Matrix for multiple OS builds
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
- name: Install dependencies
run: |
cd ./DeskThingServer
npm ci
- name: Run linter
run: |
cd ./DeskThingServer
npm run lint
- name: Run type check
run: |
cd ./DeskThingServer
npm run typecheck
- name: Build the project
run: |
cd ./DeskThingServer
npm run build
- name: Build application for ${{ matrix.os }}
run: |
cd ./DeskThingServer
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
npm run build:win
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
npm run build:mac
else
npm run build:linux
fi
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: DeskThing-${{ matrix.os }} # Artifact name based on OS
path: |
./DeskThingServer/dist/*
!./DeskThingServer/dist/**/*.map # Uploads build outputs
release:
needs: build # Runs after build job
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
name: DeskThing-ubuntu-latest
path: ./dist/ubuntu
- uses: actions/download-artifact@v3
with:
name: DeskThing-macos-latest
path: ./dist/macos
- uses: actions/download-artifact@v3
with:
name: DeskThing-windows-latest
path: ./dist/windows
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: |
./dist/ubuntu/*
./dist/macos/*
./dist/windows/*
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}