Skip to content
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
3 changes: 1 addition & 2 deletions .github/workflows/deployWebSample.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ jobs:
- name: Publish Web SDK Sample Build
run: ./build/bin/upload-web-sdk-sample-build.sh
env:
GITHUB_USERNAME: ${{ secrets.GIT_WEB_SDK_SAMPLE_USERNAME }}
GITHUB_PASSWORD: ${{ secrets.GIT_WEB_SDK_SAMPLE_PASSWORD }}
GIT_WEB_SDK_SAMPLE_PAT: ${{ secrets.GIT_WEB_SDK_SAMPLE_PAT }}
SAMPLE_DIR: ${{ env.SAMPLE_DIR }}

- uses: github-actions-up-and-running/pr-comment@v1.0.1
Expand Down
103 changes: 103 additions & 0 deletions .github/workflows/release-portal-toolkit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
name: Portal Toolkit Release

on:
workflow_dispatch:
inputs:
commit:
type: string
description: Commit hash to deploy
default: main
major:
type: number
description: Major version number, X.0.0
required: true
default: 0
minor:
type: number
description: Minor version number, 0.X.0
required: true
default: 0
patch:
type: number
description: Patch version number, 0.0.X
required: true
default: 0
rcNumber:
type: number
description: Rc version number, if required, 0.0.0-rc.X
required: false
default: 0
releaseType:
type: choice
description: What type of release is this?
required: true
options:
- nightly
- rc
- exp
- production
dryRun:
type: boolean
description: When true, no publish will happen
required: true
default: false

run-name: >-
Release Portal Toolkit ${{ inputs.releaseType }}
${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}
${{ inputs.releaseType == 'rc' && format('-rc.{0}', inputs.rcNumber) || '' }}
by @${{ github.actor }}

jobs:
portal-toolkit-release:
runs-on: ubuntu-latest
permissions:
id-token: write
defaults:
run:
working-directory: beam-portal-toolkit
steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit }}

- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: '22.14.0'
registry-url: 'https://registry.npmjs.org'

- name: Install pnpm
run: npm install -g pnpm@10.8.0

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Compute version
id: version
run: |
VERSION="${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}"
if [ "${{ inputs.releaseType }}" == "rc" ]; then
VERSION="${VERSION}-rc.${{ inputs.rcNumber }}"
elif [ "${{ inputs.releaseType }}" != "production" ]; then
VERSION="${VERSION}-${{ inputs.releaseType }}"
fi
NPM_TAG="${{ inputs.releaseType }}"
if [ "${{ inputs.releaseType }}" == "production" ]; then
NPM_TAG="latest"
fi
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "NPM_TAG=$NPM_TAG" >> "$GITHUB_OUTPUT"
echo "Computed version: $VERSION (tag: $NPM_TAG)"

- name: Set package version
run: npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version

# prepublishOnly runs sync-components --no-copy && build automatically
- name: Publish to npm
if: ${{ inputs.dryRun == false }}
run: pnpm publish --no-git-checks --provenance --access public --tag ${{ steps.version.outputs.NPM_TAG }}

- name: Dry run build
if: ${{ inputs.dryRun == true }}
run: pnpm prepublishOnly
49 changes: 35 additions & 14 deletions .github/workflows/release-web.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:
default: 0
rcNumber:
type: number
description: Rc version number, if required, 0.0.0-PREVIEW.RCX
description: Rc version number, if required, 0.0.0-rc.X
required: false
default: 0
releaseType:
Expand All @@ -51,6 +51,8 @@ run-name: >-
jobs:
web-sdk-release:
runs-on: ubuntu-latest
permissions:
id-token: write
defaults:
run:
working-directory: web
Expand All @@ -59,38 +61,57 @@ jobs:
with:
ref: ${{ github.event.inputs.commit }}

# Setup Node.js LTS version 22.14.0
- name: Use Node.js LTS
uses: actions/setup-node@v4
with:
node-version: '22.14.0'
registry-url: 'https://registry.npmjs.org'

# Install pnpm package manager version 10.8.0 globally
- name: Install pnpm
run: npm install -g pnpm@10.8.0

# Install project dependencies using pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile

# Run code linter
- name: Lint
run: pnpm lint

# Run the test suite
- name: Test
run: pnpm test


- name: Compute version
id: version
run: |
VERSION="${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}"
if [ "${{ inputs.releaseType }}" == "rc" ]; then
VERSION="${VERSION}-rc.${{ inputs.rcNumber }}"
elif [ "${{ inputs.releaseType }}" != "production" ]; then
VERSION="${VERSION}-${{ inputs.releaseType }}"
fi
NPM_TAG="${{ inputs.releaseType }}"
if [ "${{ inputs.releaseType }}" == "production" ]; then
NPM_TAG="latest"
fi
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
echo "NPM_TAG=$NPM_TAG" >> "$GITHUB_OUTPUT"
echo "Computed version: $VERSION (tag: $NPM_TAG)"

- name: Set package version
run: npm version ${{ steps.version.outputs.VERSION }} --no-git-tag-version

# prepublishOnly runs build automatically
- name: Publish to npm
if: ${{ inputs.dryRun == false }}
run: pnpm publish --no-git-checks --provenance --access public --tag ${{ steps.version.outputs.NPM_TAG }}

- name: Publish Changelog
if: ${{ inputs.dryRun == false }}
if: ${{ inputs.dryRun == false }}
run: sh ./../build/bin/upload-changelogs.sh
env:
COPY_UNITY_SDK: 'false'
COPY_CLI: 'false'
COPY_WEB_SDK: 'true'
VERSION: >-
${{ inputs.major }}.${{ inputs.minor }}.${{ inputs.patch }}
${{ inputs.releaseType == 'rc' && format('-rc.{0}', inputs.rcNumber) || '' }}
VERSION: ${{ steps.version.outputs.VERSION }}
GITHUB_USERNAME: ${{ secrets.GIT_CHANGELOGS_USERNAME }}
GITHUB_PASSWORD: ${{ secrets.GIT_CHANGELOGS_PASSWORD }}
BRANCH: >-
Expand All @@ -101,6 +122,6 @@ jobs:
"production": "production"
}')[github.event.inputs.releaseType] }}

# # Run the release command that bumps the version, updates the changelog, and builds the project.
# - name: Run Release
# run: pnpm release
- name: Dry run build
if: ${{ inputs.dryRun == true }}
run: pnpm prepublishOnly
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ cli/beamable.templates/.config/dotnet-tools.json
/dist
/BeamableNugetSource
build-number.txt
web-build-number.txt

.obsidian

Expand Down Expand Up @@ -178,4 +179,5 @@ web/.idea
web/dist
web/docs
web/node_modules
web/temp
web/temp

7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,13 @@ Prereqs: `dotnet` (8+), and a POSIX shell for the provided scripts (or use WSL o
- `./dev.sh` — builds and publishes local packages into a local NuGet feed consumed by downstream projects (used for fast iteration across CLI, microservices, and Unity SDK).
- Run the repo-level scripts from the repository root. See `cli/` README for how to run CLI-specific projects after running the scripts.

### Web local dev (Portal Toolkit & Web SDK)
Prereqs: Node.js 22+, `pnpm`, and Docker.

- `./setup-web.sh` (run once) — starts a local Verdaccio npm registry and local-unpkg CDN via Docker Compose, resets the build number, and configures npm to resolve `@beamable/*` packages from the local registry.
- `./dev-web.sh` — builds and publishes `@beamable/sdk` and `@beamable/portal-toolkit` to the local Verdaccio registry, then restarts local-unpkg to clear its cache.
- `./teardown-web.sh` — removes the `@beamable/*` registry override from npm config and stops the local Docker stack.

## Documentation and help
- Unity SDK docs: https://help.beamable.com/Unity-Latest/
- CLI docs: https://help.beamable.com/CLI-Latest/
Expand Down
5 changes: 5 additions & 0 deletions beam-portal-toolkit/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
dist
docs
node_modules
temp
Loading
Loading