Skip to content

Commit

Permalink
chore: re-enable SDK team check on game bridge build (#1964)
Browse files Browse the repository at this point in the history
  • Loading branch information
CodeSchwert authored Jul 19, 2024
1 parent 1d1dea2 commit 1914698
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 23 deletions.
23 changes: 11 additions & 12 deletions .github/workflows/build-game-bridge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,16 @@ jobs:
ref: "${{ env.TS_SDK_TAG }}"
fetch-depth: 0

# uncomment when the script it merged and tagged
# - name: Check SDK Team Membership
# id: check_team
# run: |
# ./.github/scripts/check-team-membership.sh "${{ github.actor }}" "${{ env.GH_TOKEN }}"
# source "$GITHUB_ENV"
# echo "${{ github.actor }} is a member of the SDK team: $IS_MEMBER"
# if [[ "$IS_MEMBER" != "true" ]]; then
# echo "Not a member of the SDK team, exiting workflow"
# exit 1
# fi
- name: Check SDK Team Membership
id: allowed_actors_check
# only allow SDK team members to run this workflow
# ["ckailash", "CodeSchwert", "wdinau", "shineli1984", "nattb8", "YermekG", "zaidarain1"]
if: ${{ contains(fromJson(env.SDK_TEAM_MEMBERS), github.triggering_actor) }}
run: echo "ALLOWED_ACTOR=true" >> $GITHUB_OUTPUT

- name: Allowed Actors Filter
if: ${{ steps.allowed_actors_check.outputs.ALLOWED_ACTOR != 'true' }}
run: exit 1

- name: Use Node.js
uses: actions/setup-node@v4
Expand Down Expand Up @@ -97,7 +96,7 @@ jobs:
create-unity-pr:
name: Create Unity PR
needs: build-game-bridge
# if: ${{ github.event.inputs.game_engine == 'Unity' || github.event.inputs.game_engine == 'Both' }}
if: ${{ github.event.inputs.game_engine == 'Unity' || github.event.inputs.game_engine == 'Both' }}
runs-on: ubuntu-latest-4-cores
steps:
- name: Checkout SDK Repository
Expand Down
22 changes: 11 additions & 11 deletions packages/game-bridge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Note: The above build will bundle the index files in the following locations (re
- Unity: `./dist/unity/index.html`
- Unreal: `./dist/unreal/index.js`, `./dist/unreal/index.js.map`

#### Building for Production / Release
### Building for Production / Release

During the build step for game-gridge, placeholder SDK version strings are replaced with the actual SDK version strings. To ensure the correct version strings are packaged, as opposed to the local commit hash, which could be different than the latest release tag, the following process should be followed:

Expand All @@ -33,20 +33,20 @@ During the build step for game-gridge, placeholder SDK version strings are repla
3. Release new version of the SDK (using the `Publish to NPM` workflow)
- This creates a new GitHub tag / release

4. Fetch tags and pull latest changes locally after release workflow completes:
- `git pull origin main`
- `git fetch --tags`
4. Once the new version of the TS SDK has been released, use the [Build Game Bridge](https://github.com/immutable/ts-immutable-sdk/actions/workflows/build-game-bridge.yaml) workflow to build the game bridge with the latest version of the SDK and create a PR in the Game SDK repos.
- Use the `Run workflow` button on the workflow page to trigger the workflow
- In the `TS SDK version tag` input field, enter the latest tag that was released
- Currently the workflow only supports building the game bridge for Unity, so the Unreal SDK will need to be built manually

5. Switch to the latest tag that was released:
- `git checkout tags/<tag-name>`
5. When the workflow completes, you should see the PR here: https://github.com/immutable/unity-immutable-sdk/pulls
- The workflow also saves the build artifacts which you can download from the workflow run page and manually copy them too.
- Running the workflow with `Dry run` set to `true` will not create a PR, but will still save the build artifacts

6. Manually build game bridge with steps above

7. Copy the built files to the correct location in the Game SDKs
6. Approve and merge the PR in the Game SDK repo

Game bridge should now have the correct latest version when packaged into the Game SDKs.

Linting:
### Linting:

```bash
yarn lint
Expand All @@ -58,4 +58,4 @@ The Game Bridge package enables interaction between the Typescript SDK and Unity

[Read more about how the game-bridge works here](https://immutable.atlassian.net/wiki/spaces/GSK/pages/2307129395/Game+SDK+Overview)

[Read more about the game-bridge package here](../../README.md#game-bridge)
[Read more about the game-bridge package here](../../README.md#game-bridge)

0 comments on commit 1914698

Please sign in to comment.