Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: introduce v3 #407

Merged
merged 13 commits into from
Aug 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18
- uses: c-hive/gha-yarn-cache@v2
- run: yarn
- run: yarn verify:formatting
Expand All @@ -23,7 +23,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18
- uses: c-hive/gha-yarn-cache@v2
- run: yarn
- run: yarn verify:code-styles
Expand All @@ -34,7 +34,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18
- uses: c-hive/gha-yarn-cache@v2
- run: yarn
- run: yarn typecheck
Expand All @@ -45,7 +45,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: '16'
node-version: 18
- uses: c-hive/gha-yarn-cache@v2
- run: yarn
- run: yarn test --coverage
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/search-trigger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ jobs:
name: Update search index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- uses: darrenjennings/algolia-docsearch-action@da2ed379c147b356d60dbfec68bdcfacb2791a98
with:
algolia_application_id: 'E57FOT37U9'
Expand Down
1 change: 1 addition & 0 deletions .idea/prettier.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="PrettierConfiguration">
<option name="myConfigurationMode" value="AUTOMATIC" />
<option name="myRunOnSave" value="true" />
<option name="myRunOnReformat" value="true" />
</component>
Expand Down
10 changes: 5 additions & 5 deletions docs/03-github/01-getting-started.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ jobs:

# Build
- name: Build project
uses: game-ci/unity-builder@v2
uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand Down Expand Up @@ -168,7 +168,7 @@ jobs:

# Build
- name: Build project
uses: game-ci/unity-builder@v2
uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand Down Expand Up @@ -248,7 +248,7 @@ jobs:
path: ${{ steps.testRunner.outputs.artifactsPath }}
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/free-disk-space@v1.2.0
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand Down Expand Up @@ -295,7 +295,7 @@ jobs:
Library-${{ matrix.projectPath }}-${{ matrix.targetPlatform }}-
Library-${{ matrix.projectPath }}-
Library-
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand Down Expand Up @@ -341,7 +341,7 @@ jobs:
Library-${{ matrix.projectPath }}-
Library-

- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand Down
2 changes: 1 addition & 1 deletion docs/03-github/02-activation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ floating license will be acquired before the build, and returned after.
Example of use:

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
targetPlatform: WebGL
unityLicensingServer: [url to your license server]
Expand Down
69 changes: 31 additions & 38 deletions docs/03-github/04-builder.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ secret.
Then, define the build step as follows:

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
Expand All @@ -60,7 +60,7 @@ Make sure you have set up these variables in the activation step:
Then, define the build step as follows:

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
Expand All @@ -77,7 +77,7 @@ If you host your own Unity license server internally you can provide its url usi
Example of use:

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
targetPlatform: WebGL
unityLicensingServer: [url to your license server]
Expand Down Expand Up @@ -152,7 +152,7 @@ _**required:** `false`_ _**default:** `auto`_
Specific docker image that should be used for building the project.

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
customImage: 'unityci/editor:2020.1.14f1-base-0'
```
Expand Down Expand Up @@ -192,7 +192,7 @@ There are two conditions for a custom buildMethod:
Example:

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
buildMethod: EditorNamespace.BuilderClassName.StaticBuildMethod
```
Expand All @@ -202,7 +202,7 @@ To get started with a modified version of the default Unity Builder build script
`Assets/Editor/UnityBuilderAction` directory and reference it:

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
buildMethod: UnityBuilderAction.BuildScript.Build
```
Expand All @@ -220,7 +220,7 @@ Parameters must start with a hyphen (`-`) and may be followed by a value (withou
Parameters without a value will be considered booleans (with a value of true).

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
customParameters: -profile SomeProfile -someBoolean -someValue exampleValue
```
Expand All @@ -238,7 +238,7 @@ _**required:** `false`_ _**default:** `""`_
Configure a specific versioning strategy

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
versioning: Semantic
```
Expand Down Expand Up @@ -298,7 +298,7 @@ Set this flag to `androidPackage` to build an apk, `androidAppBundle` for an aab
`androidStudioProject` to build an Android Studio Project.

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
androidExportType: 'androidAppBundle'
androidKeystoreName: user.keystore
Expand All @@ -308,33 +308,12 @@ Set this flag to `androidPackage` to build an apk, `androidAppBundle` for an aab
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
```

You should also set all the Android Keystore options (see below). Refer to (this
section)[/docs/github/deployment/android#3-generate-an-upload-key-and-keystore] for keystore setup.
You should also set all the Android Keystore options (see below). Refer to
[this section](/docs/github/deployment/android#3-generate-an-upload-key-and-keystore) for keystore
setup.

_**required:** `false`_ _**default:** `androidPackage`_

#### androidAppBundle

**[Deprecated] Please use androidExportType instead.**

Set this flag to `true` to build '.aab' instead of '.apk'.

```yaml
- uses: game-ci/unity-builder@v2
with:
androidAppBundle: true
androidKeystoreName: user.keystore
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASS }}
androidKeyaliasName: ${{ secrets.ANDROID_KEYALIAS_NAME }}
androidKeyaliasPass: ${{ secrets.ANDROID_KEYALIAS_PASS }}
```

You should also set all the Android Keystore options (see below). Refer to (this
section)[/docs/github/deployment/android#3-generate-an-upload-key-and-keystore] for keystore setup.

_**required:** `false`_ _**default:** `false`_

#### androidKeystoreName

Configure the android `keystoreName`. Must be provided if configuring the below keystore options.
Expand Down Expand Up @@ -417,7 +396,7 @@ _**required:** `false`_ _**default:** `""`_
Allows the branch of the build to be dirty, and still generate the build.

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
allowDirtyBuild: true
```
Expand Down Expand Up @@ -447,6 +426,20 @@ ie `3.4.0`. An empty string represents the latest available version on homebrew.

_**required:** `false`_ _**default:** `""`_

#### dockerWorkspacePath

Allows customizing the build path within the container in case there are hardcoded paths generated
during the build. For example building an IOS XCode project on Linux and moving to a new path on
MacOS occasionally leads to broken paths requiring this override to ensure the paths match.

Paths should be of format `/path/to/build`, ie `/tmp/build`. On Windows, leave off the drive letter
specification. For example `C:\build` becomes `/build`. There should be no trailing slash in the
path and the path should be absolute. The path will automatically be created within the container if
it does not exist. It is recommended to use a path that doesn't already exist within the container
to avoid any conflicts.

_**required:** `false`_ _**default:** `"/github/workspace"`_

## Outputs

Below are outputs that can be accessed by using `${{ steps.myBuildStep.outputs.outputName }}`, where
Expand All @@ -458,7 +451,7 @@ Returns the version that was generated by Builder, following the strategy config
`versioning`.

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
id: myBuildStep
- run: echo 'Project Version: ${{ steps.myBuildStep.outputs.buildVersion }}'
```
Expand All @@ -468,7 +461,7 @@ Returns the version that was generated by Builder, following the strategy config
Returns the version code that was generated by Builder for Android builds.

```yaml
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
id: myBuildStep
- run: echo 'Android Version Code: ${{ steps.myBuildStep.outputs.androidVersionCode }}'
```
Expand Down Expand Up @@ -507,7 +500,7 @@ steps:
- uses: webfactory/ssh-agent@v0.8.0
with:
ssh-private-key: ${{ secrets.SSH_PRIVATE_KEY }}
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
sshAgent: ${{ env.SSH_AUTH_SOCK }}
```
Expand Down Expand Up @@ -565,7 +558,7 @@ jobs:
restore-keys: Library-
- if: matrix.targetPlatform == 'Android'
uses: jlumbroso/free-disk-space@v1.2.0
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
with:
Expand Down
2 changes: 1 addition & 1 deletion docs/03-github/06-deployment/android.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ jobs:
with:
path: Library
key: Library-Android
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
targetPlatform: Android
androidAppBundle: true
Expand Down
2 changes: 1 addition & 1 deletion docs/03-github/06-deployment/ios.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ jobs:
path: Library
key: Library-iOS

- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
with:
targetPlatform: iOS

Expand Down
2 changes: 1 addition & 1 deletion docs/03-github/06-deployment/steam.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
restore-keys: |
Library-${{ matrix.targetPlatform }}-
Library-
- uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v3
id: build
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
Expand Down
18 changes: 9 additions & 9 deletions docs/09-troubleshooting/common-issues.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,11 @@ here][unity-docker-versions].

In this particular case, it is also important to look for the last part of the docker image which is
the version for GameCI. `-0` means it is the latest `v0.x.x` version of the docker images. `v0.x.x`
version is out of date as we moved to Version 1 as shown on
and `v1.x.x` are out of date as we moved to Version 2 as shown on
[github.com/game-ci/docker/releases](https://github.com/game-ci/docker/releases). We are not
publishing images for `v0.x.x` anymore.
publishing images for `v0.x.x` or `v1.x.x` anymore.

The correct image should be `unityci/editor:2021.3.0f1-android-1`.
The correct image should be `unityci/editor:2021.3.0f1-android-2`.

You can also test this locally:

Expand All @@ -106,24 +106,24 @@ docker pull unityci/editor:2021.3.0f1-android-0
# Error response from daemon: manifest for unityci/editor:2021.3.0f1-android-0 not found: manifest unknown: manifest unknown

# right
docker pull unityci/editor:2021.3.0f1-android-1
# 2021.3.0f1-android-1: Pulling from unityci/editor
docker pull unityci/editor:2021.3.0f1-android-2
# 2021.3.0f1-android-2: Pulling from unityci/editor
# [...]
```

#### Github Actions

You need to make sure you are using Github Actions v2, check for the version of your actions in your
You need to make sure you are using Github Actions v3, check for the version of your actions in your
`.github/workflows/*.yml` files.

```diff
- uses: game-ci/unity-builder@v1
+ uses: game-ci/unity-builder@v2
- uses: game-ci/unity-builder@v2
+ uses: game-ci/unity-builder@v3
```

#### Gitlab CI

Set the `IMAGE_VERSION` to 1 in
Set the `IMAGE_VERSION` to 2 in
[`.gitlab-ci.yml`](https://gitlab.com/game-ci/unity3d-gitlab-ci-example/-/blob/main/.gitlab-ci.yml#L12)

### Scripts have compiler errors.
Expand Down
5 changes: 4 additions & 1 deletion docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ const config = {
lastVersion: 'current',
versions: {
current: {
label: 'v2 (current)',
label: 'v3 (current)',
},
2: {
label: 'v2',
},
1: {
label: 'v1',
Expand Down
7 changes: 4 additions & 3 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ pre-commit:
format code:
glob: '*.{js,jsx,ts,tsx}'
exclude: '.docusaurus/|build/'
run:
yarn prettier --write {staged_files} && yarn eslint --stdin-filename {staged_files} && git
add {staged_files}
run: |
yarn prettier --write {staged_files}
yarn eslint --stdin-filename {staged_files}
git add {staged_files}
type check:
glob: '*.{ts,tsx,scss}'
exclude: '.docusaurus/|build/'
Expand Down
Loading
Loading