diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..d35f49c --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,47 @@ +name: Release + +# Shipping is one command: tag a version and push the tag. +# git tag v0.1.1 && git push origin v0.1.1 +# This builds the extension, zips dist/, and publishes a GitHub Release +# with the zip attached and auto-generated notes. +on: + push: + tags: ['v*'] + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: npm + + - run: npm ci + + - name: Verify tag matches manifest version + run: | + V=$(node -p "require('./public/manifest.json').version") + if [ "v$V" != "$GITHUB_REF_NAME" ]; then + echo "Tag $GITHUB_REF_NAME does not match manifest version v$V" >&2 + exit 1 + fi + + - name: Typecheck, test, build + run: npm run ci + + - name: Package unpacked extension + run: | + cd dist + zip -r "../ration-${GITHUB_REF_NAME}.zip" . + + - name: Publish GitHub release + uses: softprops/action-gh-release@v2 + with: + files: ration-*.zip + generate_release_notes: true diff --git a/README.md b/README.md index 9d5683a..1f9bf5c 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,16 @@ dashboards already live. Adding a provider is designed to be a single-file contribution — see [CONTRIBUTING.md](CONTRIBUTING.md). -## Install (unpacked, v0.1) +## Install + +**Option A — from a release (no build tools needed):** + +1. Download `ration-vX.Y.Z.zip` from the + [latest release](https://github.com/devudilip/ration/releases/latest) + and unzip it. +2. Follow the browser steps below, selecting the unzipped folder. + +**Option B — build from source:** ```sh git clone https://github.com/devudilip/ration.git @@ -46,7 +55,8 @@ npm run build Then in Chrome (or any Chromium browser): 1. Open `chrome://extensions`, enable **Developer mode**. -2. **Load unpacked** → select the `dist/` folder. +2. **Load unpacked** → select the `dist/` folder (or the unzipped release + folder). 3. Click the Ration icon and toggle on the providers you use. Each toggle asks for permission to that provider's site only, at that moment. 4. You must be logged into the provider's site in this browser — Ration