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
93 changes: 93 additions & 0 deletions .github/workflows/release-solid.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
name: release-solid

on:
push:
tags:
- 'solid-v*'

permissions:
contents: write

jobs:
release:
name: Build & Publish Solid Adapter
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup Java
uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '21'

- uses: actions/setup-node@v4
with:
node-version: '22'
registry-url: 'https://registry.npmjs.org'

- uses: DeLaGuardo/setup-clojure@13
with:
cli: 'latest'

- name: Setup Babashka
run: |
curl -sLO https://raw.githubusercontent.com/babashka/babashka/master/install
chmod +x install
sudo ./install --dir /usr/local/bin
bb --version

- run: npm ci

- name: Build core library
run: npm run build

- name: Derive version from tag
id: version
run: |
TAG="${GITHUB_REF_NAME}"
VERSION="${TAG#solid-v}"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"

- name: Verify version matches package.json
run: |
PKG_VERSION=$(node -p "require('./adapters/solid/package.json').version")
if [ "$PKG_VERSION" != "${{ steps.version.outputs.version }}" ]; then
echo "Tag version (${{ steps.version.outputs.version }}) does not match package.json ($PKG_VERSION)"
exit 1
fi

- name: Generate Solid wrappers
run: bb scripts/generate_solid.bb

- name: Check generated files are up to date
run: git diff --exit-code adapters/solid/src/ adapters/solid/package.json

- name: Install adapter dependencies
run: cd adapters/solid && npm install

- name: Build adapter
run: cd adapters/solid && npx tsc

- name: Publish to npm
run: |
npm config set //registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}
npm publish --workspace adapters/solid --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "@vanelsas/baredom-solid v${{ steps.version.outputs.version }}"
body: |
Solid 1.x adapter for BareDOM web components.

```bash
npm install @vanelsas/baredom-solid
```
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44 changes: 43 additions & 1 deletion docs/RELEASING.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# Releasing a New Version

Two release tracks are independent — the **core library** (`@vanelsas/baredom`) and each **framework adapter** (`@vanelsas/baredom-{react,angular,vue,svelte,solid}`) version on their own cadence.

All release-prep commits must land via PR — never push directly to main.

## Core library release

When bumping the version, update **all four** locations — they must match:

1. `package.json` — `"version": "X.Y.Z"`
Expand All @@ -14,4 +20,40 @@ Then:

The `release.yml` workflow triggers on `v*` tags and publishes to npm, Clojars, and GitHub Releases. `pom.xml` is auto-generated by `build.clj` — do not edit it manually.

All release-prep commits must land via PR — never push directly to main.
## Adapter releases

Each framework adapter lives under `adapters/<name>/` and has its own workflow in `.github/workflows/release-<name>.yml`, keyed on `<name>-v<X.Y.Z>` tags:

| Adapter | Workflow | Tag pattern |
|---------|----------|-------------|
| `@vanelsas/baredom-react` | `release-react.yml` | `react-vX.Y.Z` |
| `@vanelsas/baredom-angular` | `release-angular.yml` | `angular-vX.Y.Z` |
| `@vanelsas/baredom-vue` | `release-vue.yml` | `vue-vX.Y.Z` |
| `@vanelsas/baredom-svelte` | `release-svelte.yml` | `svelte-vX.Y.Z` |
| `@vanelsas/baredom-solid` | `release-solid.yml` | `solid-vX.Y.Z` |

To release an adapter:

1. Bump `adapters/<name>/package.json` → `"version": "X.Y.Z"`
2. Commit via PR
3. After merge: `git tag <name>-vX.Y.Z && git push origin <name>-vX.Y.Z`

The per-adapter workflow regenerates the adapter sources, fails on `git diff` drift, builds, then `npm publish --workspace adapters/<name> --access public` with the repo's `NPM_TOKEN` secret.

### First-time publish — NPM_TOKEN permission

The first time an adapter package name is published, the `NPM_TOKEN` must have permission to **create new packages** under the `@vanelsas` scope:

- **Automation token** (classic) → publishes any package the user owns. No extra config.
- **Granular access token** → check Permissions → Packages and scopes. Either grant scope-level `Read and write` on `@vanelsas`, or add each new package name to the token's allowlist *before* tagging.

If the first-publish action fails with `403 Forbidden`, the token is missing permission for the new name. Fix on npmjs.com, then delete and re-push the failed tag:

```bash
git tag -d <name>-vX.Y.Z
git push origin :refs/tags/<name>-vX.Y.Z
# fix token...
git tag <name>-vX.Y.Z && git push origin <name>-vX.Y.Z
```

`EOTP` means the token type is wrong (classic non-Automation token blocked by 2FA) — regenerate as Automation or Granular.
Loading