Skip to content

Commit 28239fc

Browse files
committed
Releases by version: npm by trusted publishing, the extension by token or Entra
editor.yml: on main (once the variable RELEASES is on), publishes each package whose version is new and tags it. The language server goes to npm as @reactivescript/language-server by trusted publishing (OIDC, provenance); the extension to the VS Marketplace (an Entra identity if configured, else VSCE_PAT) and Open VSX (OVSX_PAT). The build packs both. rx-language-server: publishable (prepack puts rxc.wasm in src/), 0.1.0. tooling/RELEASING.md: the one-time setup and how to release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0117BoWP4zNW5bnup8XRB8md
1 parent 642fa95 commit 28239fc

8 files changed

Lines changed: 190 additions & 44 deletions

File tree

‎.github/workflows/editor.yml‎

Lines changed: 78 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
# The editor tools (spec/11 CP-8e): build the crate natively and as WebAssembly, run the language server's LSP tests on
2-
# both the server and the extension's bundle, and package the VS Code extension (one .vsix for every platform).
3-
# A tag `vscode-v<version>` also publishes it: to the VS Marketplace by trusted publishing (OIDC, variables
4-
# AZURE_CLIENT_ID and AZURE_TENANT_ID) and to Open VSX (secret OVSX_PAT), from the `release` environment.
2+
# both the server and the extension's bundle, and package the VS Code extension (one .vsix for every platform) and the
3+
# language server's npm package.
4+
#
5+
# Releases are by version (tooling/RELEASING.md), once the repository variable RELEASES is `on`. On main:
6+
# - a version of tooling/rx-language-server that npm does not have is published there by trusted publishing (OIDC,
7+
# no token), and tagged `language-server-v<version>`;
8+
# - a version of tooling/vscode-rx without its tag `vscode-v<version>` is published to the VS Marketplace (a Microsoft
9+
# Entra identity, or the secret VSCE_PAT) and Open VSX (the secret OVSX_PAT), and tagged.
10+
# So a release is a version bump, merged.
511
name: editor
612

713
on:
814
push:
915
branches: [main]
10-
tags: ["vscode-v*"]
16+
paths: ["compiler/**", "tooling/**", ".github/workflows/editor.yml"]
1117
pull_request:
1218
paths: ["compiler/**", "tooling/**", ".github/workflows/editor.yml"]
1319
workflow_dispatch:
@@ -47,30 +53,82 @@ jobs:
4753
npm ci
4854
npm run package
4955
SERVER=dist/server.js node ../rx-language-server/test/run.js
56+
- name: Pack the language server
57+
working-directory: tooling/rx-language-server
58+
run: npm pack
5059
- uses: actions/upload-artifact@v4
5160
with:
5261
name: vsix
5362
path: tooling/vscode-rx/*.vsix
63+
- uses: actions/upload-artifact@v4
64+
with:
65+
name: npm
66+
path: tooling/rx-language-server/*.tgz
5467

55-
publish:
56-
if: startsWith(github.ref, 'refs/tags/vscode-v')
68+
# which versions are new: run on main only, after the build passed
69+
versions:
70+
if: github.event_name == 'push' && github.ref == 'refs/heads/main' && vars.RELEASES == 'on'
5771
needs: build
5872
runs-on: ubuntu-latest
59-
# trusted publishing: no long-lived token for the Marketplace; the job's OIDC token signs it in to Microsoft Entra
60-
# through a federated credential on a managed identity that is a member of the publisher (tooling/vscode-rx/README.md)
73+
outputs:
74+
server: ${{ steps.v.outputs.server }}
75+
vscode: ${{ steps.v.outputs.vscode }}
76+
steps:
77+
- uses: actions/checkout@v5
78+
- id: v
79+
run: |
80+
s=$(node -p 'const p = require("./tooling/rx-language-server/package.json"); p.name + "@" + p.version')
81+
if [ -z "$(npm view "$s" version 2>/dev/null)" ]; then echo "server=$s" >> "$GITHUB_OUTPUT"; fi
82+
v=$(node -p 'require("./tooling/vscode-rx/package.json").version')
83+
if [ -z "$(git ls-remote --tags origin "refs/tags/vscode-v$v")" ]; then echo "vscode=$v" >> "$GITHUB_OUTPUT"; fi
84+
85+
publish-npm:
86+
needs: versions
87+
if: needs.versions.outputs.server != ''
88+
runs-on: ubuntu-latest
6189
environment: release
6290
permissions:
63-
id-token: write
64-
contents: read
65-
env:
66-
OVSX_PAT: ${{ secrets.OVSX_PAT }} # job-wide, so that a step's `if` can see whether it is set
91+
id-token: write # trusted publishing: npm takes the job's OIDC token, and adds provenance
92+
contents: write # the tag
6793
steps:
94+
- uses: actions/checkout@v5
95+
- uses: actions/download-artifact@v4
96+
with:
97+
name: npm
98+
- uses: actions/setup-node@v5
99+
with:
100+
node-version: 22
101+
registry-url: https://registry.npmjs.org
102+
- run: npm install -g npm@latest # trusted publishing needs npm 11.5.1 or later
103+
- run: npm publish ./*.tgz --access public
104+
- name: Tag
105+
run: |
106+
t="language-server-v${SERVER##*@}"
107+
git tag "$t" && git push origin "$t"
108+
env:
109+
SERVER: ${{ needs.versions.outputs.server }}
110+
111+
publish-vscode:
112+
needs: versions
113+
if: needs.versions.outputs.vscode != ''
114+
runs-on: ubuntu-latest
115+
environment: release
116+
permissions:
117+
id-token: write # the Marketplace by Microsoft Entra, when AZURE_CLIENT_ID is set
118+
contents: write # the tag
119+
env: # job-wide, so that a step's `if` can see whether each is set
120+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
121+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
122+
steps:
123+
- uses: actions/checkout@v5
68124
- uses: actions/download-artifact@v4
69125
with:
70126
name: vsix
71127
- uses: actions/setup-node@v5
72128
with:
73129
node-version: 22
130+
# the Marketplace takes a Microsoft Entra identity (no token) when the repository has AZURE_CLIENT_ID and
131+
# AZURE_TENANT_ID, else the secret VSCE_PAT (an Azure DevOps token: global ones end 2026-12-01)
74132
- name: Sign in to Microsoft Entra (OIDC)
75133
if: vars.AZURE_CLIENT_ID != ''
76134
uses: azure/login@v2
@@ -79,10 +137,13 @@ jobs:
79137
tenant-id: ${{ vars.AZURE_TENANT_ID }}
80138
allow-no-subscriptions: true
81139
- name: VS Marketplace
82-
if: vars.AZURE_CLIENT_ID != ''
83-
run: npx --yes @vscode/vsce publish --azure-credential --packagePath *.vsix
84-
# Open VSX has no trusted publishing in its CLI yet (eclipse-openvsx/openvsx#1980 is server-side only): a token
85-
# until it does
140+
if: vars.AZURE_CLIENT_ID != '' || env.VSCE_PAT != ''
141+
run: npx --yes @vscode/vsce publish --packagePath ./*.vsix ${{ vars.AZURE_CLIENT_ID != '' && '--azure-credential' || '' }}
86142
- name: Open VSX
87143
if: env.OVSX_PAT != ''
88-
run: npx --yes ovsx publish *.vsix -p "$OVSX_PAT"
144+
run: npx --yes ovsx publish ./*.vsix -p "$OVSX_PAT"
145+
- name: Tag
146+
if: vars.AZURE_CLIENT_ID != '' || env.VSCE_PAT != '' || env.OVSX_PAT != ''
147+
run: git tag "vscode-v$V" && git push origin "vscode-v$V"
148+
env:
149+
V: ${{ needs.versions.outputs.vscode }}

‎tooling/RELEASING.md‎

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Releasing the editor tools
2+
3+
A release is a version bump merged to `main`. The `editor` workflow
4+
(`.github/workflows/editor.yml`) builds and tests as on every change, then
5+
publishes each package whose version is new, from the `release` environment,
6+
and tags it:
7+
8+
| package | where | how it signs in | tag |
9+
| --- | --- | --- | --- |
10+
| `tooling/rx-language-server` | npm, `@reactivescript/language-server` | trusted publishing (OIDC), no token | `language-server-v<version>` |
11+
| `tooling/vscode-rx` | VS Marketplace | a Microsoft Entra identity (OIDC), or the secret `VSCE_PAT` | `vscode-v<version>` |
12+
| `tooling/vscode-rx` | Open VSX (Cursor, VSCodium) | the secret `OVSX_PAT` | (the same) |
13+
14+
Nothing is published until the repository variable `RELEASES` is `on`.
15+
16+
## Once
17+
18+
**npm.** Create the `reactivescript` org on npmjs.com. npm configures trusted
19+
publishing only on a package that exists, so it needs a first version by hand:
20+
a placeholder, with no build,
21+
22+
```sh
23+
npm login
24+
npx setup-npm-trusted-publish @reactivescript/language-server
25+
```
26+
27+
It publishes `0.0.0`, marked as a placeholder; the workflow's first release is
28+
`0.1.0`.
29+
30+
Then, on the package's **Settings › Trusted publishing**, add GitHub Actions:
31+
owner `ryansolid`, repository `reactivescript`, workflow `editor.yml`,
32+
environment `release`. (If the repository moves, change the owner here.) Every
33+
later version is published by the workflow, with provenance.
34+
35+
**VS Marketplace.** Create the `reactivescript` publisher
36+
(marketplace.visualstudio.com/manage). Then either:
37+
38+
- a token: an Azure DevOps personal access token with **Marketplace › Manage**
39+
for all accessible organizations, as the secret `VSCE_PAT` on the `release`
40+
environment. Azure DevOps retires such global tokens on 2026-12-01; or
41+
- no token: a Microsoft Entra managed identity (or app registration) with a
42+
federated credential for GitHub Actions (issuer
43+
`https://token.actions.githubusercontent.com`, subject
44+
`repo:ryansolid/reactivescript:environment:release`), added to an Azure
45+
DevOps organization in the same tenant (so that it has a Marketplace
46+
profile) and to the publisher's **Members** as a Contributor; then the
47+
repository variables `AZURE_CLIENT_ID` and `AZURE_TENANT_ID`. The workflow
48+
signs in with `azure/login` and runs `vsce publish --azure-credential`.
49+
50+
**Open VSX.** Sign in at open-vsx.org with GitHub, sign the publisher
51+
agreement, create a token, run `npx ovsx create-namespace reactivescript -p
52+
<token>`, and store the token as the secret `OVSX_PAT` on the `release`
53+
environment. (Open VSX's trusted publishing is server-side work in progress,
54+
eclipse-openvsx/openvsx#1980; switch when `ovsx` supports it.)
55+
56+
Finally set the repository variable `RELEASES` to `on`.
57+
58+
## Each release
59+
60+
Bump `version` in `tooling/rx-language-server/package.json` and/or
61+
`tooling/vscode-rx/package.json` (and their `package-lock.json`, with
62+
`npm version <patch|minor|major> --no-git-tag-version` in that folder), and
63+
merge. A channel whose secret or identity is unset is skipped, and its tag is
64+
not made, so it publishes on a later run.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.test/
2+
src/rxc.wasm
3+
*.tgz

‎tooling/rx-language-server/README.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,14 @@ The project needs a `tsconfig.json` with Solid's JSX (`"jsx": "preserve"`,
2121

2222
## Running it
2323

24+
From npm (published from this folder, `../RELEASING.md`):
25+
26+
```sh
27+
npx @reactivescript/language-server --stdio
28+
```
29+
30+
From the repository:
31+
2432
```sh
2533
cargo build --lib --release --target wasm32-unknown-unknown --manifest-path ../../compiler/Cargo.toml
2634
npm install
@@ -75,8 +83,9 @@ folder under Settings › Editor › TextMate Bundles for highlighting.
7583
**Zed** needs an extension of its own (a Zed extension declares the language
7684
and starts the server); there isn't one yet.
7785

78-
The `/path/to/reactivescript` paths are a checkout of this repository. A
79-
published npm package would replace them with `npx`; there isn't one yet.
86+
The `/path/to/reactivescript` paths are a checkout of this repository; with
87+
the npm package, the command is `npx @reactivescript/language-server --stdio`
88+
instead (or `rx-language-server --stdio` once installed).
8089

8190
## Tests
8291

‎tooling/rx-language-server/package-lock.json‎

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tooling/rx-language-server/package.json‎

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
{
22
"name": "@reactivescript/language-server",
3-
"version": "0.0.1",
4-
"private": true,
5-
"type": "commonjs",
3+
"version": "0.1.0",
64
"description": "The .rx language server (spec/11 CP-8): Volar over the crate's TSX projection, TypeScript's answers mapped back onto .rx, the crate's own diagnostics.",
5+
"license": "MIT",
6+
"repository": {
7+
"type": "git",
8+
"url": "git+https://github.com/ryansolid/reactivescript.git",
9+
"directory": "tooling/rx-language-server"
10+
},
11+
"type": "commonjs",
712
"bin": {
813
"rx-language-server": "./bin/server.js"
914
},
1015
"main": "./src/index.js",
16+
"files": [
17+
"bin",
18+
"src"
19+
],
20+
"engines": {
21+
"node": ">=18"
22+
},
1123
"scripts": {
12-
"test": "node test/run.js"
24+
"test": "node test/run.js",
25+
"prepack": "node scripts/wasm.js"
1326
},
1427
"dependencies": {
1528
"@volar/language-core": "2.4.30",
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Puts the crate's WebAssembly build in the package (src/rxc.wasm, where src/rxc.js looks first), before `npm pack` or
2+
// `npm publish`: $RX_WASM, else the repository's build
3+
// (`cargo build --lib --release --target wasm32-unknown-unknown --manifest-path compiler/Cargo.toml`).
4+
const fs = require("node:fs");
5+
const path = require("node:path");
6+
7+
const from = process.env.RX_WASM || path.resolve(__dirname, "../../../compiler/target/wasm32-unknown-unknown/release/reactivescript.wasm");
8+
if (!fs.existsSync(from)) {
9+
console.error(`no ${from}: cargo build --lib --release --target wasm32-unknown-unknown --manifest-path compiler/Cargo.toml`);
10+
process.exit(1);
11+
}
12+
fs.copyFileSync(from, path.join(__dirname, "../src/rxc.wasm"));

‎tooling/vscode-rx/README.md‎

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,9 @@ per request instead of the WebAssembly build) or TypeScript.
4949

5050
## Publishing
5151

52-
The repository's `editor` workflow (`.github/workflows/editor.yml`) builds and
53-
tests the extension on every change to `compiler/` or `tooling/`. A tag
54-
`vscode-v<version>` (matching `version` in `package.json`) also publishes it,
55-
from the `release` environment:
56-
57-
- **VS Marketplace, by trusted publishing** (no stored token). Once: create
58-
the `reactivescript` publisher; in Azure, create a user-assigned managed
59-
identity (or an app registration) with a federated credential for GitHub
60-
Actions, issuer `https://token.actions.githubusercontent.com`, subject
61-
`repo:ryansolid/reactivescript:environment:release`; add that identity to
62-
the publisher as a Contributor; set the repository variables
63-
`AZURE_CLIENT_ID` and `AZURE_TENANT_ID`. The job signs in with `azure/login`
64-
and runs `vsce publish --azure-credential`.
65-
- **Open VSX, by token** for now: its trusted publishing is server-side work
66-
in progress (eclipse-openvsx/openvsx#1980) with no CLI support yet. Set the
67-
secret `OVSX_PAT` on the `release` environment; switch when `ovsx` can
68-
exchange the job's OIDC token.
69-
70-
Either step is skipped while its variable or secret is unset.
52+
The repository's `editor` workflow builds and tests the extension on every
53+
change to `compiler/` or `tooling/`, and publishes a new `version` to the VS
54+
Marketplace and Open VSX when it reaches `main`: see
55+
[`../RELEASING.md`](../RELEASING.md).
7156

7257
Other editors: see [`../rx-language-server`](../rx-language-server#editors).

0 commit comments

Comments
 (0)