From 22b2299316225351ffb6356c17e42818f6b69016 Mon Sep 17 00:00:00 2001 From: Ru Cindrea Date: Mon, 23 Nov 2026 20:35:55 +0200 Subject: [PATCH] release: 2.4.0, published to npm through trusted publishing - Set the version to 2.4.0, sharing major.minor with the AltTester SDK. - Point publishConfig at the public npm registry with public access. - Add release.yml: a v* tag checks the version, runs the checks and publishes with provenance via OIDC. - Update the README install section and add release steps. - Drop two comments that pointed at the removed protocol notes. --- .github/workflows/release.yml | 57 +++++++++++++++++++++++++++++++++++ README.md | 18 ++++++++--- package-lock.json | 4 +-- package.json | 9 ++++-- src/binding/AltObject.ts | 2 +- src/commands.ts | 2 +- 6 files changed, 81 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..25f9759 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,57 @@ +name: Release + +# Publishes @alttester/driver to npm when a version tag (v2.4.0, v2.5.0-beta.1, ...) is pushed. +# It uses npm trusted publishing: npm trusts this workflow file through GitHub's OIDC token, so no npm token is +# stored in the repository, and the package gets a provenance statement. The trusted publisher is set on +# npmjs.com (package settings, "Trusted Publisher": GitHub Actions, alttester/AltTester-TypeScript-Driver, +# workflow release.yml). If this file is renamed, that setting must change too. + +on: + push: + tags: + - 'v*' + +permissions: + contents: read + id-token: write # for the OIDC token that npm trusted publishing exchanges + +concurrency: + group: release + cancel-in-progress: false + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + registry-url: https://registry.npmjs.org + + # Trusted publishing needs npm 11.5.1 or later; Node 22 ships with npm 10. + - name: Update npm + run: npm install -g npm@11 + + - name: Check that the tag matches package.json + id: version + run: | + version="$(node -p "require('./package.json').version")" + if [ "v${version}" != "${GITHUB_REF_NAME}" ]; then + echo "::error::Tag ${GITHUB_REF_NAME} does not match package.json version ${version}." + exit 1 + fi + case "$version" in + *-*) echo "dist_tag=next" >> "$GITHUB_OUTPUT" ;; + *) echo "dist_tag=latest" >> "$GITHUB_OUTPUT" ;; + esac + + - run: npm ci + - run: npm run typecheck + - run: npm test + - run: npm run build + + - name: Publish to npm + run: npm publish --access public --tag "${{ steps.version.outputs.dist_tag }}" diff --git a/README.md b/README.md index 5ee12af..bf61ba4 100644 --- a/README.md +++ b/README.md @@ -16,14 +16,12 @@ await driver.stop(); ## Install -This repository is private and the package is not on the public npm registry. Install it from a tag: - ```bash -npm install "github:alttester/AltTester-TypeScript-Driver#v0.2.1" +npm install @alttester/driver ``` -npm builds `dist/` on install (`prepare`). It needs read access to this repository: an SSH key locally, a -token on CI. +The driver shares its major and minor version with the AltTesterĀ® SDK, so any 2.4.x driver works with any 2.4.x +Unity SDK. It also connects to Unreal SDK 1.x apps. Patch versions are released independently. ## Entry points @@ -119,6 +117,16 @@ npm run typecheck npm run build ``` +## Releasing + +1. Set `version` in `package.json` (and `package-lock.json`) to the new version, for example with + `npm version 2.4.1 --no-git-tag-version`, and merge that change to `main`. +2. Tag the merge commit with the same version prefixed by `v`, and push the tag: + `git tag v2.4.1 && git push origin v2.4.1`. +3. The `Release` workflow checks that the tag matches `package.json`, runs the checks, and publishes to npm + through trusted publishing (OIDC), with provenance. No npm token is stored in the repository. A version with a + pre-release suffix, such as `2.5.0-beta.1`, is published under the `next` dist-tag instead of `latest`. + ## License Proprietary, under the AltTesterĀ® SDK License Agreement. See [LICENSE](LICENSE). Using the driver requires a valid diff --git a/package-lock.json b/package-lock.json index adfe4fa..55c1aa3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@alttester/driver", - "version": "0.2.1", + "version": "2.4.0", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@alttester/driver", - "version": "0.2.1", + "version": "2.4.0", "license": "SEE LICENSE IN LICENSE", "dependencies": { "ws": "^8.18.0" diff --git a/package.json b/package.json index 4d8ce43..4cd9622 100644 --- a/package.json +++ b/package.json @@ -1,12 +1,16 @@ { "name": "@alttester/driver", - "version": "0.2.1", + "version": "2.4.0", "description": "AltTester(R) driver for TypeScript/JavaScript (Node 22+ and browsers): the binding API plus the low-level protocol client.", "license": "SEE LICENSE IN LICENSE", "repository": { "type": "git", "url": "git+https://github.com/alttester/AltTester-TypeScript-Driver.git" }, + "homepage": "https://github.com/alttester/AltTester-TypeScript-Driver#readme", + "bugs": { + "url": "https://github.com/alttester/AltTester-TypeScript-Driver/issues" + }, "keywords": [ "alttester", "unity", @@ -78,7 +82,8 @@ "node": ">=22" }, "publishConfig": { - "registry": "https://npm.pkg.github.com" + "access": "public", + "registry": "https://registry.npmjs.org/" }, "scripts": { "build": "tsup", diff --git a/src/binding/AltObject.ts b/src/binding/AltObject.ts index 86c2d2c..85a2b6a 100644 --- a/src/binding/AltObject.ts +++ b/src/binding/AltObject.ts @@ -27,7 +27,7 @@ export class AltObject implements AltObjectData { data: Partial & { iD?: number }, ) { this.name = data.name ?? ''; - // The Unreal SDK serialises some ids as "iD" (protocol.md correction 15). + // The Unreal SDK serialises some ids as "iD". this.id = data.id ?? data.iD ?? 0; this.x = data.x ?? 0; this.y = data.y ?? 0; diff --git a/src/commands.ts b/src/commands.ts index 0954fe9..d59155e 100644 --- a/src/commands.ts +++ b/src/commands.ts @@ -1,5 +1,5 @@ // Typed wrappers for the commands the inspector uses. Method names are the wire commandNames -// (including the "hightlight" typo). Defaults follow AltTester Desktop; see docs/research/protocol.md. +// (including the "hightlight" typo). Defaults follow AltTester Desktop. import { AltError, type AltSocket, type CommandKind } from './AltSocket'; import { isCommandAvailable, isUnavailable, UNAVAILABLE, type GameEngine, type Unavailable } from './engine';