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

# Pushing a tag such as v0.1.0 builds the store package and attaches it to a
# GitHub Release, so every uploaded version stays downloadable.
on:
push:
tags: ["v*"]

permissions:
contents: write

jobs:
package:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm

- name: Check the tag matches the manifest version
run: |
manifest=$(jq -r .version public/manifest.json)
pkg=$(jq -r .version package.json)
echo "Tag: $GITHUB_REF_NAME, manifest: $manifest, package.json: $pkg"
test "$GITHUB_REF_NAME" = "v$manifest"
test "$pkg" = "$manifest"
echo "VERSION=$manifest" >> "$GITHUB_ENV"

- run: npm ci
- run: npm run check
- run: npm run build
- run: npm run firefox:lint

- name: Zip the contents of dist/
run: |
(cd dist && zip -qrX "../spectral-$VERSION.zip" .)
unzip -l "spectral-$VERSION.zip"

- name: Create the release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "$GITHUB_REF_NAME" "spectral-$VERSION.zip" \
--title "Spectral $VERSION" --generate-notes --verify-tag
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ tests; see [AGENTS.md](AGENTS.md) for the architecture and conventions, and
├── dependabot.yml # npm and GitHub Actions updates
└── workflows/
├── ci.yml # check, build, Firefox lint and end-to-end tests
├── release.yml # on a v* tag: store zip attached to a GitHub Release
└── safari.yml # on demand: unsigned iOS app with the Safari extension
```

Expand Down
20 changes: 17 additions & 3 deletions docs/STORE-LISTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,23 @@ ask for nearly the same.

## Package

The version in the store is the `version` of `public/manifest.json`; it must
increase with every upload. Keep `package.json` on the same version.

To release, bump both versions on a branch, merge it, then tag the merge
commit on `main`:

```
git tag v0.2.0
git push origin v0.2.0
```

The `Release` workflow checks that the tag matches both versions, runs the
checks, builds, and attaches `spectral-<version>.zip` to a GitHub Release.
Upload that file to the store as it is.

To build the package by hand instead:

```
npm ci
npm run build
Expand All @@ -15,9 +32,6 @@ Zip the **contents** of `dist/` (the `manifest.json` at the root of the
archive, not inside a folder). The result for `0.1.0` is about 21 KB and
holds nine files. `store/*.zip` is ignored by git.

The version in the store is the `version` of `public/manifest.json`; it must
increase with every upload.

## Texts

**Name:** Spectral
Expand Down
Loading