CI: automatically update the manifest and create a branch on the flatpak repo for each release

This commit is contained in:
Guillaume Meunier
2024-10-02 21:35:48 +02:00
parent 5217e7c27f
commit c34d82453a
4 changed files with 125 additions and 12 deletions
+41 -1
View File
@@ -86,11 +86,18 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Create the flatpak manifest
run: |
git config --global --add safe.directory $(pwd)
tools/gen_flatpak_manifest.sh --git > io.github.wivrn.wivrn.yml
# TODO: replace with version > v6.3 when it's released
- uses: flatpak/flatpak-github-actions/flatpak-builder@b8be6bc0ede43cb3a2cc55895654312b14f84a0d
with:
manifest-path: flatpak/io.github.wivrn.wivrn.yml
manifest-path: io.github.wivrn.wivrn.yml
bundle: wivrn-server.flatpak
upload-artifact: false
@@ -279,6 +286,16 @@ jobs:
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
path: wivrn
- uses: actions/checkout@v4
with:
fetch-depth: 0
repository: WiVRn/io.github.wivrn.wivrn
path: flathub
token: ${{ secrets.FLATHUB_TOKEN }}
- name: Download artifacts (APK)
uses: actions/download-artifact@v4
@@ -303,8 +320,31 @@ jobs:
apk/*.apk
flatpak/*.flatpak
- name: Update flatpak manifest for flathub
run: |
WIVRN_TAG=$(echo $GITHUB_REF | sed -E -e "s,refs/[^/]*/v?,,")
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
cd flathub
git remote add upstream https://github.com/flathub/io.github.wivrn.wivrn.git
git fetch upstream
git reset --hard upstream/master
git config --global --add safe.directory $(pwd)
../wivrn/tools/gen_flatpak_manifest.sh --git > io.github.wivrn.wivrn.yml
git checkout -b $WIVRN_TAG
git add io.github.wivrn.wivrn.yml
git commit -m "Version "$WIVRN_TAG
git push --set-upstream origin $WIVRN_TAG
git show
- name: Update release branch
run: |
cd wivrn
git fetch origin release
git push origin HEAD:release
+1 -1
View File
@@ -200,7 +200,7 @@ FetchContent_Declare(imgui EXCLUDE_FROM_ALL SYSTEM URL https://github.co
# Server dependencies
FetchContent_Declare(monado
GIT_REPOSITORY https://gitlab.freedesktop.org/monado/monado
# also change in flatpak/io.github.wivrn.wivrn.yml !!!
# The flatpak manifest is updated automatically
GIT_TAG 01806a3ffa62a2440da83d94e7a9297645d9d95a
PATCH_COMMAND ${CMAKE_CURRENT_LIST_DIR}/patches/apply.sh ${CMAKE_CURRENT_LIST_DIR}/patches/monado/
EXCLUDE_FROM_ALL
@@ -152,20 +152,23 @@ modules:
- -DWIVRN_USE_X264=ON
- -DWIVRN_USE_NVENC=ON
- -DWIVRN_USE_PULSEAUDIO=OFF
- -DWIVRN_CLIENT_URL=https://github.com/WiVRn/WiVRn/releases/latest/download/WiVRn-standard-release.apk
-DWIVRN_WERROR=ON
- -DFETCHCONTENT_FULLY_DISCONNECTED=ON
- -DFETCHCONTENT_BASE_DIR=deps
- -DXRT_IPC_MSG_SOCK_FILENAME=wivrn/comp_ipc
- -DGIT_DESC=WIVRN_GIT_DESC
- -Wno-dev
sources:
- type: dir
path: ..
- WIVRN_SRC1
WIVRN_SRC2
WIVRN_SRC3
- type: archive
url: https://github.com/boostorg/pfr/archive/refs/tags/2.2.0.tar.gz
url: BOOSTPFR_URL
dest: deps/boostpfr-src
sha256: 6f490ec1383de5855dcf801c23f0a967f888eb6e1440b6ca0bf36c12d4ae7ac7
sha256: BOOSTPFR_SHA256
- type: git
url: https://gitlab.freedesktop.org/monado/monado
tag: 01806a3ffa62a2440da83d94e7a9297645d9d95a
tag: MONADO_COMMIT
dest: deps/monado-src
- type: shell
commands:
@@ -181,10 +184,7 @@ modules:
sources:
- type: git
url: https://gitlab.com/znixian/OpenOVR.git
tag: 632e5cc50b913e93194ca2970e6f13021182579f
- type: patch
paths:
- opencomposite-0001-Add-install-target.patch
tag: f969a972e9a151de776fa8d1bd6e67056f0a5d5d
- name: launcher
buildsystem: simple
+73
View File
@@ -0,0 +1,73 @@
#!/bin/bash
set -e
WIVRN_SRC_TYPE=gitlocal
while [ ! -z "$1" ]
do
case "$1" in
"--git")
WIVRN_SRC_TYPE=git
;;
"--gitlocal")
WIVRN_SRC_TYPE=gitlocal
;;
"--dir")
WIVRN_SRC_TYPE=dir
;;
esac
shift
done
cd $(dirname $0)
GIT_TAG=$(git describe --exact-match --tags 2>/dev/null || true)
GIT_SHA=$(git rev-parse HEAD)
GIT_COMMIT=$(git describe --exact-match --tags 2>/dev/null || git rev-parse HEAD)
GIT_DESC=$(git describe --tags)
MONADO_COMMIT=$(grep -zo "FetchContent_Declare(monado[^)]*)" ../CMakeLists.txt | sed -ze "s/^.*GIT_TAG *\([^ )]*\).*$/\1/" | tr -d '\0')
BOOSTPFR_URL=$(grep -zo "FetchContent_Declare(boostpfr[^)]*)" ../CMakeLists.txt | sed -ze "s/^.*URL *\([^ )]*\).*$/\1/" | tr -d '\0')
BOOSTPFR_SHA256=$(curl --silent --location $BOOSTPFR_URL | sha256sum | cut -f1 -d' ')
if [ -z "$GIT_TAG" ]
then
WIVRN_CLIENT_URL=https://github.com/WiVRn/WiVRn-APK/releases/download/apk-${GIT_SHA}/org.meumeu.wivrn-standard-release.apk
else
WIVRN_CLIENT_URL=https://github.com/WiVRn/WiVRn/releases/download/${GIT_TAG}/WiVRn-standard-release.apk
fi
if [ $WIVRN_SRC_TYPE = git ]
then
WIVRN_SRC1="type: git"
WIVRN_SRC2="url: https://github.com/WiVRn/WiVRn.git"
WIVRN_SRC3="tag: ${GIT_COMMIT}"
elif [ $WIVRN_SRC_TYPE = gitlocal ]
then
WIVRN_SRC1="type: git"
WIVRN_SRC2="url: "$(realpath $(pwd)/..)
WIVRN_SRC3="tag: ${GIT_COMMIT}"
else
WIVRN_SRC1="type: dir"
WIVRN_SRC2="path: "$(realpath $(pwd)/..)
WIVRN_SRC3=""
fi
echo "Git commit: $GIT_COMMIT" >&2
echo "Git tag: $GIT_DESC" >&2
echo "Client URL: $WIVRN_CLIENT_URL" >&2
echo "Monado commit: $MONADO_COMMIT" >&2
echo "Boost.PFR URL: $BOOSTPFR_URL" >&2
echo "Boost.PFR SHA256: $BOOSTPFR_SHA256" >&2
cat ../flatpak/io.github.wivrn.wivrn.yml.in | sed \
-e s,WIVRN_SRC1,"$WIVRN_SRC1", \
-e s,WIVRN_SRC2,"$WIVRN_SRC2", \
-e s,WIVRN_SRC3,"$WIVRN_SRC3", \
-e s,WIVRN_GIT_DESC,$GIT_DESC, \
-e s,WIVRN_CLIENT_URL=.*,WIVRN_CLIENT_URL=$WIVRN_CLIENT_URL, \
-e s,BOOSTPFR_URL,$BOOSTPFR_URL, \
-e s,BOOSTPFR_SHA256,$BOOSTPFR_SHA256, \
-e s,MONADO_COMMIT,$MONADO_COMMIT,