forked from chiragsakhuja/lc3tools
-
Notifications
You must be signed in to change notification settings - Fork 6
135 lines (135 loc) · 4.45 KB
/
release.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
126
127
128
129
130
131
132
133
134
135
name: Release app
on:
workflow_dispatch:
push:
tags:
- 'v*'
jobs:
build-linux:
strategy:
matrix:
os:
[
{ name: 'linux', image: 'ubuntu-latest' }
]
runs-on: ${{ matrix.os.image }}
defaults:
run:
working-directory: ./src/gui
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Use Cargo
uses: dtolnay/rust-toolchain@stable
- name: Install Flatpak dependencies
# Needed to build the Flatpak.
#
# Also, during make, electron-forge will install Electron app dependencies, namely:
# - org.freedesktop.Platform
# - org.freedesktop.SDK
# - org.electronjs.Electron2.BaseApp, and
# - https://github.com/refi64/zypak (yes, it pulls a git repo)
#
# I *would* install them here, but the bundler seems to require a specific version
# and doing it here would be *annoying*.
#
# If you wish to change the version of any of those dependencies, do it in forge.config.ts.
run: |
sudo apt-get update
sudo apt-get install -y flatpak flatpak-builder elfutils
flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
git config --global protocol.file.allow always
- name: Install dependencies
run: npm install
- name: Build backend
run: npm run build-backend
- name: Publish app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: DEBUG=@malept/flatpak-bundler* npm run publish
build-win:
strategy:
matrix:
os:
[
{ name: 'windows', image: 'windows-latest' }
]
runs-on: ${{ matrix.os.image }}
defaults:
run:
working-directory: ./src/gui
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Use Cargo
uses: dtolnay/rust-toolchain@stable
- name: Install dependencies
run: npm install
- name: Build backend
run: npm run build-backend
- name: Publish app
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run publish
build-mac:
strategy:
matrix:
os:
[
{ name: 'macos', image: 'macos-latest' },
{ name: 'macos-x86', image: 'macos-13' },
]
runs-on: ${{ matrix.os.image }}
defaults:
run:
working-directory: ./src/gui
steps:
- name: Github checkout
uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 20
- name: Use Cargo
uses: dtolnay/rust-toolchain@stable
# https://github.com/electron/forge/issues/3371#issuecomment-2281115374
# setuptools is required to build appdmg (a dependency for creating DMGs).
#
# To install it, we set up a Python environment for both Mac builds and
# install via pip.
- name: Install Python 3.12 (macOS)
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install python-setuptools (macOS)
run: python3 -m pip install setuptools
- name: Install dependencies
run: npm install
- name: Build backend
run: npm run build-backend
- name: Publish app (macOS)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Apps built on M1 are displayed as "damaged" if they're missing a code signature
# (even if they're perfectly fine).
#
# We aren't going to code-sign, but we can "ad-hoc code sign" (give a blank signature)
# to revert it back to the error that's usually seen on Intel Macs
# ("LC3Tools.app" cannot be opened because Apple cannot check it for malicious software.)
#
# This unfortunately complicates the command a bit since we have to apply codesign
# in the middle of the publishing process.
#
# https://github.com/electron-userland/electron-builder/issues/5850#issuecomment-1821648559
run: |
npm run package
codesign --force --deep -s - ./out/*/*.app
npm run publish -- --skip-package