Skip to content

MerryMcl/local_mac

 
 

Repository files navigation

Hacker's GameDev Local on Mac

This serves as an exposé and example of the typical competent local setup for game development workflow within your local Mac for Agile style collaboration.

Basic Principles

  1. ToDo: what are the DameDev basic principles especially for digital art?

The Global Setup Journey

OS Setup - Everything begins with the local...
  1. Install your OS: Linux Mint, a Mate Desktop Environment in our case, but you are free to choose any or many available - beginner's guide.
  2. Concept: Your first user is reserved for you and is the only user with sudo access. If you have multiple customers or entities to code for separate them by creating additional accounts, leaving the first one untarnished. If you have separate boxes for separate gigs like we do the one user may suffice for you, yet a separate single user for coding is best recommended.
  3. Upgrade base packages: step 01 - the base
  4. Configure your shell: step 02 - the 'oh your shell'
  5. Useful Global Apps!: step 03 - global apps

From this point, each local-user development toolset is configured "as a user," including if only one user opted to be used.* The actual development environment is encapsulated by a Linux user.

Dev User Keys Setup

This sequence applies to each local development user.

Configure Git

Instructions - Git Client, initial setup
git config --global user.name "yer-github-handle"
git config --global user.email "12781006+yer-handle@users.noreply.github.com"
git config --list --show-origin

SSH Key - Authentication

Instructions - SSH Key
# Okay to accept all defaults
ssh-keygen -t ed25519
  • Copy public key into clipboard:
sudo apt install xclip
cat ~/.ssh/id_ed25519.pub | xclip -i -sel clip
  • Navigate to your account keystore: https://github.com/settings/keys
  • Paste public key from clipboard into the Key field,
    • leave Key type as "Authentication Key"
    • provide no Title
    • press Add SSH Key

GPG keys - Signing

Instructions - GPG Key Setup, Signing

NOTE: This Mint distribution has all the required packages and no need to install anything. Alternatively one needs sudo apt install gnupg gnupg-agent pinentry-gnome3 or if gnupg2 package is desired instead sudo apt install gnupg2 gnupg-agent pinentry-gnome3

  • Generate a new GPG key:
# Test for Pin Entry; else install from comments above
echo GETPIN | pinentry

gpg --full-generate-key
gpg --list-secret-keys --keyid-format=long
  • Copy value after rsaNNNN/ ,such as 3AA5C34371567BD2
  • Export key armor into clipboard:
gpg --armor --export 3AA5C34371567BD2 | xclip -i -sel clip
git config --global --unset gpg.format
gpg --list-secret-keys --keyid-format=long
git config --global user.signingkey 3AA5C34371567BD2
git config --global commit.gpgsign true
git config --list --show-origin

echo -e '\nexport GPG_TTY=$(tty)' >> ~/.zprofile
  • Test signing a commit and pushing to see the verified tag:
git commit -S -m "YOUR_COMMIT_MESSAGE"
git push

IDE Setup

SDK Manager Setup

Instructions - SDK Manager Setup
curl -s "https://get.sdkman.io" | bash
source "$HOME/.sdkman/bin/sdkman-init.sh"

sdk install java
sdk install kotlin
sdk install gradle

sdk current  
IMPROVEMENT - Seggregate Shell Elements

NOTE: The installer will assume single zsh config file target. Instead edit these files as follows:

#.zshenv
# ...
export SDKMAN_DIR="$HOME/.sdkman"
#.zprofile
# ...
export GPG_TTY=$(tty)
#.zshrc
# ...
#THIS MUST BE AT THE END OF THE FILE FOR SDKMAN TO WORK!!!
[[ -s "$HOME/.sdkman/bin/sdkman-init.sh" ]] && source "$HOME/.sdkman/bin/sdkman-init.sh"

JetBrains Toolbox Setup

Instructions - Example Toolbox Setup, IDEA
mkdir ~/opt
cd ~/Downloads/              
wget https://download-cdn.jetbrains.com/toolbox/jetbrains-toolbox-2.0.4.17212.tar.gz
tar -xvzf jetbrains-toolbox-2.0.4.17212.tar.gz -C ~/opt
cd ~/opt
./jetbrains-toolbox

GitHub Integration

Most hackers work directly with GitHub CLI which allows not only ordinary Git operations by a wrapper but also direct controls over the entire GitHub API, driving all aspects of the DevOps lifecycle such as pull requests from right under your fingertips.

GH CLI - the Gist of it!
  • Assumptions:
    • SSH Authentication Key is configured, i.e. ed25519.
    • Default Git protocol is SSH and not HTTPS.
    • GPG Signing Key is configured.
    • Local Git Client signs commits by default.
  • Next Steps:
    • Install GH client EITHER as a local user, OR globally with Apt.
    • Configure Key using JetBrains IDE.
    • Run gh config set git_protocol ssh --host github.com to set Git protocol to SSH.
    • Run gh config set browser google-chrome to set Browser to Google Chrome.
    • Run gh repo clone aaronfllr/local_mint to test by cloning my repo.
      • though you should really fork!
GH Install - Global Install Example
type -p curl >/dev/null || (sudo apt update && sudo apt install curl -y)
curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo dd of=/usr/share/keyrings/githubcli-archive-keyring.gpg \
&& sudo chmod go+r /usr/share/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
GH Configure - IDE Task Key Example
  • Connect tasks:
  • Generate token through IDE and "Test" it:
Add to the environment - Add token environment variable to ~/.zshenv
vi ~/.zshenv

# Add a line that looks like so:
export GITHUB_TOKEN="ghp_YerIdeGeneratedToken"
# Test with:
gh auth status
# Should report authenticated by token
gh auth logout
gh auth status
# Should still report unauthenticated by token
# Example of authenticated response:~ gh auth status                                  
github.com
  ✓ Logged in to github.com as yer-handle (GH_TOKEN)
  ✓ Git operations for github.com configured to use ssh protocol.
  ✓ Token: ghp_************************************
  ✓ Token scopes: gist, notifications, read:audit_log, read:gpg_key, read:org, read:project, read:user, repo, user:email, workflow, write:discussion, write:packages

Here is the entire manual: https://cli.github.com/manual/

Enjoy!

About

Merry Repository for local game dev.

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published