Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github release downloads slice is empty #2

Open
xor-gate opened this issue Jul 21, 2018 · 5 comments
Open

Github release downloads slice is empty #2

xor-gate opened this issue Jul 21, 2018 · 5 comments
Milestone

Comments

@xor-gate
Copy link

I expect the uploaded files to the github releases added to the release.Downloads slice. But it stays empty. Probably the github API must be used to itterate over this because the atom file doesn't contain the files.

https://github.com/xor-gate/syncthing-macosx/releases.atom at https://api.github.com/repos/xor-gate/syncthing-macosx/releases

Docs: https://developer.github.com/v3/repos/releases/

@xor-gate
Copy link
Author

xor-gate commented Jul 21, 2018

Fetching a release by id:

 > curl -s https://github.com/xor-gate/syncthing-macosx/releases.atom | grep id | grep v0
    <id>tag:github.com,2008:Repository/60985120/v0.14.46-1</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.33-1</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.8-2</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.8-1</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.8</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.7</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.6</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.5</id>
    <id>tag:github.com,2008:Repository/60985120/v0.14.4</id>

the id could be used to fetch the release:

 > curl -s https://api.github.com/repos/xor-gate/syncthing-macosx/releases/tags/v0.14.46-1 | grep browser_download_url
      "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.46-1/Syncthing-0.14.46-1.dmg"

the whole list

 > curl -s https://api.github.com/repos/xor-gate/syncthing-macosx/releases | grep browser_download_url
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.46-1/Syncthing-0.14.46-1.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.33-1/Syncthing-0.14.33-1.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.8-2/Syncthing-0.14.8-2.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.8-1/Syncthing-0.14.8-1.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.8/Syncthing-0.14.8.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.7/Syncthing-0.14.7.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.6/Syncthing-0.14.6.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.5/Syncthing-0.14.5.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.4/Syncthing-0.14.4.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.3-4/Syncthing-0.14.3-4.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/0.14.3-3/Syncthing-0.14.3-3.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.3-1/Syncthing-0.14.3-1.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.14.3/Syncthing-v0.14.3.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.13.10/Syncthing-v0.13.10.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.13.9/Syncthing-v0.13.9.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.13.6/syncthing-v0.13.6.dmg"
        "browser_download_url": "https://github.com/xor-gate/syncthing-macosx/releases/download/v0.13.5/syncthing-macosx-v0.13.5.zip"

@xor-gate
Copy link
Author

To answer my own question, in the meantime I switched from go-appcast to google/go-github where I am able to fetch the release assets.

@victorpopkov
Copy link
Owner

Exactly. GitHub Atom Feed shows only some basic information about the releases and much important data is omitted. For example, releases stability and downloads, as you have already mentioned.

I was planning to add GitHub API support for quite a while in order to retrieve the missing data. I will definitely add this feature alongside with #1 in the next couple of days.

Thank you @xor-gate for all your suggestions. You are awesome!

@xor-gate
Copy link
Author

xor-gate commented Aug 3, 2018

No problem @victorpopkov, for now I will use my own simple implementation but if you need some feedback or a little help let me know by '@' mentioning me.

@victorpopkov victorpopkov added this to the v0.2.0 milestone Aug 4, 2018
@xor-gate
Copy link
Author

xor-gate commented Aug 4, 2018

So I created a "production" script to transpile which is just a single file https://github.com/syncthing/syncthing-macos/blob/develop/script/ghreleases2appcast.go. Maybe usefull for inspiration.

@victorpopkov victorpopkov modified the milestones: v0.2.0, v0.3.0 Aug 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants