Sparkle Appcast Automation in Xcode
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 5 commits behind CraigWilliams:SnowLeopard.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Master branch is for OS versions before Snow Leopard
SnowLeopard branch is for Snow Leopard. All future revisions will be done on this branch.


This script is expanding on Marc Liyanage’s excellent post Sparkle Appcast Automation in Xcode.
Very cool!

In his article, Marc uses a bash script to automate the process of signing your Sparkle enabled app and explains how to put your private and public keys in your keychain. I wrote a Ruby version that extends this functionality to include a few more options…

IMPORTANT: You will need to read Marc's article first before moving forward.

Here is a quick list of added features:

1. config.yaml file for configuration information
2. build_now option - when set to 'NO' will not run during Release style build
3. Creates project release folder if it does not exist
4. Creates sub-folders based on version number
5. Creates css file
6. Creates xml file containing the '<item>' info generated by the script
7. Creates an html template file
8. Copies the newly created archive to the project folder

The project release folder is not the 'Release' folder Xcode creates. This is a folder that contains this and future Sparkle release builds. See 'appcast_basefolder' below.


Config YAML file
A YAML file is easily editable and is a good place for us to set up our
configuration information. It also enables us not to have to change the
script once we have it the way we want it.

Create a 'config.yaml' file and place it in your projects 'Release' folder
and include the following making the necessary changes.

build_now:              'YES'  
download_base_url:      ''  
appcast_basefolder:     '/users/user_name/desktop/app_name/'  
appcast_xml_name:       'appcast.xml'  
keychain_privkey_name:  'Sparkle Private Key'  
css_file_name:          'rnotes.css'  

IMPORTANT: If you change the variable names here you also need to change them in the script.


  Will only include this script in the build process if this is set to 'YES'
  The script automatically checks that the build style is 'Release'

  Your website url where you will place your updated project

  The base file is created for you and a project folder inside that with
  the name of your project and version number. 
	eg  - ProjectName 
  		  - ProjectName 1.0
			    - appcast.xml (contains the '<item>' info)
			    - 1.0.html
			    - rnotes.css
  			  - ProjectName
  		  - ProjectName 1.1
  			  - appcast.xml (contains the '<item>' info)
  			  - 1.1.html
  			  - rnotes.css
  			  - ProjectName

The following files are created for you if they do not already exist.

Your archived project file is also copied to the project folder

  This file holds the results of the script. What is between the '' tags that
  you will copy into your complete appcast.xml file.
  Name to your liking.

  You should understand this after reading Marc's article.
  Name to your liking.

This name will be used to create your css file and the link in the xml file. 
If you change this after these are created make sure also change the xml file 
or if you created the css file first use that name here.

  The css is at the bottom of the script and is in 'flat' form. One liners.
  When written to file it is expanded to standard format for easy editing.

Once your config.yaml file is created and placed in your projects 'Release' folder,
add this script as a 'Run Script' build phase. Set the bash to /usr/bin/ruby
and you are finished!

If you have questions, ideas or bug reports please post them here


2010-04-17 Changes made by Stefan Klieme - Thanks Stefan!
Using ditto instead of zip
Added @build_number