Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dhet
Copy link
Contributor

@dhet dhet commented Oct 20, 2019

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 <releases/> tag into the appdata.xml.
The script distinguishes between three types of builds:

  • stable releases, e.g. 1.4.15:
    • <releases/> tag is included
    • release type is set to stable
    • release contains links to the source and binary downloads
  • development releases e.g. 1.5.0-alpha2
    • <releases/> tag is included
    • release type is set to development
    • release contains links to the source and binary download
  • snapshot releases, i.e. SNAPSHOT
    • <releases/> tag is omitted

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
Copy link
Member

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:

  • For stable releases, the URL should be http://dl.bintray.com/cryptomator/cryptomator/{{release_version}}/cryptomator-{{release_version}}-x86_64.AppImage (faster CDN than GitHub)
  • should <releases> only contain one <release>?
  • maybe we can use a GitHub Action on the cryptomator/cryptomator repo to make a PR on cryptomator/cryptomator-linux to append a new release whenever one is tagged

@dhet
Copy link
Contributor Author

dhet commented Oct 22, 2019

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants