Skip to content

Commit e3498d1

Browse files
committed
Make Marketplace publication turnkey
Removes every non-human blocker for publishing vscode-a2ml: - Add icons/a2ml-icon.png (Marketplace rejects SVG icons; package.json already referenced the PNG, so vsce package previously failed) - Add .vscodeignore so the .vsix ships only runtime assets (12 files / 18 KB instead of the entire repo / 351 files) - Add Marketplace Publish workflow: tag-triggered, packages a .vsix and publishes to the VS Code Marketplace and Open VSX, each gated on its secret so a missing token skips rather than fails - Document the one remaining human step (Azure DevOps PAT) and the full runbook in docs/PUBLISHING.adoc; update ROADMAP https://claude.ai/code/session_0111iLmV7VFMTFGigST1M1cb
1 parent 987ce79 commit e3498d1

5 files changed

Lines changed: 180 additions & 3 deletions

File tree

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Copyright (c) 2026 Jonathan D.A. Jewell (hyperpolymath) <j.d.a.jewell@open.ac.uk>
3+
#
4+
# Marketplace publication — triggered by version tags (v*).
5+
# Packages the extension into a .vsix and publishes to the VS Code
6+
# Marketplace and the Open VSX Registry. Each publish step is gated on
7+
# the presence of its credential, so a missing token skips (not fails)
8+
# that registry.
9+
#
10+
# Required repository secrets (Settings -> Secrets and variables -> Actions):
11+
# VSCE_PAT Azure DevOps PAT for the `hyperpolymath` Marketplace publisher
12+
# https://dev.azure.com -> User settings -> Personal access tokens
13+
# Organization: All accessible | Scope: Marketplace > Manage
14+
# OVSX_PAT Open VSX Registry access token (optional, open-source registry)
15+
# https://open-vsx.org -> Settings -> Access Tokens
16+
#
17+
# Manual one-off alternative (no CI): see docs/PUBLISHING.adoc
18+
name: Marketplace Publish
19+
20+
on:
21+
push:
22+
tags:
23+
- 'v*'
24+
workflow_dispatch:
25+
26+
permissions:
27+
contents: read
28+
29+
jobs:
30+
publish:
31+
name: Package and Publish
32+
runs-on: ubuntu-latest
33+
permissions:
34+
contents: read
35+
steps:
36+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
37+
38+
- name: Install Deno
39+
run: |
40+
curl -fsSL https://deno.land/install.sh | DENO_INSTALL=/usr/local sh -s v2.1.4
41+
deno --version
42+
43+
- name: Verify version matches tag
44+
if: startsWith(github.ref, 'refs/tags/v')
45+
run: |
46+
TAG_VERSION="${GITHUB_REF_NAME#v}"
47+
PKG_VERSION="$(deno eval 'console.log(JSON.parse(Deno.readTextFileSync("package.json")).version)')"
48+
echo "tag=$TAG_VERSION package.json=$PKG_VERSION"
49+
if [ "$TAG_VERSION" != "$PKG_VERSION" ]; then
50+
echo "::error::Tag v$TAG_VERSION does not match package.json version $PKG_VERSION"
51+
exit 1
52+
fi
53+
54+
- name: Package .vsix
55+
run: |
56+
deno run -A --node-modules-dir=auto npm:@vscode/vsce@3.2.1 package --allow-missing-repository
57+
ls -la ./*.vsix
58+
59+
- name: Upload .vsix artifact
60+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
61+
with:
62+
name: vsix-package
63+
path: ./*.vsix
64+
retention-days: 30
65+
66+
- name: Publish to VS Code Marketplace
67+
env:
68+
VSCE_PAT: ${{ secrets.VSCE_PAT }}
69+
run: |
70+
if [ -z "${VSCE_PAT:-}" ]; then
71+
echo "::warning::VSCE_PAT secret not set — skipping VS Code Marketplace publish."
72+
exit 0
73+
fi
74+
deno run -A --node-modules-dir=auto npm:@vscode/vsce@3.2.1 publish --packagePath ./*.vsix --pat "$VSCE_PAT"
75+
76+
- name: Publish to Open VSX Registry
77+
env:
78+
OVSX_PAT: ${{ secrets.OVSX_PAT }}
79+
run: |
80+
if [ -z "${OVSX_PAT:-}" ]; then
81+
echo "::warning::OVSX_PAT secret not set — skipping Open VSX publish."
82+
exit 0
83+
fi
84+
deno run -A --node-modules-dir=auto npm:ovsx@0.10.1 publish ./*.vsix --pat "$OVSX_PAT"

.vscodeignore

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-License-Identifier: PMPL-1.0-or-later
2+
# Everything is excluded by default; only the allow-listed runtime assets
3+
# below are shipped in the published .vsix.
4+
**
5+
6+
!package.json
7+
!language-configuration.json
8+
!README.adoc
9+
!CHANGELOG.md
10+
!LICENSE
11+
!LICENSE-PMPL
12+
!icons/a2ml-icon.png
13+
!icons/a2ml-icon.svg
14+
!syntaxes/**
15+
!snippets/**
16+
17+
# Re-exclude noise that could match the allow-list above
18+
**/.DS_Store
19+
**/*.vsix

ROADMAP.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ Extension work is in pre-publication state.
1313
* [ ] CI/CD baseline
1414

1515
=== v0.1.1 - Marketplace Publication
16-
* [ ] Acquire Azure DevOps Marketplace PAT for publisher account
17-
* [ ] Run `vsce package` and final metadata verification
18-
* [ ] Publish with `vsce publish`
16+
* [x] PNG icon generated (Marketplace rejects SVG icons)
17+
* [x] Automated `Marketplace Publish` workflow (tag-triggered, VS Code + Open VSX)
18+
* [x] Publishing runbook: link:docs/PUBLISHING.adoc[docs/PUBLISHING.adoc]
19+
* [ ] Acquire Azure DevOps Marketplace PAT for publisher account (human step)
20+
* [ ] Add `VSCE_PAT` repository secret, then push a `v*` tag to publish
1921

2022
=== v1.0.0 - Stable Release
2123
* [ ] Full feature set

docs/PUBLISHING.adoc

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// SPDX-License-Identifier: PMPL-1.0-or-later
2+
= Publishing vscode-a2ml
3+
:toc: preamble
4+
:icons: font
5+
6+
How this extension gets "online" — i.e. installable from a marketplace.
7+
8+
== The one step only a human can do
9+
10+
Publishing requires an *Azure DevOps Personal Access Token (PAT)* bound to
11+
the `hyperpolymath` Marketplace publisher. This is a credential that must be
12+
generated interactively while signed into the Microsoft/Azure account that
13+
owns the publisher. No automation (CI or otherwise) can create it. This is
14+
the single blocker that has kept issue #1 open.
15+
16+
=== Create the PAT (5 minutes, once)
17+
18+
. Sign in at https://dev.azure.com with the account that owns the
19+
`hyperpolymath` Marketplace publisher.
20+
. Top-right avatar → *Personal access tokens* → *New Token*.
21+
. Organization: *All accessible organizations*.
22+
. Scopes: *Custom defined* → expand *Marketplace* → tick *Manage*.
23+
. Create, then *copy the token now* (it is shown only once).
24+
25+
If the `hyperpolymath` publisher does not yet exist, create it once at
26+
https://marketplace.visualstudio.com/manage/publishers/ (publisher ID must
27+
equal the `publisher` field in `package.json`).
28+
29+
== Automated path (recommended)
30+
31+
. In GitHub: *Settings → Secrets and variables → Actions → New repository
32+
secret*.
33+
. Add `VSCE_PAT` = the token from above.
34+
. (Optional, open-source registry) add `OVSX_PAT` from
35+
https://open-vsx.org → Settings → Access Tokens.
36+
. Bump `version` in `package.json`, commit, then tag and push:
37+
+
38+
[source,bash]
39+
----
40+
git tag v0.1.0
41+
git push origin v0.1.0
42+
----
43+
44+
The `Marketplace Publish` workflow packages a `.vsix` and publishes to the
45+
VS Code Marketplace (and Open VSX if `OVSX_PAT` is set). Registries without
46+
a configured token are skipped, not failed. The workflow can also be run
47+
manually via *Actions → Marketplace Publish → Run workflow*.
48+
49+
== Manual one-off path (no CI)
50+
51+
Requires Deno (the repo's standard toolchain; npm/bun are blocked).
52+
53+
[source,bash]
54+
----
55+
export VSCE_PAT=... # the Azure DevOps PAT
56+
deno run -A --node-modules-dir=auto npm:@vscode/vsce@3.2.1 package
57+
deno run -A --node-modules-dir=auto npm:@vscode/vsce@3.2.1 \
58+
publish --packagePath ./*.vsix --pat "$VSCE_PAT"
59+
----
60+
61+
== Verifying it is online
62+
63+
* VS Code Marketplace:
64+
https://marketplace.visualstudio.com/items?itemName=hyperpolymath.vscode-a2ml
65+
* Inside VS Code: `ext install hyperpolymath.vscode-a2ml`
66+
* Open VSX (if published): https://open-vsx.org/extension/hyperpolymath/vscode-a2ml
67+
68+
== Note: GitHub Pages is a different "online"
69+
70+
The `GitHub Pages` workflow (`casket-pages.yml`) publishes a documentation
71+
*site*, not the installable extension. Marketplace publication is what makes
72+
the extension usable; the two are independent.

icons/a2ml-icon.png

3.38 KB
Loading

0 commit comments

Comments
 (0)