Skip to content

Commit c062980

Browse files
CI: Let github workflow use version number in the flatpak filename
Note: For pull requests, the version that is tested is an autogenerated temporary merge commit (which is good, since it tests whether things work *after* merging), but that commit id is also included in the filename which might be bit suprising. To be considered later.
1 parent 3875623 commit c062980

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

.github/workflows/testing.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ jobs:
8282
steps:
8383
- name: Prepare repo
8484
uses: actions/checkout@v2
85+
# Fetch history, so we also fetch the previous tag for deriving
86+
# the version number
87+
with:
88+
fetch-depth: 0
8589
- name: Install system packages
8690
# It would be good to cache the GNOME Sdk, as it
8791
# is rather big to download each time.
@@ -105,10 +109,14 @@ jobs:
105109
- name: Export bundle and try to install it
106110
run: |
107111
mkdir -p dist
108-
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo build/flatpak/repo dist/Hamster.flatpak org.gnome.Hamster
109-
flatpak --user -y install dist/Hamster.flatpak
112+
# Note: For pull requests, this version includes the git hash
113+
# of the autogenerated *merge* commit, not the original
114+
# to-be-merged commit (because that's also what is tested).
115+
VERSION=$(python src/hamster/version.py)
116+
flatpak build-bundle --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo build/flatpak/repo "dist/Hamster-$VERSION.flatpak" org.gnome.Hamster
117+
flatpak --user -y install "dist/Hamster-$VERSION.flatpak"
110118
- name: Upload built artifact
111119
uses: actions/upload-artifact@v2
112120
with:
113121
name: Flatpak application
114-
path: dist/Hamster.flatpak
122+
path: dist/*.flatpak

0 commit comments

Comments
 (0)