2828 description : " Resolved version used for this build"
2929 value : ${{ jobs.build.outputs.version }}
3030
31+ env :
32+ FLATPAK_BRANCH : stable
33+
3134jobs :
3235 build :
3336 runs-on : ${{ matrix.runner }}
@@ -89,12 +92,12 @@ jobs:
8992 __VERSION__=${{ steps.prepare.outputs.version }}
9093 preview_lines : " 120"
9194
92- - name : Install Flatpak tooling and runtimes
95+ - name : Install Flatpak tooling, yq, and runtimes
9396 run : |
9497 set -euo pipefail
95- echo "::group::Install flatpak + flatpak-builder"
98+ echo "::group::Install flatpak + flatpak-builder + yq "
9699 sudo apt-get update
97- sudo apt-get install -y flatpak flatpak-builder
100+ sudo apt-get install -y flatpak flatpak-builder yq
98101 echo "::endgroup::"
99102 echo "::group::Configure flathub remote"
100103 # Add flathub to the user installation (match --user usage later)
@@ -105,6 +108,16 @@ jobs:
105108 flatpak --user --noninteractive install -y flathub org.freedesktop.Platform//24.08 org.freedesktop.Sdk//24.08
106109 echo "::endgroup::"
107110
111+ - name : Verify rendered Flatpak branch
112+ run : |
113+ set -euo pipefail
114+ ACTUAL_BRANCH="$(yq -r '.branch' flatpak/cryptad.yaml)"
115+ if [ "$ACTUAL_BRANCH" != "$FLATPAK_BRANCH" ]; then
116+ echo "::error::Expected Flatpak manifest branch '$FLATPAK_BRANCH' but found '$ACTUAL_BRANCH'"
117+ exit 1
118+ fi
119+ echo "::notice::Verified Flatpak manifest branch: $ACTUAL_BRANCH"
120+
108121 - name : Build Flatpak (manifest)
109122 env :
110123 FLATPAK_DEFAULT_ARCH : ${{ matrix.flatpak_arch }}
@@ -122,16 +135,23 @@ jobs:
122135 set -euo pipefail
123136 VERSION='${{ steps.prepare.outputs.version }}'
124137 APPID='network.crypta.cryptad'
125- BRANCH="v${VERSION }"
138+ BRANCH="${FLATPAK_BRANCH }"
126139 # Canonical arch naming for artifact filenames
127140 case "${{ matrix.flatpak_arch }}" in
128141 x86_64) CANON_ARCH=amd64 ;;
129142 aarch64) CANON_ARCH=arm64 ;;
130143 *) CANON_ARCH='${{ matrix.flatpak_arch }}' ;;
131144 esac
132145 echo "::group::Export repo"
133- # Export to the same branch we'll bundle (defaults to 'master' if omitted)
146+ # Export to the same stable branch we'll bundle so all releases share one ref.
134147 flatpak build-export --arch=${{ matrix.flatpak_arch }} repo builddir "$BRANCH"
148+ EXPECTED_REF="app/${APPID}/${{ matrix.flatpak_arch }}/${BRANCH}"
149+ if ! ostree refs --repo=repo | grep -Fx "$EXPECTED_REF" >/dev/null; then
150+ echo "::error::Expected exported Flatpak ref '$EXPECTED_REF' was not created"
151+ ostree refs --repo=repo | sed 's/^/::error::[ref] /'
152+ exit 1
153+ fi
154+ echo "::notice::Verified exported Flatpak ref: $EXPECTED_REF"
135155 echo "::endgroup::"
136156 echo "::group::Create bundle"
137157 BUNDLE="cryptad-v${VERSION}-${CANON_ARCH}.flatpak"
0 commit comments