Merge pull request #176 from Murmele/automateAppdataReleaseUpdate

Automate appdata release notes
This commit is contained in:
Murmele 2022-06-08 20:20:18 +02:00 committed by GitHub
commit afc12d8d72
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 51 deletions

View File

@ -121,6 +121,7 @@ jobs:
ninja_platform: linux
qt_platform: linux
openssl_arch: linux-x86_64
cmake_flags: "-DGENERATE_APPDATA=ON"
cmake_env: {}
- name: mac
@ -269,6 +270,15 @@ jobs:
cd build/release
ninja package
# Command copied from flathub build process
- name: Validate appdata file
if: matrix.env.ninja_platform == 'linux' && !matrix.qt.check_only
run: |
sudo apt install flatpak
sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
sudo flatpak install -y org.freedesktop.appstream-glib
flatpak run --env=G_DEBUG=fatal-criticals org.freedesktop.appstream-glib validate ./build/release/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml
- name: Publish build artifacts
if: matrix.env.pack && !matrix.qt.check_only
uses: actions/upload-artifact@v2

View File

@ -0,0 +1,7 @@
# add release notes to the appdata file
file(READ "${CHANGELOG_HTML}" HTML_CHANGELOGS)
string(REGEX REPLACE "<h4>([A-Fa-f0-9]*)<\\/h4>" "\\1" RELEASES ${HTML_CHANGELOGS}) # h4 is unknow to appdata
string(REPLACE "\n" "\n\t" RELEASES ${RELEASES}) # add tabulator
string(REGEX REPLACE "<h3>(v[1-9]\\.[0-9]\\.[0-9]) - ([0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9])<\\/h3>" "<release version='\\1' date='\\2'>\n\t<description>" RELEASES ${RELEASES})
string(REGEX REPLACE "<hr \\/>" "</description>\n\t</release>" RELEASES ${RELEASES})
configure_file(${APPDATA_CONF} ${APPDATA})

View File

@ -46,35 +46,7 @@
</provides>
<releases>
<release version="V1.1.0" date="2022-04-30">
<description>
<ul>
<li>Button to directly access the terminal and the filebrowser</li>
<li>Add support for running in single instance mode</li>
<li>Customizable hotkeys</li>
<li>Quick commit author overriding</li>
<li>keyboard-interactive SSH auth</li>
<li>Improved single line staging and replacing staging image to a more appropriate one</li>
<li>Font customizing</li>
<li>Options to switch between staging/unstaging treeview, single tree view and list view</li>
<li>Do not automatically abort rebase if conflicts occur</li>
<li>Add possibility to save file of any version on local system</li>
<li>Add possibility to open a file of any version with default editor</li>
</ul>
</description>
</release>
<release version="V1.0.0" date="2021-11-18">
<description>
<ul>
<li>Staging of single lines</li>
<li>Double tree view: Seeing staged and unstaged changes in different trees.</li>
<li>Maximize History or Diff view by pressing Ctrl+M</li>
<li>Ignore Pattern: Ability to ignore all files defined by a pattern instead of only one file</li>
<li>Tag Viewer: When creating a new tag all available tags are visible. Makes it easier to create consistent tags.</li>
<li>Commit Message template: Making it easier to write template based commit messages.</li>
</ul>
</description>
</release>
@RELEASES@
</releases>
<content_rating type="oars-1.1">

View File

@ -1,6 +1,8 @@
set(CONF_DIR ${CMAKE_SOURCE_DIR}/conf)
set(RSRC_DIR ${CMAKE_SOURCE_DIR}/rsrc)
option(GENERATE_APPDATA "Create appdata/metadata file" OFF)
if(APPLE)
set(ICON ${RSRC_DIR}/Gittyup.icns)
set(APP_IMPL_FILE Application_mac.mm)
@ -33,6 +35,10 @@ set(CHANGELOG_HTML ${DOC_BINARY_DIR}/changelog.html)
set(ACKNOWLEDGMENTS_HTML ${DOC_BINARY_DIR}/acknowledgments.html)
set(PRIVACY_HTML ${DOC_BINARY_DIR}/privacy.html)
set(PLUGIN_HTML ${DOC_BINARY_DIR}/plugin.html)
set(APPDATA_CONF
${CMAKE_SOURCE_DIR}/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml.in)
set(APPDATA
${CMAKE_BINARY_DIR}/rsrc/linux/com.github.Murmele.Gittyup.appdata.xml)
add_custom_command(
OUTPUT ${CHANGELOG_HTML} ${ACKNOWLEDGMENTS_HTML} ${PRIVACY_HTML}
${PLUGIN_HTML}
@ -83,6 +89,17 @@ add_executable(
${PRIVACY_HTML}
${PLUGIN_HTML})
if(GENERATE_APPDATA)
add_custom_target(
appdata ALL
COMMAND
${CMAKE_COMMAND} -DCHANGELOG_HTML:STRING=${CHANGELOG_HTML}
-DAPPDATA_CONF:STRING=${APPDATA_CONF} -DAPPDATA:STRING=${APPDATA} -P
"${CMAKE_SOURCE_DIR}/cmake/generate_appdata.cmake"
DEPENDS ${CHANGELOG_HTML}
COMMENT "Create appdata file")
endif()
target_link_libraries(gittyup app)
set_target_properties(
@ -158,34 +175,34 @@ if(APPLE)
set(RELAUNCHER ${GITTYUP_NAME}.app/Contents/MacOS/relauncher)
install(
CODE "execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -delete_rpath \"${RPATH}\"
\"\${CMAKE_INSTALL_PREFIX}/${RELAUNCHER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"/usr/local/qt\"
\"\${CMAKE_INSTALL_PREFIX}/${RELAUNCHER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@loader_path/../Frameworks\"
\"\${CMAKE_INSTALL_PREFIX}/${RELAUNCHER}\"
)"
${CMAKE_INSTALL_NAME_TOOL} -delete_rpath \"${RPATH}\"
\"\${CMAKE_INSTALL_PREFIX}/${RELAUNCHER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"/usr/local/qt\"
\"\${CMAKE_INSTALL_PREFIX}/${RELAUNCHER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@loader_path/../Frameworks\"
\"\${CMAKE_INSTALL_PREFIX}/${RELAUNCHER}\"
)"
COMPONENT ${GITTYUP_NAME})
# Fixup indexer RPATH.
set(INDEXER ${GITTYUP_NAME}.app/Contents/MacOS/indexer)
install(
CODE "execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -delete_rpath \"${RPATH}\"
\"\${CMAKE_INSTALL_PREFIX}/${INDEXER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"/usr/local/qt\"
\"\${CMAKE_INSTALL_PREFIX}/${INDEXER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@loader_path/../Frameworks\"
\"\${CMAKE_INSTALL_PREFIX}/${INDEXER}\"
)"
${CMAKE_INSTALL_NAME_TOOL} -delete_rpath \"${RPATH}\"
\"\${CMAKE_INSTALL_PREFIX}/${INDEXER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"/usr/local/qt\"
\"\${CMAKE_INSTALL_PREFIX}/${INDEXER}\"
)
execute_process(COMMAND
${CMAKE_INSTALL_NAME_TOOL} -add_rpath \"@loader_path/../Frameworks\"
\"\${CMAKE_INSTALL_PREFIX}/${INDEXER}\"
)"
COMPONENT ${GITTYUP_NAME})
else()
# Install config files.