-
-
Notifications
You must be signed in to change notification settings - Fork 76
89 lines (77 loc) · 2.57 KB
/
flatpak.yml
File metadata and controls
89 lines (77 loc) · 2.57 KB
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
name: Flatpak
on:
workflow_dispatch:
push:
branches-ignore:
- main
- master
paths:
- "electron/**"
- "flatpak/**"
- "package.json"
- "package-lock.json"
- "vite.config.ts"
- ".github/workflows/flatpak.yml"
pull_request:
paths:
- "src/**"
- "public/**"
- "electron/**"
- "flatpak/**"
- "package.json"
- "package-lock.json"
- "vite.config.ts"
- ".github/workflows/flatpak.yml"
jobs:
flatpak:
name: Build Flatpak
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
# Install flatpak-node-generator from a pinned commit for reproducibility.
# The tool is a Python package (not a single script); pinning to an exact
# commit SHA prevents supply-chain surprises from upstream changes.
# To update: bump the commit SHA below to the desired upstream commit.
- name: Install flatpak-node-generator
run: |
pip3 install --quiet \
"git+https://github.com/flatpak/flatpak-builder-tools.git@5de461271d05f43f267b954ac6010b410378ae47#subdirectory=node"
- name: Generate offline npm sources
run: |
flatpak-node-generator npm package-lock.json \
-o flatpak/generated-sources.json
- name: Install Flatpak and flatpak-builder
run: |
sudo apt-get update -y
sudo apt-get install -y flatpak flatpak-builder
- name: Add Flathub remote
run: |
flatpak remote-add --user --if-not-exists flathub \
https://dl.flathub.org/repo/flathub.flatpakrepo
- name: Install Flatpak runtimes and SDK extensions
run: |
flatpak install --user -y flathub \
org.freedesktop.Platform//24.08 \
org.freedesktop.Sdk//24.08 \
org.electronjs.Electron2.BaseApp//24.08 \
org.freedesktop.Sdk.Extension.node20//24.08
- name: Build Flatpak bundle
run: |
flatpak-builder --user --install-deps-from=flathub \
--force-clean --repo=flatpak-repo \
flatpak-build flatpak/com.rein.app.yml
- name: Create .flatpak bundle file
run: |
flatpak build-bundle flatpak-repo rein.flatpak com.rein.app
- name: Upload Flatpak artifact
uses: actions/upload-artifact@v4
with:
name: rein-flatpak
path: rein.flatpak
retention-days: 7