You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This section only applies to the GitHub Copilot coding agent, running in a Linux runner from the GitHub Action environment. It does not apply to other environments, such as local development.
4
+
5
+
The GitHub Actions workflow `.github/workflows/copilot-setup-steps.yml` runs the setup steps mentioned in this file automatically. The commands below are the manual equivalent and **should only be run if you encounter a build failure** — for example, if GitVersion cannot determine the version, if submodules are missing, or if NuGet restore fails.
6
+
7
+
## Step 1 — Initialize git submodules
8
+
9
+
`Rampastring.XNAUI` (and its nested submodule `Rampastring.Tools`) may not be pre-initialized. Missing them causes compile errors about unknown `Rampastring.*` types.
10
+
11
+
```shell
12
+
git submodule update --init --recursive
13
+
```
14
+
15
+
## Step 2 — Unshallow the clone and fetch `develop`
16
+
17
+
The build system uses **GitVersion.MsBuild** to compute version numbers at compile time. It requires two things:
18
+
19
+
- A full (non-shallow) commit history.
20
+
- The `develop` branch reachable as a remote-tracking ref (it is the mainline branch in `GitVersion.yml`). Without it, any branch that is not `develop` or `master` fails with `Gitversion could not determine which branch to treat as the development branch`.
21
+
22
+
Run all three commands unconditionally:
23
+
24
+
-`--unshallow` is a no-op on an already-full clone (`|| true` prevents it from aborting).
25
+
-`set-branches` resets the remote's fetch refspec to the standard glob `+refs/heads/*:refs/remotes/origin/*`, removing any single-branch refspec that a shallow clone may have injected. Without this, LibGit2Sharp (used by GitVersion 5.12.0) crashes with `ref 'refs/remotes/origin/develop' doesn't match the destination` because it iterates refspecs in order and fails on the first non-matching one instead of falling through to the glob.
26
+
- The final fetch brings `refs/remotes/origin/develop` into the local ref store through that glob refspec so GitVersion can find it.
27
+
28
+
The same fix must be applied to every submodule recursively: `Rampastring.XNAUI` and its nested `Rampastring.Tools` submodule also carry `GitVersion.MsBuild` and are subject to the same crash when checked out with a narrow single-branch refspec.
Run restore from the **repo root** so that the solution file (`DXClient.slnx`) is used. This ensures all projects — including `SecondStageUpdater`, which the build pulls in transitively — are restored. Always pass the `Configuration` property; omitting it picks the wrong target frameworks.
See [Contributing.md](../Contributing.md) for coding style, formatting, and other contribution guidelines. Be aware, Copilot, you MUST read and follow this file, even if the user did not explicitly ask you to.
32
+
33
+
## GitHub Copilot coding agent setup instructions
34
+
35
+
This section only applies to the GitHub Copilot coding agent, running in a Linux runner from the GitHub Action environment. It does not apply to other environments, such as local development.
36
+
37
+
The steps in the [copilot-coding-agent-setup.md](./copilot-coding-agent-setup.md) file are automatically executed via a GitHub Action workflow before the agent starts. **Only read and run them manually if you encounter a build failure**.
# Automatically run the setup steps when they are changed to allow for easy validation, and
4
+
# allow manual testing through the repository's "Actions" tab
5
+
on:
6
+
workflow_dispatch:
7
+
push:
8
+
paths:
9
+
- .github/workflows/copilot-setup-steps.yml
10
+
pull_request:
11
+
paths:
12
+
- .github/workflows/copilot-setup-steps.yml
13
+
14
+
jobs:
15
+
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
16
+
copilot-setup-steps:
17
+
runs-on: ubuntu-latest
18
+
19
+
permissions:
20
+
contents: read
21
+
22
+
steps:
23
+
- name: Checkout code with full history and submodules
24
+
uses: actions/checkout@v4
25
+
with:
26
+
fetch-depth: 0
27
+
submodules: recursive
28
+
29
+
# the set-branches call is required to collapse the shallow-clone's specific-branch refspec back to the glob, preventing a LibGit2Sharp crash in GitVersion 5.12.0
30
+
- name: Unshallow clone and fetch develop branch
31
+
run: |
32
+
git fetch --unshallow origin || true
33
+
git remote set-branches origin '*'
34
+
git fetch origin develop
35
+
# Apply the same fix to every submodule (including nested ones), because GitVersion.MsBuild
36
+
# runs against each submodule directory that carries it, and the same LibGit2Sharp refspec
37
+
# crash occurs there when the submodule was checked out with a narrow single-branch refspec.
// Do not write INI file if using Settings.ini as Keyboard.ini. The hot keys will be saved when Settings.ini is saved.
501
+
// We choose this policy because, imagine a situation when the user pressed save in the hotkey config window, then decided they don't want changes (not the hotkey changes) they did in the options.
502
+
// If we don't flush here, everything can be restored by hitting a cancel.
503
+
// If we flush here -- the player can't cancel anymore at all.
0 commit comments