Skip to content

Commit 35ef93e

Browse files
nattb8claude
andcommitted
chore: add audience release workflow support, remove marketplace
- update-version.yml: add `package` choice (passport/audience), remove Marketplace, gate Passport-only steps behind package selection - tag.yml: handle audience-release label, create audience/vX.Y.Z tags - release.yml: skip TS SDK version check for Audience releases - Audience package.json left at 0.1.0 so the workflow can be tested Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent d2f4f0b commit 35ef93e

4 files changed

Lines changed: 116 additions & 58 deletions

File tree

.github/scripts/check_team_membership.sh

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@ set -x
44

55
USER=$1
66

7-
response=$(gh api \
8-
-H "Accept: application/vnd.github+json" \
9-
-H "X-GitHub-Api-Version: 2022-11-28" \
10-
"/orgs/immutable/teams/passport/memberships/${USER}")
11-
12-
echo "$response"
13-
14-
if echo "$response" | grep -q '"state":"active"'; then
15-
IS_MEMBER=true
16-
else
17-
IS_MEMBER=false
18-
fi
7+
TEAMS=(
8+
"ped-stream-sdk-integrations-list"
9+
"ped-stream-blockchain-services-list"
10+
)
11+
12+
IS_MEMBER=false
13+
14+
for TEAM in "${TEAMS[@]}"; do
15+
response=$(gh api \
16+
-H "Accept: application/vnd.github+json" \
17+
-H "X-GitHub-Api-Version: 2022-11-28" \
18+
"/orgs/immutable/teams/${TEAM}/memberships/${USER}")
19+
20+
echo "$response"
21+
22+
if echo "$response" | grep -q '"state":"active"'; then
23+
IS_MEMBER=true
24+
break
25+
fi
26+
done
27+
1928
echo "$IS_MEMBER"
2029

2130
# Set the environment variable for the GitHub workflow

.github/workflows/release.yml

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,18 @@ jobs:
2222
- name: Get the latest tag
2323
run: |
2424
git fetch --tags
25-
LATEST_TAG="$(git describe --tags "$(git rev-list --tags --max-count=1)")"
25+
LATEST_TAG="$(git tag --sort=-creatordate | head -n 1)"
2626
echo "LATEST_TAG=${LATEST_TAG}" >> "$GITHUB_ENV"
27+
if [[ "$LATEST_TAG" == audience/* ]]; then
28+
echo "IS_AUDIENCE=true" >> "$GITHUB_ENV"
29+
else
30+
echo "IS_AUDIENCE=false" >> "$GITHUB_ENV"
31+
fi
32+
if [[ "$LATEST_TAG" == *alpha* ]]; then
33+
echo "IS_PRERELEASE=true" >> "$GITHUB_ENV"
34+
else
35+
echo "IS_PRERELEASE=false" >> "$GITHUB_ENV"
36+
fi
2737
2838
- name: Pull LFS
2939
run: git lfs pull
@@ -62,6 +72,7 @@ jobs:
6272
}
6373
6474
- name: Extract TS SDK version from index.html
75+
if: env.IS_AUDIENCE != 'true'
6576
id: extract_ts_sdk_version
6677
run: |
6778
version=$(grep -oP '"x-sdk-version":"ts-immutable-sdk-\K[0-9]+\.[0-9]+\.[0-9]+' ./src/Packages/Passport/Runtime/Resources/index.html | head -n 1)
@@ -73,7 +84,15 @@ jobs:
7384
7485
version=$(echo "$version" | tr -d '\r\n')
7586
76-
echo "VERSION=${version}" >> "$GITHUB_ENV"
87+
echo "TS_SDK_VERSION=${version}" >> "$GITHUB_ENV"
88+
89+
- name: Build release body suffix
90+
run: |
91+
if [[ "$IS_AUDIENCE" != "true" && -n "$TS_SDK_VERSION" ]]; then
92+
echo "RELEASE_BODY_SUFFIX=Game bridge built from Immutable Typescript SDK version $TS_SDK_VERSION" >> "$GITHUB_ENV"
93+
else
94+
echo "RELEASE_BODY_SUFFIX=" >> "$GITHUB_ENV"
95+
fi
7796
7897
- name: Create Release
7998
id: create_release
@@ -86,6 +105,6 @@ jobs:
86105
body: |
87106
${{steps.github_release.outputs.changelog}}
88107
89-
Game bridge built from Immutable Typescript SDK version ${{ env.VERSION }}
108+
${{ env.RELEASE_BODY_SUFFIX }}
90109
draft: false
91-
prerelease: false
110+
prerelease: ${{ env.IS_PRERELEASE }}

.github/workflows/tag.yml

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
create-tag:
10-
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'release')
10+
if: github.event.pull_request.merged == true && (contains(github.event.pull_request.labels.*.name, 'passport-release') || contains(github.event.pull_request.labels.*.name, 'audience-release'))
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -22,13 +22,20 @@ jobs:
2222
- name: Install jq
2323
run: sudo apt-get install -y jq
2424

25-
- name: Extract version from package.json
25+
- name: Extract version and set tag
2626
id: extract_version
2727
run: |
28-
VERSION=$(jq -r .version ./src/Packages/Passport/package.json)
29-
echo "VERSION=$VERSION" >> "$GITHUB_ENV"
28+
IS_AUDIENCE="${{ contains(github.event.pull_request.labels.*.name, 'audience-release') }}"
29+
if [[ "$IS_AUDIENCE" == "true" ]]; then
30+
VERSION=$(jq -r .version ./src/Packages/Audience/package.json)
31+
echo "TAG=audience/v$VERSION" >> "$GITHUB_ENV"
32+
else
33+
VERSION=$(jq -r .version ./src/Packages/Passport/package.json)
34+
echo "TAG=v$VERSION" >> "$GITHUB_ENV"
35+
fi
3036
3137
- name: Check TS SDK version exists in index.html
38+
if: contains(github.event.pull_request.labels.*.name, 'passport-release')
3239
id: check_ts_sdk_version
3340
run: |
3441
version=$(grep -oP '"x-sdk-version":"ts-immutable-sdk-\K[0-9]+\.[0-9]+\.[0-9]+' ./src/Packages/Passport/Runtime/Resources/index.html | head -n 1)
@@ -41,6 +48,6 @@ jobs:
4148
- name: Create Tag
4249
uses: negz/create-tag@v1
4350
with:
44-
version: "v${{ env.VERSION }}"
45-
message: "Version ${{ env.VERSION }}"
51+
version: "${{ env.TAG }}"
52+
message: "Version ${{ env.TAG }}"
4653
token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/update-version.yml

Lines changed: 59 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,30 @@ name: "Update SDK version"
33
on:
44
workflow_dispatch:
55
inputs:
6+
package:
7+
type: choice
8+
description: Package to release
9+
options:
10+
- passport
11+
- audience
12+
required: true
13+
default: passport
614
upgrade_type:
715
type: choice
816
description: Upgrade Type
917
options:
1018
- patch
1119
- minor
12-
# - major
1320
required: true
1421
default: patch
1522
mark_as_alpha:
1623
type: boolean
17-
description: Mark as alpha release
24+
description: Mark as alpha release (Passport only)
1825
required: false
1926
default: false
2027

2128
env:
29+
PACKAGE: ${{ github.event.inputs.package || 'passport' }}
2230
UPGRADE_TYPE: ${{ github.event.inputs.upgrade_type || 'patch' }}
2331
MARK_AS_ALPHA: ${{ github.event.inputs.mark_as_alpha || false }}
2432

@@ -53,26 +61,43 @@ jobs:
5361
- name: Update Version in package.json
5462
id: replace_version
5563
run: |
56-
PASSPORT_FILE=./src/Packages/Passport/package.json
57-
MARKETPLACE_FILE=./src/Packages/Marketplace/package.json
58-
59-
CURRENT_VERSION=$(jq -r '.version' $PASSPORT_FILE)
64+
if [[ "$PACKAGE" == "audience" ]]; then
65+
FILE=./src/Packages/Audience/package.json
66+
else
67+
FILE=./src/Packages/Passport/package.json
68+
fi
69+
70+
CURRENT_VERSION=$(jq -r '.version' $FILE)
6071
echo "CURRENT_VERSION: $CURRENT_VERSION"
6172
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
6273
63-
HAS_ALPHA=$(echo "$CURRENT_VERSION" | grep -q "\.alpha" && echo "true" || echo "false")
64-
echo "HAS_ALPHA: $HAS_ALPHA"
6574
NEW_VERSION=""
6675
67-
if [[ "$HAS_ALPHA" == "true" ]]; then
68-
# If version is alpha and upgrade type is patch, don't increment patch
69-
if [ "$UPGRADE_TYPE" == "patch" ]; then
70-
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
71-
elif [ "$UPGRADE_TYPE" == "minor" ]; then
72-
MINOR=$((MINOR + 1))
73-
PATCH=0
76+
if [[ "$PACKAGE" == "passport" ]]; then
77+
HAS_ALPHA=$(echo "$CURRENT_VERSION" | grep -q "\.alpha" && echo "true" || echo "false")
78+
echo "HAS_ALPHA: $HAS_ALPHA"
79+
80+
if [[ "$HAS_ALPHA" == "true" ]]; then
81+
if [ "$UPGRADE_TYPE" == "patch" ]; then
82+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
83+
elif [ "$UPGRADE_TYPE" == "minor" ]; then
84+
MINOR=$((MINOR + 1))
85+
PATCH=0
86+
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
87+
fi
88+
else
89+
if [ "$UPGRADE_TYPE" == "patch" ]; then
90+
PATCH=$((PATCH + 1))
91+
elif [ "$UPGRADE_TYPE" == "minor" ]; then
92+
MINOR=$((MINOR + 1))
93+
PATCH=0
94+
fi
7495
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
7596
fi
97+
98+
if [[ "$MARK_AS_ALPHA" == "true" && "$HAS_ALPHA" == "false" ]]; then
99+
NEW_VERSION="$NEW_VERSION.alpha"
100+
fi
76101
else
77102
if [ "$UPGRADE_TYPE" == "patch" ]; then
78103
PATCH=$((PATCH + 1))
@@ -83,20 +108,12 @@ jobs:
83108
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
84109
fi
85110
86-
if [[ "$MARK_AS_ALPHA" == "true" && "$HAS_ALPHA" == "false" ]]; then
87-
NEW_VERSION="$NEW_VERSION.alpha"
88-
fi
89-
90-
# Update Passport package.json
91-
jq --arg version "$NEW_VERSION" '.version = $version' $PASSPORT_FILE > tmp.$$.json && mv tmp.$$.json $PASSPORT_FILE
92-
echo "Updated version in Passport package.json from $CURRENT_VERSION to $NEW_VERSION"
93-
94-
# Update Marketplace package.json
95-
jq --arg version "$NEW_VERSION" '.version = $version' $MARKETPLACE_FILE > tmp.$$.json && mv tmp.$$.json $MARKETPLACE_FILE
96-
echo "Updated version in Marketplace package.json from $CURRENT_VERSION to $NEW_VERSION"
111+
jq --arg version "$NEW_VERSION" '.version = $version' $FILE > tmp.$$.json && mv tmp.$$.json $FILE
112+
echo "Updated version in $FILE from $CURRENT_VERSION to $NEW_VERSION"
97113
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
98114
99115
- name: Update SDK Version in SdkVersionInfoHelpers.cs
116+
if: env.PACKAGE == 'passport'
100117
id: replace_engine_sdk_version
101118
run: |
102119
FILE=./src/Packages/Passport/Runtime/Scripts/Private/Helpers/SdkVersionInfoHelpers.cs
@@ -105,31 +122,37 @@ jobs:
105122
echo "Updated SDK version in SdkVersionInfoHelpers.cs to $NEW_VERSION"
106123
107124
- name: Ensure Samples~/SamplesScenesScripts directory exists and clear contents
125+
if: env.PACKAGE == 'passport'
108126
run: |
109127
mkdir -p ./src/Packages/Passport/Samples~/SamplesScenesScripts
110128
rm -rf ./src/Packages/Passport/Samples~/SamplesScenesScripts/*
111129
112-
mkdir -p ./src/Packages/Marketplace/Samples~/SamplesScenesScripts
113-
rm -rf ./src/Packages/Marketplace/Samples~/SamplesScenesScripts/*
114-
115130
- name: Install rsync
131+
if: env.PACKAGE == 'passport'
116132
run: sudo apt-get install -y rsync
117133

118134
- name: Copy sample scenes and scripts to Passport package Samples~
135+
if: env.PACKAGE == 'passport'
119136
id: copy_sample_scenes_and_scripts
120137
run: |
121138
rsync -av --exclude='*.meta' ./examples/passport/Assets/Scenes/Passport ./src/Packages/Passport/Samples~/SamplesScenesScripts/Scenes/
122139
rsync -av --exclude='*.meta' --exclude='features.json' --exclude='_prompts~/' --exclude='_tutorials~/' ./examples/passport/Assets/Scripts/Passport ./src/Packages/Passport/Samples~/SamplesScenesScripts/Scripts/
123140
124-
rsync -av --exclude='*.meta' ./examples/passport/Assets/Scenes/Marketplace ./src/Packages/Marketplace/Samples~/SamplesScenesScripts/Scenes/
125-
rsync -av --exclude='*.meta' ./examples/passport/Assets/Scripts/Marketplace ./src/Packages/Marketplace/Samples~/SamplesScenesScripts/Scripts/
141+
- name: Set release label
142+
id: set_label
143+
run: |
144+
if [[ "$PACKAGE" == "audience" ]]; then
145+
echo "label=audience-release" >> "$GITHUB_OUTPUT"
146+
else
147+
echo "label=passport-release" >> "$GITHUB_OUTPUT"
148+
fi
126149
127150
- uses: gr2m/create-or-update-pull-request-action@v1
128151
env:
129152
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
130153
with:
131-
title: "chore: update version"
132-
body: "Update version in package.json"
133-
branch: "chore/update-version-${{ steps.replace_version.outputs.version }}"
134-
commit-message: "chore: update version"
135-
labels: release
154+
title: "chore: bump ${{ github.event.inputs.package }} to ${{ steps.replace_version.outputs.version }}"
155+
body: "Bump ${{ github.event.inputs.package }} package version to ${{ steps.replace_version.outputs.version }}."
156+
branch: "chore/bump-${{ github.event.inputs.package }}-${{ steps.replace_version.outputs.version }}"
157+
commit-message: "chore: bump ${{ github.event.inputs.package }} to ${{ steps.replace_version.outputs.version }}"
158+
labels: ${{ steps.set_label.outputs.label }}

0 commit comments

Comments
 (0)