cryptomator / cryptomator-linux

Cryptomator .AppImage for Linux
GNU General Public License v3.0
14 stars 7 forks source link

Render appdata.xml dynamically and add <releases/> section #17

Open dhet opened 4 years ago

dhet commented 4 years ago

The change modifies the build script so that the appdata.xml is rendered dynamically instead of being hard-coded. The build script now calls the render-appdata-template.sh script which takes a template file and replaces all placeholders, e.g. {{release_version}}, with actual values. This makes it possible to include a \ tag into the appdata.xml. The script distinguishes between three types of builds:

Examples

Stable

./render-appdata-template.sh resources/appdata.template.xml 1.0.0

Output

...
  <releases>
    <release version="1.0.0" date="2019-10-20" type="stable">
      <url>https://github.com/cryptomator/cryptomator/releases/tag/1.0.0</url>
      <artifacts>
        <artifact type="binary">
          <location>https://github.com/cryptomator/cryptomator/releases/download/1.0.0/cryptomator-1.0.0-x86_64.AppImage</location>
        </artifact>
        <artifact type="source">
          <location>https://github.com/cryptomator/cryptomator/archive/1.0.0.tar.gz</location>
        </artifact>
      </artifacts>
    </release>
  </releases>
...

Development

./render-appdata-template.sh resources/appdata.template.xml 1.5.0-alpha2

Output

...
  <releases>
    <release version="1.5.0-alpha2" date="2019-10-20" type="development">
      <url>https://github.com/cryptomator/cryptomator/releases/tag/1.5.0-alpha2</url>
      <artifacts>
        <artifact type="binary">
          <location>https://github.com/cryptomator/cryptomator/releases/download/1.5.0-alpha2/cryptomator-1.5.0-alpha2-x86_64.AppImage</location>
        </artifact>
        <artifact type="source">
          <location>https://github.com/cryptomator/cryptomator/archive/1.5.0-alpha2.tar.gz</location>
        </artifact>
      </artifacts>
    </release>
  </releases>
...

Snapshot

./render-appdata-template.sh resources/appdata.template.xml SNAPSHOT

releases tag is not rendered

overheadhunter commented 4 years ago

I like the idea to add some automation! (Btw parsing the readme.md was a good idea, too. However, the urls caused problems during appstream validation, therefore I decided to better copy the description manually.)

Three points:

dhet commented 4 years ago

The GitHub Action sounds good! I will look into it.