Releasing to itch.io - acrimi/Raven GitHub Wiki

To push your builds to itch.io, it is strongly suggested to use butler. Butler can be used directly from the command line, but this guide will walk through using the gradle plugin, which makes the process much simpler and more automated.

Adding the Plugin

The butler plugin doesn't support modern plugin DSL configuration yet, so you'll have to add it to the build script dependencies in your project-level gradle file:

buildscript {
    repositories {
        ...
        mavenCentral()
    }
    dependencies {
        ...
        classpath group: 'org.mini2Dx', name: 'butler', version: '2.0.0'
    }
}

Then you can apply the plugin in the gradle file for your pc module:

plugins {
    id 'application'
    ...
    id 'org.mini2Dx.butler'
}

Configuring Butler

Once the plugin is added, you need to tell butler what your user account is, and which game you are going to be pushing builds to. In the gradle file for your pc module, add a butler block:

butler {
    user = "your-itchio-user"
    game = "your-itchio-game" // The last part of your project's url
}

The butler plugin supports a few more configuration options in this block, but user and game are the only required ones. You may also want to specify the version you defined for Launch4j, if applicable:

butler {
    user = "your-itchio-user"
    game = "your-itchio-game" // The last part of your project's url
    userVersion = versionName
}

Pushing builds

To configure how your build is going to actually be sent to itch.io, you'll need to create a PushTask. This is a simple type of task provided by the butler plugin that defines where your distributable is located, and what channel you want to push to for your game. We can leverage the exposed properties of launch4j for this:

task butlerPush(type: org.mini2Dx.butler.task.PushTask) {
    binDirectory = "${buildDir}/${launch4j.outputDir}"
    channel = "windows"
}

If you followed the steps in The Distributable Task, you can add a dependency to this task to simplify the build sequence:

task butlerPush(type: org.mini2Dx.butler.task.PushTask) {
    depends on prepareDistributable
    binDirectory = "${buildDir}/${launch4j.outputDir}"
    channel = "windows"
}

Then you can simply run the butlerPush task and a new build will be compiled and pushed to itch.io in one step!

NOTE: The first time you run butlerPush, a browser window will open prompting you to authorize butler for access to your account. This should only happen once, and subsequent runs should require no user interaction.