diff options
| -rw-r--r-- | docs/Deploy.md | 31 | ||||
| -rw-r--r-- | scripts/deploy_release.py | 45 |
2 files changed, 54 insertions, 22 deletions
diff --git a/docs/Deploy.md b/docs/Deploy.md new file mode 100644 index 000000000..2a5e9be0f --- /dev/null +++ b/docs/Deploy.md @@ -0,0 +1,31 @@ +# Deploying a build to UE + +## Build + +Builds are produced via GitHub CI (Action Runners) and uploaded as artifacts +to GitHub. See [create_release.yml](.github/workflows/create_release.yml) for +details on what happens during the build. + +A new release is created when the [VERSION.txt](VERSION.txt) file changes. + +## Deploying into the UE tree + +After a successful release, you need to integrate the resulting binaries into +the UE tree. There's a helper script for this in [scripts/download_artifacts.py](scripts/download_artifacts.py) + +You'll need a p4 workspace mapped to the stream or branch you want to deploy +into, and a clone of the zen git repo. Since we use `gh` to download the +artifacts you'll need to use `gh auth login` and `gh repo clone` to clone +the repo. With the current directory set to the root of the cloned git repo, +run the following command to download the artifacts corresponding to the +VERSION.txt in the repo by default. + +```bash +> python scripts/download_artifacts.py <UE root path> +``` + +The script should go ahead and for each platform downloads the artifacts +using `gh artifact download` to a temporary directory, sync the corresponding +files in Engine/Binaries/<platform> to #head and opens them for edit and +copies the downloaded binaries into place, leaving the changes in your default +changelist. diff --git a/scripts/deploy_release.py b/scripts/deploy_release.py index 52805738f..69eb71010 100644 --- a/scripts/deploy_release.py +++ b/scripts/deploy_release.py @@ -20,15 +20,19 @@ import shutil import subprocess -def read_version(repo_root): - """Read the version from VERSION.txt.""" - version_file = repo_root / "VERSION.txt" - if not version_file.exists(): - print(f"Error: VERSION.txt not found at {version_file}", file=sys.stderr) - sys.exit(1) - - version = version_file.read_text().strip() - print(f"Version: {version}") +def read_version(repo_root, version_override=None): + """Read the version from VERSION.txt or use the provided override.""" + if version_override: + version = version_override + print(f"Version: {version} (from --version)") + else: + version_file = repo_root / "VERSION.txt" + if not version_file.exists(): + print(f"Error: VERSION.txt not found at {version_file}", file=sys.stderr) + sys.exit(1) + + version = version_file.read_text().strip() + print(f"Version: {version} (from VERSION.txt)") return version @@ -235,12 +239,12 @@ def main(): parser.add_argument( "output_dir", type=Path, - help="Directory where artifacts will be copied" + help="Directory where artifacts will be copied (should be the root of a UE p4 workspace)" ) parser.add_argument( - "--version-file", - type=Path, - help="Path to VERSION.txt (default: auto-detect from script location)" + "--version", + type=str, + help="Version to download (default: read from VERSION.txt)" ) parser.add_argument( "-v", "--verbose", @@ -250,16 +254,13 @@ def main(): args = parser.parse_args() - # Determine repository root - if args.version_file: - repo_root = args.version_file.parent - else: - # Assume script is in scripts/ directory - script_dir = Path(__file__).resolve().parent - repo_root = script_dir.parent + # Determine repository root (for reading VERSION.txt if needed) + # Assume script is in scripts/ directory + script_dir = Path(__file__).resolve().parent + repo_root = script_dir.parent - # Read version - version = read_version(repo_root) + # Read version (from --version option or VERSION.txt) + version = read_version(repo_root, args.version) # Create output directory if it doesn't exist output_dir = args.output_dir.resolve() |