Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit be2d230

Browse files
Merge pull request #874 from github-for-unity/add-dev-oauth-key
Add oauth key for development purposes
2 parents f0f12c6 + 631bf30 commit be2d230

File tree

5 files changed

+196
-160
lines changed

5 files changed

+196
-160
lines changed

README.md

Lines changed: 6 additions & 153 deletions
Original file line numberDiff line numberDiff line change
@@ -7,173 +7,26 @@ You can reach the team right here by opening a [new issue](https://github.com/gi
77
[![Build Status](https://ci.appveyor.com/api/projects/status/github/github-for-unity/Unity?branch=master&svg=true)](https://ci.appveyor.com/project/github-windows/unity)
88

99
[![Join the chat at https://discord.gg/5zH8hVx](https://img.shields.io/badge/discord-join%20chat-7289DA.svg)](https://discord.gg/5zH8hVx)
10-
[![GitHub for Unity live coding on Twitch](https://img.shields.io/badge/twitch-live%20coding-6441A4.svg)](https://www.twitch.tv/sh4na)
11-
1210

1311
## Notices
1412

1513
Please refer to the [list of known issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aissue+is%3Aopen+label%3Abug), and make sure you have backups of your work before trying it out.
1614

1715
From version 0.19 onwards, the location of the plugin has moved to `Assets/Plugins/GitHub`. If you have version 0.18 or lower, you need to delete the `Assets/Editor/GitHub` folder before you install newer versions. You should exit Unity and delete the folder from Explorer/Finder, as Unity will not unload native libraries while it's running. Also, remember to update your `.gitignore` file.
1816

19-
#### Table Of Contents
20-
21-
[Installing GitHub for Unity](#installing-github-for-unity)
22-
* [Requirements](#requirements)
23-
* [Git on macOS](#git-on-macos)
24-
* [Git on Windows](#git-on-windows)
25-
* [Installation](#installation)
26-
* [Log files](#log-files)
27-
* [Windows](#windows)
28-
* [macOS](#macos)
29-
30-
[Building and Contributing](#building-and-contributing)
31-
32-
[Quick Guide to GitHub for Unity](#quick-guide-to-github-for-unity)
33-
* [Opening the GitHub window](#opening-the-github-window)
34-
* [Initialize Repository](#initialize-repository)
35-
* [Authentication](#authentication)
36-
* [Publish a new repository](#publish-a-new-repository)
37-
* [Commiting your work - Changes tab](#commiting-your-work---changes-tab)
38-
* [Pushing/pulling your work - History tab](#pushingpulling-your-work---history-tab)
39-
* [Branches tab](#branches-tab)
40-
* [Settings tab](#settings-tab)
41-
42-
[More Resources](#more-resources)
43-
44-
[License](#license)
45-
46-
## Installing GitHub for Unity
47-
48-
### Requirements
49-
50-
- Unity 5.4 or higher
51-
- There's currently an blocker issue opened for 5.3 support, so we know it doesn't run there. Personal edition is fine.
52-
- Git and Git LFS 2.x
53-
54-
#### Git on macOS
55-
56-
The current release has limited macOS support. macOS users will need to install the latest [Git](https://git-scm.com/downloads) and [Git LFS](https://git-lfs.github.com/) manually, and make sure these are on the path. You can configure the Git location in the Settings tab on the GitHub window.
57-
58-
The easiest way of installing git and git lfs is to install [Homebrew](https://brew.sh/) and then do `brew install git git-lfs`.
59-
60-
Make sure a Git user and email address are set in the `~/.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `~/.gitconfig` file and adding the following section, if it doesn't exist yet:
61-
62-
```
63-
[user]
64-
name = Your Name
65-
email = Your Email
66-
```
67-
68-
#### Git on Windows
69-
70-
The GitHub for Unity extension ships with a bundle of Git and Git LFS, to ensure that you have the correct version. These will be installed into `%LOCALAPPDATA%\GitHubUnity` when the extension runs for the first time.
71-
72-
Make sure a Git user and email address are set in the `%HOME%\.gitconfig` file before you initialize a repository for the first time. You can set these values by opening your `%HOME%\.gitconfig` file and adding the following section, if it doesn't exist yet:
73-
74-
```
75-
[user]
76-
name = Your Name
77-
email = Your Email
78-
```
79-
80-
Once the extension is installed, you can open a command line with the same Git and Git LFS version that the extension uses by going to `Window` -> `GitHub Command Line` in Unity.
81-
82-
### Installation
83-
84-
This extensions needs to be installed (and updated) for each Unity project that you want to version control.
85-
First step is to download the latest package from [the releases page](https://github.com/github-for-unity/Unity/releases);
86-
it will be saved as a file with the extension `.unitypackage`.
87-
To install it, open Unity, then open the project you want to version control, and then double click on the downloaded package.
88-
Alternatively, import the package by clicking Assets, Import Package, Custom Package, then select the downloaded package.
89-
90-
#### Log files
91-
92-
##### macOS
93-
94-
The extension log file can be found at `~/Library/Logs/GitHubUnity/github-unity.log`
95-
96-
##### Windows
97-
98-
The extension log file can be found at `%LOCALAPPDATA%\GitHubUnity\github-unity.log`
99-
10017
## Building and Contributing
10118

102-
The [CONTRIBUTING.md](CONTRIBUTING.md) document will help you get setup and familiar with the source. The [documentation](docs/) folder also contains more resources relevant to the project.
103-
10419
Please read the [How to Build](docs/contributing/how-to-build.md) document for information on how to build GitHub for Unity.
10520

106-
If you're looking for something to work on, check out the [up-for-grabs](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) label.
107-
108-
109-
## I have a problem with GitHub for Unity
110-
111-
First, please search the [open issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen)
112-
and [closed issues](https://github.com/github-for-unity/Unity/issues?q=is%3Aclosed)
113-
to see if your issue hasn't already been reported (it may also be fixed).
114-
115-
If you can't find an issue that matches what you're seeing, open a [new issue](https://github.com/github-for-unity/Unity/issues/new)
116-
and fill out the template to provide us with enough information to investigate
117-
further.
118-
119-
## Quick Guide to GitHub for Unity
120-
121-
### Opening the GitHub window
122-
123-
You can access the GitHub window by going to Windows -> GitHub. The window opens by default next to the Inspector window.
124-
125-
### Initialize Repository
126-
127-
![Initialize repository screenshot](https://user-images.githubusercontent.com/10103121/37807041-bb4446a6-2e19-11e8-9fff-a431309b8515.png)
128-
129-
If the current Unity project is not in a Git repository, the GitHub for Unity extension will offer to initialize the repository for you. This will:
130-
131-
- Initialize a git repository at the Unity project root via `git init`
132-
- Initialize git-lfs via `git lfs install`
133-
- Set up a `.gitignore` file at the Unity project root.
134-
- Set up a `.gitattributes` file at the Unity project root with a large list of known binary filetypes (images, audio, etc) that should be tracked by LFS
135-
- Configure the project to serialize meta files as text
136-
- Create an initial commit with the `.gitignore` and `.gitattributes` file.
137-
138-
### Authentication
139-
140-
To set up credentials in Git so you can push and pull, you can sign in to GitHub by going to `Window` -> `GitHub` -> `Account` -> `Sign in`. You only have to sign in successfully once, your credentials will remain on the system for all Git operations in Unity and outside of it. If you've already signed in once but the Account dropdown still says `Sign in`, ignore it, it's a bug.
141-
142-
![Authentication screenshot](https://user-images.githubusercontent.com/121322/27644895-8f22f904-5bd9-11e7-8a93-e6bfe0c24a74.png)
143-
144-
### Publish a new repository
145-
146-
1. Go to [github.com](https://github.com) and create a new empty repository - do not add a license, readme or other files during the creation process.
147-
2. Copy the **https** URL shown in the creation page
148-
3. In Unity, go to `Windows` -> `GitHub` -> `Settings` and paste the url into the `Remote` textbox.
149-
3. Click `Save repository`.
150-
4. Go to the `History` tab and click `Push`.
151-
152-
### Commiting your work - Changes tab
153-
154-
You can see which files have been changed and commit them through the Changes tab. `.meta` files will show up in relation to their files on the tree, so you can select a file for comitting and automatically have their `.meta`
155-
156-
![Changes tab screenshot](https://user-images.githubusercontent.com/121322/27644933-ab00af72-5bd9-11e7-84c3-edec495f87f5.png)
157-
158-
### Pushing/pulling your work - History tab
159-
160-
The history tab includes a `Push` button to push your work to the server. Make sure you have a remote url configured in the `Settings` tab so that you can push and pull your work.
161-
162-
To receive updates from the server by clicking on the `Pull` button. You cannot pull if you have local changes, so commit your changes before pulling.
163-
164-
![History tab screenshot](https://user-images.githubusercontent.com/121322/27644965-c1109bba-5bd9-11e7-9257-4fa38f5c67d1.png)
165-
166-
### Branches tab
167-
168-
![Branches tab screenshot](https://user-images.githubusercontent.com/121322/27644978-cd3c5622-5bd9-11e7-9dcb-6ae5d5c7dc8a.png)
21+
The [CONTRIBUTING.md](CONTRIBUTING.md) document will help you get setup and familiar with the source. The [documentation](docs/) folder also contains more resources relevant to the project.
16922

170-
### Settings tab
23+
If you're looking for something to work on, check out the [up-for-grabs](https://github.com/github-for-unity/Unity/issues?q=is%3Aopen+is%3Aissue+label%3Aup-for-grabs) label.
17124

172-
You can configure your user data in the Settings tab, along with the path to the Git installation.
25+
## How to use
17326

174-
Locked files will appear in a list in the Settings tab. You can see who has locked a file and release file locks after you've pushed your work.
27+
The [quick guide to GitHub for Unity](docs/using/quick-guide.md)
17528

176-
![Settings tab screenshot](https://user-images.githubusercontent.com/121322/27644993-d9d325a0-5bd9-11e7-86f5-beee00e9e8b8.png)
29+
More [in-depth information](docs/readme.md)
17730

17831
## More Resources
17932

@@ -188,6 +41,6 @@ The MIT license grant is not for GitHub's trademarks, which include the logo
18841
designs. GitHub reserves all trademark and copyright rights in and to all
18942
GitHub trademarks. GitHub's logos include, for instance, the stylized
19043
Invertocat designs that include "logo" in the file title in the following
191-
folder: [IconsAndLogos](https://github.com/github-for-unity/Unity/tree/master/src/UnityExtension/Assets/Editor/GitHub.Unity/IconsAndLogos).
44+
folder: [IconsAndLogos](src/UnityExtension/Assets/Editor/GitHub.Unity/IconsAndLogos).
19245

19346
Copyright 2015 - 2018 GitHub, Inc.

docs/contributing/how-to-build.md

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ This repository is LFS-enabled. To clone it, you should use a git client that su
1313

1414
### MacOS
1515

16-
- Mono 4.x required.
16+
- Mono 4.x required. You can install it via brew with `brew tap shana/mono && brew install mono@4.8`
1717
- Mono 5.x will not work
1818
- `UnityEngine.dll` and `UnityEditor.dll`.
1919
- If you've installed Unity in the default location of `/Applications/Unity`, the build will be able to reference these DLLs automatically. Otherwise, you'll need to copy these DLLs from `[Unity installation path]/Unity.app/Contents/Managed` into the `lib` directory in order for the build to work
@@ -35,12 +35,25 @@ git submodule deinit script
3535

3636
### Important pre-build steps
3737

38-
To be able to authenticate in GitHub for Unity, you'll need to:
38+
The build needs to reference `UnityEngine.dll` and `UnityEditor.dll`. These DLLs are included with Unity. If you've installed Unity in the default location, the build will be able to find them automatically. If not, copy these DLLs from `[your Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work.
39+
40+
#### Developer OAuth app
41+
42+
Because GitHub for Unity uses OAuth web application flow to interact with the GitHub API and perform actions on behalf of a user, it needs to be bundled with a Client ID and Secret.
43+
44+
For external contributors, we have bundled a developer OAuth application in the source so that you can complete the sign in flow locally without needing to configure your own application.
45+
46+
These are listed in `src/GitHub.Api/Application/ApplicationInfo.cs`
47+
48+
DO NOT TRUST THIS CLIENT ID AND SECRET! THIS IS ONLY FOR TESTING PURPOSES!!
49+
50+
The limitation with this developer application is that this will not work with GitHub Enterprise. You will see sign-in will fail on the OAuth callback due to the credentials not being present there.
51+
52+
To provide your own Client ID and Client Secret:
3953

4054
- [Register a new developer application](https://github.com/settings/developers) in your profile.
4155
- Copy [common/ApplicationInfo_Local.cs-example](../../common/ApplicationInfo_Local.cs-example) to `common/ApplicationInfo_Local.cs` and fill out the clientId/clientSecret fields for your application.
4256

43-
The build needs to reference `UnityEngine.dll` and `UnityEditor.dll`. These DLLs are included with Unity. If you've installed Unity in the default location, the build will be able to find them automatically. If not, copy these DLLs from `[your Unity installation path]\Unity\Editor\Data\Managed` into the `lib` directory in order for the build to work.
4457

4558
### Visual Studio
4659

@@ -56,13 +69,12 @@ Once you've built the solution for the first time, you can open `src/UnityExtens
5669

5770
The build also creates a Unity test project called `GitHubExtension` inside a directory called `github-unity-test` next to your local clone. For instance, if the repository is located at `c:\Projects\Unity` the test project will be at `c:\Projects\github-unity-test\GitHubExtension`. You can use this project to test binary builds of the extension in a clean environment (all needed DLLs will be copied to it every time you build).
5871

59-
Note: some files might be locked by Unity if have one of the build output projects open when you compile from VS or the command line. This is expected and shouldn't cause issues with your builds.
72+
Note: some files might be locked by Unity if have one of the build output projects open when you compile from VS or the command line. This is expected and shouldn't cause issues with your builds.
6073

6174
## Solution organization
6275

6376
The `GitHub.Unity.sln` solution includes several projects:
6477

65-
- dotnet-httpclient35 and octokit: external dependencies for threading and github api support, respectively. These are the submodules.
6678
- packaging: empty projects with build rules that copy DLLs to various locations for testing
6779
- Tests: unit and integration test projects
6880
- GitHub.Logging: A logging helper library

docs/readme.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Details about how the team is organizing and shipping GitHub for Unity:
3030

3131
## Using
3232

33+
[Quick Guide](using/quick-guide.md)
34+
3335
These documents contain more details on how to use the GitHub for Unity plugin:
34-
- **[Installing and Updating the GitHub for Unity package](https://github.com/github-for-unity/Unity/blob/master/docs/using/how-to-install-and-update.md)**
35-
- **[Getting Started with the GitHub for Unity package](https://github.com/github-for-unity/Unity/blob/master/docs/using/getting-started.md)**
36+
- **[Installing and Updating the GitHub for Unity package](using/how-to-install-and-update.md)**
37+
- **[Getting Started with the GitHub for Unity package](using/getting-started.md)**

0 commit comments

Comments
 (0)