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
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down Expand Up @@ -78,7 +82,8 @@
"node": ">=22"
},
"publishConfig": {
"registry": "https://npm.pkg.github.com"
"access": "public",
"registry": "https://registry.npmjs.org/"
},
"scripts": {
"build": "tsup",
Expand Down
2 changes: 1 addition & 1 deletion src/binding/AltObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export class AltObject implements AltObjectData {
data: Partial<AltObjectData> & { 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;
Expand Down
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Loading