|
1 | | -# Bevy GitHub CI Template |
2 | | - |
3 | | -This repo show how to set up CI on a GitHub project for Bevy. |
4 | | - |
5 | | -It creates two workflows: |
6 | | - |
7 | | -* [CI](#CI) |
8 | | -* [Release](#Release) |
9 | | - |
10 | | -## CI |
11 | | - |
12 | | -Definition: [.github/workflows/ci.yaml](./.github/workflows/ci.yaml) |
13 | | - |
14 | | -This workflow runs on every commit to `main` branch, and on every PR targeting the `main` branch. |
15 | | - |
16 | | -It will use rust stable on linux, with cache between different executions, those commands: |
17 | | - |
18 | | -* `cargo test` |
19 | | -* `cargo clippy -- -D warnings` |
20 | | -* `cargo fmt --all -- --check` |
21 | | - |
22 | | -If you are using anything OS specific or rust nightly, you should update the file [ci.yaml](./.github/workflows/ci.yaml) to use those. |
23 | | - |
24 | | -## Release |
25 | | - |
26 | | -Definition: [.github/workflows/release.yaml](./.github/workflows/release.yaml) |
27 | | - |
28 | | -This workflow runs on every tag. |
29 | | - |
30 | | -It will build: |
31 | | -* For Linux and Windows, a .zip archive containing the executable and the `assets`. |
32 | | -* For macOS, a dmg image with a .app containing the `assets`. |
33 | | -* For wasm, a .zip archive with the wasm binary, the js bindings, an html file loading it, and the `assets`. |
34 | | - |
35 | | -If you don't want to target some of those platforms, you can remove the corresponding job from the file [release.yaml](./.github/workflows/release.yaml). |
36 | | - |
37 | | -If you don't want to attach the builds to the GitHub release, set `env.add_binaries_to_github_release` to `false`. |
38 | | - |
39 | | -If you are using Git LFS, set `env.use_git_lfs` to `true` so your assets are properly checked out. |
40 | | - |
41 | | -> [!Warning] |
42 | | -> GitHub's LFS storage has a quota. Please take a look at GitHub's documentation [here](https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-storage-and-bandwidth-usage) to understand the quota and costs before enabling this option. |
43 | | -
|
44 | | -### Git Tag from GitHub UI |
45 | | - |
46 | | -You can follow [Managing releases in a repository](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository) |
47 | | - |
48 | | -### Git Tag from the CLI |
49 | | - |
50 | | -Execute the following commands: |
51 | | - |
52 | | -```sh |
53 | | -git tag -a "my-game-1.0" -m "First official release" |
54 | | -git push --tags |
55 | | -``` |
56 | | - |
57 | | -### Result |
58 | | - |
59 | | -A new release will be available in GitHub, with the archives per platform available as downloadable assets. |
60 | | - |
61 | | -The `git` commands above produced this release: [my-game-1.0]( |
62 | | -https://github.com/bevyengine/bevy_github_ci_template/releases/tag/my-game-1.0). |
63 | | - |
64 | | -## Using the workflows in your own project |
65 | | - |
66 | | -If you would like to use the GitHub workflows included here for your own project, there are a few things you might have to adapt: |
67 | | - |
68 | | -1. The release workflow relies on the `index.html` file under `/wasm` for web builds |
69 | | -2. Make sure that the env variable `binary` ([release.yaml](.github/workflows/release.yaml#L10)) matches the name of your binary |
70 | | -3. Adapt the used toolchain if you are using nightly |
71 | | -4. In your GitHub repo's settings, under `Actions -> General` make sure "Read and Write permissions" is selected under "Workflow permissions" near the bottom. This fixes the error `Error: Resource not accessible by integration`. |
72 | | - |
73 | | - |
74 | | -### Publish on itch.io |
75 | | - |
76 | | -The release flow can be configured to push the releases to itch.io: |
77 | | - |
78 | | -1. Create an API key in https://itch.io/user/settings/api-keys |
79 | | -2. Go to the repository's Settings tab in GitHub, click on Secrets->Actions in the sidebar,and add a repository secret named `BUTLER_CREDENTIALS` set to the API key. |
80 | | -3. Uncomment `env.itch_target` in `release.yaml` and set it to the itch.io username and the name of the game on itch.io, separated by a slash (`/`) |
81 | | - |
82 | | -Once that is done, any tag pushed to GitHub will trigger an itch.io release and use the tag as the [user version](https://itch.io/docs/butler/pushing.html#specifying-your-own-version-number). |
83 | | - |
84 | | -## License |
85 | | - |
86 | | -Licensed under either of |
87 | | - |
88 | | -* Apache License, Version 2.0 |
89 | | - ([LICENSE-APACHE-2.0](LICENSE-Apache-2.0) or <http://www.apache.org/licenses/LICENSE-2.0>) |
90 | | -* MIT License |
91 | | - ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>) |
92 | | -* CC0-1.0 License |
93 | | - ([LICENSE-CC0-1.0](LICENSE-CC0-1.0) or <https://creativecommons.org/publicdomain/zero/1.0/legalcode>) |
94 | | - |
95 | | -at your option. |
96 | | - |
97 | | -The Ducky sprite is CC-0 licensed by [Caz Creates Games](https://caz-creates-games.itch.io/ducky-2). |
98 | | - |
99 | | -## Contribution |
100 | | - |
101 | | -Unless you explicitly state otherwise, any contribution intentionally submitted |
102 | | -for inclusion in the work by you, as defined in the Apache-2.0 license, shall be |
103 | | -triple licensed as above, without any additional terms or conditions. |
| 1 | +# Bevy-2048 |
| 2 | +2048 game made with Bevy just to learn. |
0 commit comments