     if error? or response.statusCode isnt 204
       logError('Deleting release failed', error, body)
 
-deleteExistingAsset = (release, assetName, callback) ->
-  for asset in release.assets when asset.name is assetName
+deleteExistingAssets = (release, assetNames, callback) ->
+  [callback, assetNames] = [assetNames, callback] if not callback?
+
+  deleteAsset = (url, callback) ->
     options =
-      uri: asset.url
+      uri: url
       method: 'DELETE'
       headers: defaultHeaders
     request options, (error, response, body='') ->

      return

    if release?
      deleteExistingAsset release, (error) ->
        callback(error, release)
      return


    createBuildRelease (error, release) ->
      return done(error) if error?

      zipApps buildDir, assets, (error) ->
        return done(error) if error?
        uploadAssets release, buildDir, assets, (error) ->
          return done(error) if error?
          publishRelease release, (error) ->
            return done(error) if error?
            getAtomDraftRelease (error, release) ->
              return done(error) if error?
              assetNames = (asset.assetName for asset in assets)
              deleteExistingAssets release, assetNames, (error) ->
                return done(error) if error?
                uploadAssets(release, buildDir, assets, done)

logError = (message, error, details) ->
  grunt.log.error(message)
  grunt.log.error(error.message ? error) if error?
  grunt.log.error(details) if details

zipApps = (buildDir, assets, callback) ->
  zip = (directory, sourceName, assetName, callback) ->
    options = {cwd: directory, maxBuffer: Infinity}
    child_process.exec "zip -r --symlinks #{assetName} #{sourceName}", options, (error, stdout, stderr) ->
      if error?
        logError("Zipping #{sourceName} failed", error, stderr)
      callback(error)

  tasks = []
  for {assetName, sourceName} in assets
    fs.removeSync(path.join(buildDir, assetName))
    tasks.push(zip.bind(this, buildDir, sourceName, assetName))
  async.parallel(tasks, callback)

getRelease = (callback) ->
  options =
