-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (105 loc) · 3.9 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
name: Build App for Release
on:
release:
types: [prereleased]
permissions: write-all
jobs:
build:
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: "21"
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install frontend dependencies
run: npm install --legacy-peer-deps
working-directory: ./frontend
- name: Install backend dependencies
run: npm install
working-directory: ./backend
- name: Package and Build the Electron app
run: |
npm run make
working-directory: ./backend
- name: Archive the build (Ubuntu)
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p distributables/deb distributables/rpm
cp ./backend/out/make/deb/**/*.deb distributables/deb/quick-finder-amd64.deb
cp ./backend/out/make/rpm/**/*.rpm distributables/rpm/quick-finder-x86_64.rpm
cd distributables
zip -r quickfinder-linux.zip *
cd ..
- name: Collect built distributables (Windows)
if: matrix.os == 'windows-latest'
run: |
mkdir distributables
cd ./backend/out/make/squirrel.windows/*
cp *.exe ../../../../../distributables/quickfinder-windows-installer.exe
cd ../../../../..
- name: Collect built distributables (macOS)
if: matrix.os == 'macos-latest'
run: |
mkdir distributables
cd ./backend/out/make
cp *.dmg ../../../distributables/QuickFinder.dmg
cd ../../..
- name: Get release
id: get_release
uses: bruceadams/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Display structure of downloaded files
run: ls -R
working-directory: ./
- name: Upload Release Asset (Ubuntu - deb)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: distributables/deb/quick-finder-amd64.deb
asset_name: quick-finder-amd64-installer.deb
asset_content_type: application/vnd.debian.binary-package
- name: Upload Release Asset (Ubuntu - rpm)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./distributables/rpm/quick-finder-x86_64.rpm
asset_name: quick-finder-x86_64-installer.rpm
asset_content_type: application/x-rpm
- name: Upload Release Asset (Windows - exe)
if: matrix.os == 'windows-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./distributables/quickfinder-windows-installer.exe
asset_name: quickfinder-windows-installer.exe
asset_content_type: application/octet-stream
- name: Upload Release Asset (macOS)
if: matrix.os == 'macos-latest'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./distributables/QuickFinder.dmg
asset_name: quickfinder-macos-installer.dmg
asset_content_type: application/octet-stream