Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cargo-generate
Browse files Browse the repository at this point in the history
  • Loading branch information
janhohenheim committed Jul 18, 2024
2 parents 9d2676b + c9b81b0 commit c2138a1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Binary file added docs/workflow-itch-release.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 24 additions & 3 deletions docs/workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ Enter a version number in the format `v1.2.3`, then hit the green `Run workflow`
### Set up variables

Open [`.github/workflows/release.yaml`](../.github/workflows/release.yaml) and navigate to this section:
[`.github/workflows/release.yaml`](../.github/workflows/release.yaml) contains a list of environment variables that are set automatically by `cargo generate`.
Otherwise, you will have to fill them in manually and push a commit.

<details>
<summary>Environment variables section of the release workflow</summary>

```yaml
env:
Expand All @@ -64,7 +68,9 @@ env:
USE_GIT_LFS: false
```
Update the values for your project and push a commit.
</details>
In any case, make note of the value used for `ITCH_TARGET`, as you will need it later.

### Set up permissions

Expand All @@ -78,7 +84,15 @@ Set `Workflow permissions` to `Read and write permissions`, then hit `Save`:

### Set up itch.io upload

Create your itch.io page with `Kind of project = HTML`, and double-check that the [`ITCH_TARGET` variable](#set-up-variables) you've set up earlier matches your itch.io page.
#### Create page

Create your itch.io page with the same name as is used in the `ITCH_TARGET` variable in [release.yaml](../.github/workflows/release.yaml).
By default, this is the same as the project name.
Also set `Kind of project` to `HTML`.

On your project page, you'll see a warning saying "There was a problem loading your project: No file provided to embed". This is because we haven't uploaded a release yet. Don't worry about it, we will fix that in a moment.

#### Add butler credentials

In your GitHub repository, navigate to `Settings > Secrets and variables > Actions`:

Expand All @@ -88,3 +102,10 @@ Hit `New repository secret` and enter the following, then hit `Add secret`:

- **Name:** `BUTLER_CREDENTIALS`
- **Secret:** Your [itch.io API key](https://itch.io/user/settings/api-keys) (create a new one if necessary)

#### Select the web build

[Run your workflow](#cd-releasing) once. When it's done, go back to itch.io and edit your project.
Scroll to `Uploads`, where you should now see a bunch of files. Find the one tagged `web` and tick the box that says "This file will be played in the browser". You only have to do this once on your first release.

![A screenshot showing a web build selected in the itch.io uploads](workflow-itch-release.png)

0 comments on commit c2138a1

Please sign in to comment.