Skip to content

Commit ac018bc

Browse files
author
marci
committed
fix: flatpak bug
1 parent 759dc61 commit ac018bc

File tree

1 file changed

+47
-59
lines changed

1 file changed

+47
-59
lines changed
Lines changed: 47 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,66 +1,54 @@
1-
name: Build Flatpak Package
1+
name: Build Flatpak
22

3+
# Trigger only when a new release is published
34
on:
4-
push:
5-
branches: [ main ]
6-
tags: [ 'v*' ]
7-
pull_request:
8-
branches: [ main ]
9-
workflow_dispatch:
5+
release:
6+
types: [published]
107

118
jobs:
129
build-flatpak:
10+
name: Build Flatpak Package
1311
runs-on: ubuntu-latest
14-
12+
1513
steps:
16-
- name: Checkout repository
17-
uses: actions/checkout@v4
18-
19-
- name: Install dependencies
20-
run: |
21-
sudo apt-get update
22-
sudo apt-get install -y flatpak flatpak-builder python3-pip python3-setuptools
23-
24-
- name: Setup Flatpak
25-
run: |
26-
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
27-
sudo flatpak install -y flathub org.freedesktop.Platform//23.08
28-
sudo flatpak install -y flathub org.freedesktop.Sdk//23.08
29-
30-
- name: Build Flatpak package
31-
run: |
32-
chmod +x build_flatpak.sh
33-
./build_flatpak.sh
34-
35-
- name: Upload Flatpak bundle
36-
uses: actions/upload-artifact@v4
37-
with:
38-
name: bash-script-maker-flatpak
39-
path: build/flatpak/bash-script-maker.flatpak
40-
retention-days: 30
41-
42-
- name: Create Release (on tag)
43-
if: startsWith(github.ref, 'refs/tags/')
44-
uses: softprops/action-gh-release@v1
45-
with:
46-
files: build/flatpak/bash-script-maker.flatpak
47-
body: |
48-
## Flatpak Package
49-
50-
### Installation
51-
```bash
52-
flatpak install bash-script-maker.flatpak
53-
```
54-
55-
### Verwendung
56-
```bash
57-
flatpak run org.securebits.bashscriptmaker
58-
```
59-
60-
### Features
61-
- Vollständig sandboxed
62-
- Automatische Updates
63-
- Desktop-Integration
64-
- Keine System-Abhängigkeiten
65-
env:
66-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Read version from file
18+
id: version
19+
run: echo "VERSION=$(cat VERSION)" >> $GITHUB_OUTPUT
20+
21+
- name: Set up Flatpak builder
22+
run: |
23+
sudo apt-get update
24+
sudo apt-get install -y flatpak flatpak-builder
25+
flatpak --user remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
26+
27+
- name: Cache Flatpak builder dependencies
28+
uses: actions/cache@v4
29+
with:
30+
path: ~/.cache/flatpak-builder
31+
key: ${{ runner.os }}-flatpak-builder-${{ hashFiles('build/flatpak/**.yml') }}
32+
restore-keys: |
33+
${{ runner.os }}-flatpak-builder-
34+
35+
- name: Build Flatpak
36+
run: |
37+
cd build/flatpak
38+
flatpak-builder --user --install-deps-from=flathub --force-clean --share=network build-dir org.securebits.bashscriptmaker.yml
39+
40+
- name: Create Flatpak Bundle
41+
run: |
42+
cd build/flatpak
43+
flatpak build-bundle repo bash-script-maker.flatpak org.securebits.bashscriptmaker
44+
45+
- name: Rename Bundle with Version
46+
run: |
47+
mv build/flatpak/bash-script-maker.flatpak BashScriptMaker-${{ steps.version.outputs.VERSION }}.flatpak
48+
49+
- name: Upload Flatpak Bundle as Artifact
50+
uses: actions/upload-artifact@v4
51+
with:
52+
name: flatpak-bundle
53+
path: BashScriptMaker-${{ steps.version.outputs.VERSION }}.flatpak
54+
retention-days: 7

0 commit comments

Comments
 (0)