Skip to content

Commit

Permalink
chore: pkce only for webgl
Browse files Browse the repository at this point in the history
  • Loading branch information
andrew-yangy committed Oct 11, 2024
1 parent 1aa32d2 commit d18c6ae
Show file tree
Hide file tree
Showing 40 changed files with 229 additions and 1,643 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
VALIDATE_ALL_CODEBASE: true
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*)
FILTER_REGEX_EXCLUDE: (.*src/Packages/Passport/Runtime/ThirdParty/.*|.*src/Packages/Passport/Runtime/Resources/.*|.*Plugins/.*|.*src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/.*|.*src/Packages/Orderbook|.*sample|.*src/Packages/Passport/WebGLTemplates~)
VALIDATE_MARKDOWN: false
VALIDATE_GITLEAKS: false
VALIDATE_JSCPD: false
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
projectPath: './sample'
githubToken: ${{ secrets.GITHUB_TOKEN }}
testMode: 'EditMode'
- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: Test results
path: ${{ steps.passportTest.outputs.artifactsPath }}

- uses: actions/upload-artifact@v2
- uses: actions/upload-artifact@v4
if: always()
with:
name: Coverage results
Expand Down
65 changes: 54 additions & 11 deletions .github/workflows/update-version.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,21 @@
---
name: "Update version in package.json"
name: "Update SDK version"

on:
workflow_dispatch:
inputs:
version:
description: 'Version to update to (e.g. 1.20.0)'
upgrade_type:
type: choice
description: Upgrade Type
options:
- patch
- minor
# - major
required: true
default: patch

env:
UPGRADE_TYPE: ${{ github.event.inputs.upgrade_type || 'patch' }}

jobs:
update:
Expand Down Expand Up @@ -37,26 +46,60 @@ jobs:
- name: Install jq
run: sudo apt-get install -y jq

- name: Replace version string
- name: Update Version in package.json
id: replace_version
run: |
FILE=./src/Packages/Passport/package.json
VERSION=${{ github.event.inputs.version }}
jq --arg version "$VERSION" '.version = $version' $FILE > tmp.$$.json && mv tmp.$$.json $FILE
PASSPORT_FILE=./src/Packages/Passport/package.json
MARKETPLACE_FILE=./src/Packages/Marketplace/package.json
CURRENT_VERSION=$(jq -r '.version' $PASSPORT_FILE)
IFS='.' read -r MAJOR MINOR PATCH <<< "$CURRENT_VERSION"
# Increment version based on UPGRADE_TYPE
case "$UPGRADE_TYPE" in
major)
MAJOR=$((MAJOR + 1))
MINOR=0
PATCH=0
;;
minor)
MINOR=$((MINOR + 1))
PATCH=0
;;
patch)
PATCH=$((PATCH + 1))
;;
*)
echo "Invalid upgrade type: $UPGRADE_TYPE"
exit 1
;;
esac
NEW_VERSION="$MAJOR.$MINOR.$PATCH"
# Update Passport package.json
jq --arg version "$NEW_VERSION" '.version = $version' $PASSPORT_FILE > tmp.$$.json && mv tmp.$$.json $PASSPORT_FILE
echo "Updated version in Passport package.json from $CURRENT_VERSION to $NEW_VERSION"
# Update Marketplace package.json
jq --arg version "$NEW_VERSION" '.version = $version' $MARKETPLACE_FILE > tmp.$$.json && mv tmp.$$.json $MARKETPLACE_FILE
echo "Updated version in Marketplace package.json from $CURRENT_VERSION to $NEW_VERSION"
echo "version=$NEW_VERSION" >> "$GITHUB_OUTPUT"
- name: Replace engine sdk version string
- name: Update SDK Version in SdkVersionInfoHelpers.cs
id: replace_engine_sdk_version
run: |
FILE=./src/Packages/Passport/Runtime/Scripts/Private/Helpers/SdkVersionInfoHelpers.cs
VERSION=${{ github.event.inputs.version }}
sed -i -E "s/[0-9]+\.[0-9]+\.[0-9]+/$VERSION/g" $FILE
NEW_VERSION="${{ steps.replace_version.outputs.version }}"
sed -i -E "s/[0-9]+\.[0-9]+\.[0-9]+/$NEW_VERSION/g" $FILE
echo "Updated SDK version in SdkVersionInfoHelpers.cs to $NEW_VERSION"
- uses: gr2m/create-or-update-pull-request-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
title: "chore: update version"
body: "Update version in package.json"
branch: "chore/update-version-${{ github.event.inputs.version }}"
branch: "chore/update-version-${{ steps.replace_version.outputs.version }}"
commit-message: "chore: update version"
labels: release
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ crashlytics-build.properties

sample-passport-unity-game/
sample/iosBuild
!/sample/webgl/Build/

# Android
src/Packages/Passport/Runtime/Assets/ImmutableAndroid.androidlib/**/*.meta
Expand Down
Loading

0 comments on commit d18c6ae

Please sign in to comment.