This repository is the basis for all other repositories created here at KYAU Labs.
- GitHub limits repositories to 10GB of cache space for actions.
- GitHub limits users/organizations to 0.5GB of artifact storage.
Keep these factors in mind when setting up repositories.
- About
- Install Additions (optional)
- New Repository
- Git Hooks
- Initial Commit
- Repository Settings
- Issue Labels
- Conventional Commits
- Changelog
- Unity Projects
- Attribution
๐ง WARNING
# This is only required if you do not already have commitlint and git-cliff installed.
Install commitlint
and git-cliff
globally and then generate a commitlint config file.
npm i -g @commitlint/config-conventional @commitlint/cli git-cliff
Base the repository off of the organization template repository.
git clone https://github.com/kyaulabs/template <REPOSITORY_NAME>
cd <REPOSITORY_NAME>
rm -rf .git
Initialize your new repository.
git init
Add in a LICENSE
of choice, using the filename LICENSE.txt
, LICENSE.md
or LICENSE.rst
. There are two main repositories of licenses to choose from:
- GNU: GNU APGLv3 / GNU GPLv3 / GNU LGPLv3
- General: Apache License 2.0 / MIT License / Mozilla Public License 2.0
- CC: CC BY 4.0 / CC BY-SA 4.0 / CC BY-ND 4.0 / CC BY-NC 4.0 / CC BY-NC-SA 4.0 / CC BY-NC-ND 4.0
Add a .gitignore
template from @github/gitignore (modification required).
Take this time to update the README.md
with at least basic repository information and a hopeful table of contents. It is okay if most sections are blank.
Be sure to modify cliff.toml
and replace all the instances of kyaulabs/template
with the new repository location.
Make sure you add the appropriate actions from the @kyaulabs/template-workflows repository.
Edit the workflow accordingly as all workflows come with only manual activation set with automatic activation commented out.
on:
workflow_dispatch: {}
#on:
# push:
# branches: [ "main", "develop" ]
# workflow_dispatch:
Generate a config for commitlint.
echo "module.exports = { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js
Copy or symlink to the hooks located inside of .github/hooks
.
chmod u+x .github/hook/*
cp .github/hooks/* .git/hooks/
Add all files to the repository. The first command utilizing the dry-run switch to make sure you do not need any last minute additions to .gitignore
.
git add -A -n
git add -A
Push the initial commit with (non-commitlint verified message).
git commit -S -a -m "ignore: here be dragons"
Finally set the main branch name.
git branch -M main
Add the remote origin and push the branch to origin.
git remote add origin [email protected]:kyaulabs/<REPOSITORY_NAME>.git
git push -u origin main
In order to have proper repository security, some settings need to change. Open up the repository settings by clicking on the Settings
tab at the top of the repository.
Upload an image to customize the repositoryโs social media preview.
- Image should be 1280ร640px - Download template
Under the Features
section enable Sponsorships
and then disable anything that is not being using.
Under manage access click on Add people
. In the search box enter and select @kyaulabs-bot
then change the role to Write
.
Create a new branch protection rule by clicking Add branch protection rule
.
- Branch name pattern:
main
- Protect matching branches:
Require a pull request before merging
Require approvals (1)
Require signed commits
Click Create
.
Create another branch protection rule with the following:
- Branch name pattern:
**/**
- Protect matching branches:
Require signed commits
If you would like this repository to output to a channel on Discord you will need to create a webhook on both ends.
In Discord goto the Server Settings > Apps > Integrations
and click New Webhook
. Give it an avatar, name and select a channel for it to output to.
Back on GitHub on the Settings > Webhooks
page, create a new hook by clicking Add webhook
.
- Payload URL: Click on
Copy Webhook URL
in Discord to get this URL. - Content type:
application/json
- Let me select individual events:
Commit comments
Forks
Issues
Page builds
Pull requests
Pushes
Releases
Statuses
Wiki
Click on Add webhook
.
Organization level issue labels work in conjunction with conventional commits. We use a modified version of the TIPS system called TPS or Type, Priority and Status as a way to label issues such that they can be organized and assigned accordingly.
In order to properly label something be sure to include at least one type, a single priority and it's current status. Optional labels may be added at your discretion.
T - Type: Directly corresponds to the conventional commits type.
Group | Label | Color | Description |
---|---|---|---|
Type | feature |
#41d6c3 | ๐ Feature |
Type | patch |
#41d6c3 | ๐ Sub-Feature |
Type | bug |
#ff5050 | ๐ Bug |
Type | documentation |
#c0e6ff | ๐ Documentation |
Type | performance |
#41d6c3 | โก๏ธ Performance |
Type | refactor |
#ffa572 | โป๏ธ Refactor |
Type | style |
#ffa572 | ๐ Styling |
Type | test |
#ffd791 | โ๏ธ Testing |
Type | ci/cd |
#ffd791 | ๐ท CI/CD |
Type | chore |
#ffd791 | ๐ฎ Misc |
Type | security |
#ff5050 | ๐๏ธ Security |
P - Priority: The urgency of the issue/task.
Group | Label | Color | Description |
---|---|---|---|
Priority | critical |
#800000 | Security-related/Project-breaking |
Priority | high |
#c11c00 | Foundational / Important |
Priority | medium |
#f39a4d | Basic / Normal |
Priority | low |
#8cd211 | Additional / Polish |
S - Status: Current progress.
Group | Label | Color | Description |
---|---|---|---|
Status | done |
#0e8a16 | Complete |
Status | in progress |
#fbca04 | Currently Working On |
Status | testing |
#fbca04 | Testing Ideas / Methods |
Status | under construction |
#fbca04 | Beginning Stages |
Optional: Two other groups are included for convinience.
Group | Label | Color | Description |
---|---|---|---|
Feedback | brainstorming |
#db2780 | Coming Up w/ New <Type> |
Feedback | help wanted |
#db2780 | Help Requested on <Type> |
Feedback | research |
#db2780 | <Type> Needs Research |
Feedback | request for comments |
#db2780 | External Opinions Needed on <Type> |
Other | good first issue |
#4e3cb2 | Good Issue for First Time Contributor |
Other | duplicate |
#cfd3d7 | Duplicate <Type> |
Other | invalid |
#cfd3d7 | Invalid <Type> |
Other | on hold |
#cfd3d7 | Currently On Hold |
Other | won't fix |
#cfd3d7 | This Will Not Be Fixed |
In order to abide by the conventional commit guidelines and in return get auto-generated changelogs, use the following.
<type>[optional scope]: <subject>
[optional body]
[optional footer(s)]
[required] (!empty) value = {
'build',
'chore',
'ci',
'docs',
'feat', # this correlates with MINOR in Semantic Versioning
'fix', # this correlates with PATCH in Semantic Versioning
'patch', # this correlates with PATCH in Semantic Versioning
'perf',
'refactor',
'revert',
'style',
'test',
'ignore' # this correlates with CHANGELOG ignores
}
A trailing ! indicates a BREAKING CHANGE (correlating with MAJOR in Semantic Versioning).
[optional] {lowercase | camelCase}
A noun describing a section of the codebase surrounded by parenthesis.
[required] (!empty) {lowercase | camelCase} (max-length: 100)
A short summary of the code changes, without a trailing full-stop.
Adding [skip ci] will skip all push and pull_request workflows.
[optional] {freeform} (max-length: 100)
Longer commit body with additional contextual information about the code changes.
<token>: <value>
[optional] (max-length: 100)
token (Sentance-case) = {
'BREAKING CHANGE', # Exception to the rule
'Acked-by',
'Cc',
'Fixes',
'Helped-by',
'Refs',
'Reviewed-by',
'Signed-off-by',
}
Any number of tokens may be included.
The following are all examples of valid commit messages.
The commit message will also go through validation with commitlint
upon issuing git commit
.
feat(player): begin new implementation of input controller
As per #123 recommendation input contoller is now based on blah.
Basic movement added.
Acked-by: Alice <[email protected]>
Signed-off-by: Bob <[email protected]>
Refs: #123
Refs: 676104e, a215868
fix: array parsing issue
Fixes: #42
Cc: Z
Reviewed-by: Z
Signed-off-by: Z
chore(release): v0.0.1 [skip ci]
Once you have published at least one proper commit using conventional commits syntax you will be able to generate a changelog.
git cliff --tag 0.0.1
After the initial run of git-cliff all subsequent runs should detect the version automatically.
git cliff
A typical workflow should look like the following.
git add -A # add all un-indexed and changed files to the commit
git commit -S -a -m "<message>" # add a conventional commit message and sign the commit
git cliff # generate a new changelog
git add CHANGELOG.md # add the changelog file to the commit
git commit --amend --no-edit # ammend the added file to the previous un-pushed commit
git push -u origin develop # finally, push the commit
Visit the repository page and navigate to Actions
. Manually run the Unity Activation ๐
action and then download the artifact.
Extract the zip file somewhere accessible.
Visit license.unity3d.com and upload the Unity_v20XX.X.XXXX.alf
file, receiving a license file Unity_v20XX.X.ulf
in return.
Navigate on Github to Settings > Secrets and variables > Actions
.
Create the following repository secrets:
UNITY_LICENSE
- (Copy the contents of your license file into here)UNITY_EMAIL
- (Add the email address that you use to login to Unity)UNITY_PASSWORD
- (Add the password that you use to login to Unity)