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

[FeatureRequest] Integrate appcast generation with GitHub Releases / Pages #648

Open
k06a opened this issue Oct 6, 2015 · 23 comments
Open

Comments

@k06a
Copy link

k06a commented Oct 6, 2015

My app binaries are hosted on GitHub Releases page.
I just wanna Sparkle to check this page for new versions :)

@zorgiepoo
Copy link
Member

It may be more practical to generate an appcast server-side based on changes to GitHub's release page. I don't really know how much info GitHub gives you in order to do that in a sane manner however.

@kainjow
Copy link
Contributor

kainjow commented Oct 7, 2015

You could subscribe to the Atom page and update your Sparkle version once a new release comes out. Probably the safest way.

https://github.com/sparkle-project/Sparkle/releases.atom

@zorgiepoo
Copy link
Member

Briefly looking at the atom feed, it's not meant to be used for this kind of task. Probably you'd want GitHub's Releases API.

@kainjow
Copy link
Contributor

kainjow commented Oct 7, 2015

Well I meant doing it manually, no automation, since you would want to probably wait for a release to update in case there are bugs, especially if you're about to ship your software.

@zorgiepoo
Copy link
Member

Don't see the point of subscribing to the feed if you are the one pushing the release onto GitHub and have to generate the appcast manually. Anycase, I thought the original poster wanted it to be automated. One could try to make use of the "pre-release" field GitHub has, too.

@k06a
Copy link
Author

k06a commented Oct 8, 2015

Really I would like to setup update suggestion for my app without any own backend. Don't wanna care of this dependency never. Just wanna add binaries to GitHub Releases page.

@kornelski
Copy link
Member

That sounds like a very convenient thing indeed.

I do have some concerns:

  • Supporting GitHub's releases page directly would require Sparkle using GitHub API directly. That's a very specific dependency for Sparkle, and although GitHub is great and all, it is a dependency on a non-standard API of a closed-source proprietary product.
  • Without an appcast there are no DSA signatures available, so we'd need to figure out what level of security we want, and how to implement it.

How about a slightly different thing:

a tool that generates appcast.xml file from a GitHub's releases page? (and maybe even a local directory containing binaries)

@k06a
Copy link
Author

k06a commented Oct 8, 2015

@pornel do you mean include appcast.xml in git repository files? I think it can be done, by filling template and appending to xml file or add terminal tool to add versions to appcast.xml.

@uranusjr
Copy link

uranusjr commented Oct 8, 2015

While most information can be built automatically, the GitHub release page do lack some information essential for the appcast file, e.g. the version string (that positive incremental integer thing). Some extra metadata would still be needed.

@kornelski
Copy link
Member

@k06a Yes, something like that. Committed to the repo, or perhaps to gh-pages?

So it may be possible to do that with a tool that:

  1. Assumes it's run in a .git clone from github, so git remote -v will let you guess URL of the github releases page
  2. Finds the releases
  3. Downloads the releases (?) to sign them with a private DSA key
  4. Generates appcast.xml
  5. Commits appcast.xml to gh-pages of the project (which must match appcast URL in Info.plist)

So that would be possible to do as a standalone tool outside of Sparkle, and the whole operation could be done with just one command.

@k06a
Copy link
Author

k06a commented Oct 9, 2015

Maybe called like this:

ruby release_appcast.rb appcast.xml https://github.com/sparkle-project/Sparkle/releases/download/1.12.0a2/Sparkle-1.12.0a2.tar.bz2
git commit -m "Released new version"
git push

Or git commands can be included inside script.

@huangyq23
Copy link

I have a similar attempt recently.

With some scripting and naming conventions. it is possible to encode the version number into the binary archive's filename.

I had a script to perform archive and export the app zip file with names like MyApp.v1.2.b20151011.zip.
Here, 1.2 and 20151011 maps to CFBundleShortVersionString and CFBundleVersion extracted from Info.plist.

With that, I can draft up and publish the releases and upload the binary just as usual in github web interface.

Then there is the matter of setting up the gh-pages correctly to generate the appcast.xml. Since github already have all the releases objects supplied into the rendering context as site metadata, it is possible to build the entire xml within the Jekyll process using Liquid.

I filter out all draft and pre-releases for my appcast.xml. I also have a separate appcast_pre.xml that includes pre-releases for my alpha/beta channel.

The biggest benefit of render the xml in Github is no extra interaction with the Github Release API is required; normal git access will suffice. Obviously this is strong convention and less flexible since the resolving logic relies on the filename, but it suits my objectives well.

I can share my build script and liquid template for appcast.xml if anyone is interested.

@k06a
Copy link
Author

k06a commented Nov 10, 2015

@huangyq23 will be perfect to share you result with community! 👍

@huangyq23
Copy link

@k06a
Just got some time to work on this. I have them uploaded to a gist.

I also wrote a blogpost explaining some of the thought behind the solution.

Hope it helps.

@kornelski
Copy link
Member

@huangyq23 That's great! Thank you very much

@orta
Copy link
Contributor

orta commented Jan 12, 2016

The CocoaPods app uses the same kind of technique as @huangyq23 mentioned, incase you want more examples. See the bottom of the Rakefile

@pierredavidbelanger
Copy link

As a lazy person, I do not want to have to maintain appcast.xml after each release.
So, I just made a project to solve this exact problem for myself.
Then I realised it may help someone else on this thread.

@lwouis
Copy link

lwouis commented Feb 14, 2020

If someone is interested in a lightweight solution that doesn't require a backend (i.e. only using github to host the releases and appcast.xml), you can take a look at my working approach here. I'm generating an <item> in appcast.xml during a new release using 30 lines of bash.

It is tested, and works. It delivers updates without the need for an extra web-server.

noah-nuebling added a commit to noah-nuebling/mac-mouse-fix that referenced this issue Apr 30, 2021
What we still gotta do:
- Make the update notes look better
- Stop the generate_appcasts.py script from generating entries for so many old and unnecessary
 releases
- Make updates and beta channel stuff behave properly (Channel setting isn't used when starting the app up)
- Close more sheet when update commences
- Share my script in that github discussion at sparkle-project/Sparkle#648
- Think about where to put the appcasts (we need to commit to that because it's hardcoded into the app)
@noah-nuebling
Copy link

noah-nuebling commented May 4, 2021

See my solution here.

It's a little verbose and slow, but it has these perks:

  • It doesn't require a backend
  • It creates a separate appcast for prereleases
  • It automatically generates update notes from the GH Releases' body text. They look nice and native and support darkmode.
  • It's mostly written in python and I documented it pretty well, so you should be able to adapt it to your needs without too much trouble
  • It canalso record and plot downloads counts
  • You could probably even use GitHub actions to run this whenever you create a new release, but I haven't looked into that.

Thanks @lwouis for the inspiration!

@zorgiepoo
Copy link
Member

zorgiepoo commented Dec 27, 2022

While I do appreciate all the workflows that have been contributed here, I think with regards to this issue still being open here, I'd prefer to leverage off generate_appcast which officially supports Sparkle's full feature set and numerous edge cases going forward (including delta updates, tracking which updates need to be kept, among other things). That might involve adding an option to select a specific version to upload a draft (pre)release to a Github Releases / Pages repository.

@zorgiepoo zorgiepoo changed the title [FeatureRequest] Fetch updates from GitHub Releases page [FeatureRequest] Integrate appcast generation with GitHub Releases / Pages Dec 29, 2022
@mikehearn
Copy link

For those who need this feature today, Conveyor is a tool that makes Sparkle-ized Mac apps (and Windows, and Linux packages) from cross-platform app frameworks like Electron/Flutter/JVM or indeed native apps.

It can publish directly to GitHub Releases, also uploading a simple download page to GitHub Pages. And it can build/sign/notarize apps for all supported platforms from any platform, so you can run it in cheap GitHub CI workers or from your local dev laptop if you wish, you don't need a Mac to release Sparkleized Mac apps.

It's commercial (disclosure: by my company), but it's free for open source apps and can be used today to release to GH Releases.

@aehlke
Copy link

aehlke commented Dec 7, 2023

@zorgiepoo is there any tool available that uses that yet?

@chigkim
Copy link

chigkim commented Jan 17, 2024

I'd also love to see this feature!

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

No branches or pull requests