Skip to content

Commit 37f96e6

Browse files
authored
Update flatpak.yml
1 parent 8471689 commit 37f96e6

File tree

1 file changed

+20
-38
lines changed

1 file changed

+20
-38
lines changed

.github/workflows/flatpak.yml

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -10,53 +10,40 @@ on:
1010
jobs:
1111
build-flatpak:
1212
runs-on: ubuntu-latest
13+
container:
14+
image: bilelmoussaoui/flatpak-github-actions:gnome-44
15+
options: --privileged
1316
steps:
14-
# 1) Check out your code
1517
- uses: actions/checkout@v3
16-
17-
# 2) Install Node.js (for npm)
1818
- uses: actions/setup-node@v3
1919
with:
2020
node-version: 18.15.0
21-
22-
# 3) Install Flatpak + flatpak-builder on the Ubuntu runner
23-
- name: Install Flatpak tools
24-
run: |
25-
sudo apt-get update
26-
sudo apt-get install -y flatpak flatpak-builder
27-
28-
# 4) Install npm dependencies
21+
2922
- name: Install dependencies
3023
run: |
3124
npm install
3225
npm install --save-dev electron electron-builder
33-
34-
# 5) Build the Electron app
26+
3527
- name: Build electron app
3628
run: |
3729
npm run build
3830
npm run package -- --linux dir
39-
40-
# 6) Add Flathub remote and install required runtimes
31+
4132
- name: Set up Flatpak environment
4233
run: |
4334
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
44-
flatpak install -y --noninteractive flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08 org.electronjs.Electron2.BaseApp//22.08
45-
46-
# 7) Prepare the Flatpak directory structure
35+
flatpak install -y flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08 org.electronjs.Electron2.BaseApp//22.08
36+
4737
- name: Create Flatpak build structure
4838
run: |
4939
mkdir -p flatpak/opt/fukuro
50-
# Copy the Electron build output
5140
cp -r dist/linux-unpacked/* flatpak/opt/fukuro/ || cp -r dist/linux-x64-unpacked/* flatpak/opt/fukuro/
52-
# Copy your icon from wherever it's located (adjust this path as needed!)
53-
# Example: cp public/icon.png flatpak/icon.png
41+
# Copy icon directly to the flatpak directory
5442
cp public/icon.png flatpak/icon.png
55-
56-
# 8) Create deployment (desktop, metainfo, launcher) files inside flatpak/
43+
5744
- name: Create Flatpak deployment files
5845
run: |
59-
cat > flatpak/com.gavrielsha.Fukuro.desktop << 'EOL'
46+
cat > flatpak/com.gavrielsha.Fukuro.desktop << EOL
6047
[Desktop Entry]
6148
Name=Fukuro
6249
Comment=Simple and efficient RSS reader
@@ -69,7 +56,7 @@ jobs:
6956
StartupWMClass=fukuro
7057
EOL
7158
72-
cat > flatpak/com.gavrielsha.Fukuro.metainfo.xml << 'EOL'
59+
cat > flatpak/com.gavrielsha.Fukuro.metainfo.xml << EOL
7360
<?xml version="1.0" encoding="UTF-8"?>
7461
<component type="desktop-application">
7562
<id>com.gavrielsha.Fukuro</id>
@@ -108,16 +95,15 @@ jobs:
10895
</component>
10996
EOL
11097
111-
cat > flatpak/fukuro.sh << 'EOL'
98+
cat > flatpak/fukuro.sh << EOL
11299
#!/bin/sh
113-
exec /app/opt/fukuro/fukuro "$@"
100+
exec /app/opt/fukuro/fukuro "\$@"
114101
EOL
115102
chmod +x flatpak/fukuro.sh
116-
117-
# 9) Create the Flatpak manifest
103+
118104
- name: Create Flatpak manifest
119105
run: |
120-
cat > com.gavrielsha.Fukuro.json << 'EOL'
106+
cat > com.gavrielsha.Fukuro.json << EOL
121107
{
122108
"app-id": "com.gavrielsha.Fukuro",
123109
"runtime": "org.freedesktop.Platform",
@@ -157,25 +143,21 @@ jobs:
157143
]
158144
}
159145
EOL
160-
161-
# 10) Build the Flatpak
146+
162147
- name: Build Flatpak
163148
run: |
164149
flatpak-builder --repo=repo --force-clean build-dir com.gavrielsha.Fukuro.json
165-
166-
# 11) Bundle the Flatpak into a single file
150+
167151
- name: Create Flatpak bundle
168152
run: |
169153
flatpak build-bundle repo fukuro.flatpak com.gavrielsha.Fukuro
170-
171-
# 12) Upload the bundle as an artifact
154+
172155
- name: Upload Flatpak bundle as artifact
173156
uses: actions/upload-artifact@v4
174157
with:
175158
name: fukuro-flatpak
176159
path: fukuro.flatpak
177-
178-
# 13) Create a Release (if pushing a tag like v1.0.0)
160+
179161
- name: Release
180162
uses: softprops/action-gh-release@v1
181163
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)