.. _doc_pages_private_repos_game: ======================== Exporting a private game ======================== Most git repositories like Gitlab,Github and Bitbucket use SSH protocol to securely communicate, these keys allow the user to not provide username and password. W4Builds can use this type of keys when it needs to clone a private repository. In this section you will learn how to setup SSH keys to securely communicate with your git repo. Prerequisites +++++++++++++ Creating SSH keys requires the following tools - OpenSSH client. Most modern operating systems come with it pre-installed. Generate an SSH key pair ++++++++++++++++++++++++ SSH Keys comes in pairs, a public file and a private file. Your git repository will store the public and w4builds will store the private. You can think of w4builds as a git client 1. Open a terminal. 2. Run ssh-keygen -t followed by the key type and an optional comment. This comment is included in the .pub file that’s created. You may want to use an email or some comment easily indicate this is for w4builds :: ssh-keygen -t ed25519 -C "w4builds-ssh-key" 3. Press Enter. You should see an output similar to this :: Generating public/private ed25519 key pair. Enter file in which to save the key (/home/user/.ssh/id_ed25519): TYPE: github-w4builds 4. Two new files If the previous steps were successfully, you should have two(2) new files in the directory - github-w4builds - github-w4builds.pub Storing keys in git repositories ++++++++++++++++++++++++++++++++ After the generating the private and public files, we need to store the public file on your git repository. 1. Copy the contents of your public key file into your clipboard - macOS :: cat -d '\n' < github-w4builds.pub | pbcopy - Linux (requires the xclip package) :: xclip -sel clip < github-w4builds.pub - Git Bash on Windows :: cat github-w4builds.pub | clip **Follow the instructions on your git repository** Gitlab ------ 1. Sign in to GitLab 2. On the left sidebar, select your avatar 3. Select Edit profile 4. On the left sidebar, select SSH Keys 5. Select Add new key 6. In the Key box, paste the contents of your public key. If you manually copied the key, make sure you copy the entire key, which starts with ssh-rsa, ssh-dss, ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, ecdsa-sha2-nistp521, ssh-ed25519, sk-ecdsa-sha2-nistp256@openssh.com, or sk-ssh-ed25519@openssh.com, and may end with a comment 7. In the Title box, type a description, like Work Laptop or Home Workstation 8. Select authentication for key type. 9. Optional. Update Expiration date to modify the default expiration date 10. Select Add key Github ------ 1. Sign in to Github. 2. In the upper-right corner of any page on GitHub, click your profile photo, then click Settings. 3. In the "Access" section of the sidebar, click SSH and GPG keys. 4. Click New SSH key or Add SSH key. 5. In the "Title" field, add a descriptive label for the new key. For example, if you're using a personal laptop, you might call this key "Personal laptop". 6. Select authentication for key type. 7. In the "Key" field, paste your public key. 8. Click Add SSH key. Storing keys in w4builds ++++++++++++++++++++++++ #. Login to w4builds #. Click "SSH Keys" Under SSH KEY AND SECRETS on the left side menu .. image:: ../img/ssh_home.png :alt: ssh home #. Clik "Load private Key", and select the new private file (the one without .pub) .. image:: ../img/select_file.png :alt: select private file #. Click save .. image:: ../img/view_new_key.png :alt: view new secret Triggering the build manually +++++++++++++++++++++++++++++ Now that we have everything set up to authenticate with the Git repository, let's proceed to trigger the build #. Click "Jobs" under Builds group, on left navigation bar #. Click "Export Game" .. image:: ../img/jobs.png :alt: Godot configuration form filled #. Fill out the form, in the following image we include a commonly used values .. image:: ../img/build_game.png :alt: Godot configuration form filled Game Name The title of the game. Repository The repository where the code for the engine is located. in this case `Godot fork `_. Remember to add the full url, including .git Git Ref The name of the Git branch (such as “main” or “development”), a tag (like “v1.0.0”), or a specific commit hash for the version of the game you wish to compile. Game Directory The directory where your project.godot file is located. Leave this field blank if the project.godot file is in the root directory of your repository. Godot Export Preset Name - The name you've assigned to your export preset in Godot (found under Project > Export > Your Preset > Name). - For this scenario, we are using the following export presets `export_presets `_. Secret Token Select the SSH token we created previously Export Games can be exported with * Debug - Developing: You're actively writing code and testing features. - Finding Bugs: You want to track down errors and see detailed information. - Performance Tuning: You need to analyze performance metrics to optimize your game. * Release - Publishing: You're ready to share your game with the world. - Final Testing: You've finished development and want to test the final product under realistic conditions. - Performance Optimization: You've made optimizations and want to verify they work correctly. 5. Select Editor and Export template Versions TAB: Custom Godot Templates (your compiled godot binaries) To use custom Godot editor and templates, select the name of the matrix that was used to build them. .. image:: ../img/customv.png :alt: Matrix home page TAB: Godot Official Export Templates To use Official Godot editor and templates, Select the desired godot official version .. image:: ../img/officialv.png :alt: Matrix home page .. note:: To export games from Godot, you need two main ingredients: - Editor: Your magical toolbox for crafting the game world. - Export Templates: Special recipes for packaging your game onto various platforms. The editor helps you make the game. The templates help you share it with others. #. CLick trigger Job