feat: auto-build CI workflow, one-click install URLs, auto-update docs
- Add release.yml: builds and deploys to dist branch on push to main - Add GitHub Releases creation on version tags - Update vite.config.ts: updateURL/downloadURL point to dist branch - Update README: one-click install links for PC and Android - Add auto-update documentation (EN/RU) - Add manual install from Releases instructions - Revert dist/ from gitignore (built by CI, not committed)
This commit is contained in:
parent
3bd443dde3
commit
a2cf35b509
4 changed files with 107 additions and 22 deletions
13
.github/workflows/ci.yml
vendored
13
.github/workflows/ci.yml
vendored
|
|
@ -17,8 +17,7 @@ jobs:
|
||||||
node-version: "22"
|
node-version: "22"
|
||||||
cache: "npm"
|
cache: "npm"
|
||||||
|
|
||||||
- name: Install
|
- run: npm ci
|
||||||
run: npm ci
|
|
||||||
|
|
||||||
- name: Lint (Biome)
|
- name: Lint (Biome)
|
||||||
run: npm run lint
|
run: npm run lint
|
||||||
|
|
@ -31,13 +30,3 @@ jobs:
|
||||||
|
|
||||||
- name: Test (Vitest + Coverage)
|
- name: Test (Vitest + Coverage)
|
||||||
run: npm run test
|
run: npm run test
|
||||||
|
|
||||||
- name: Build (Vite → .user.js)
|
|
||||||
run: npm run build
|
|
||||||
|
|
||||||
- name: Upload artifact
|
|
||||||
uses: actions/upload-artifact@v4
|
|
||||||
if: github.event_name == 'push'
|
|
||||||
with:
|
|
||||||
name: opencode-voice-dictation-user-js
|
|
||||||
path: dist/*.user.js
|
|
||||||
|
|
|
||||||
54
.github/workflows/release.yml
vendored
Normal file
54
.github/workflows/release.yml
vendored
Normal file
|
|
@ -0,0 +1,54 @@
|
||||||
|
name: Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
tags: ["v*"]
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: "22"
|
||||||
|
cache: "npm"
|
||||||
|
|
||||||
|
- run: npm ci
|
||||||
|
|
||||||
|
- name: Lint
|
||||||
|
run: npm run lint
|
||||||
|
|
||||||
|
- name: Typecheck
|
||||||
|
run: npm run typecheck
|
||||||
|
|
||||||
|
- name: Knip
|
||||||
|
run: npm run knip
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm run test
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: npm run build
|
||||||
|
|
||||||
|
- name: Deploy to dist branch
|
||||||
|
uses: peaceiris/actions-gh-pages@v4
|
||||||
|
with:
|
||||||
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
publish_dir: ./dist
|
||||||
|
publish_branch: dist
|
||||||
|
keep_files: false
|
||||||
|
|
||||||
|
- name: Create GitHub Release on tag
|
||||||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
|
uses: softprops/action-gh-release@v2
|
||||||
|
with:
|
||||||
|
files: |
|
||||||
|
dist/opencode-voice-dictation.user.js
|
||||||
|
dist/opencode-voice-dictation.meta.js
|
||||||
|
generate_release_notes: true
|
||||||
58
README.md
58
README.md
|
|
@ -45,18 +45,30 @@ Voice dictation for [OpenCode](https://opencode.ai) web interface using OpenAI W
|
||||||
|
|
||||||
### Install
|
### Install
|
||||||
|
|
||||||
|
> **One-click install**: Open this link in your browser with Violentmonkey/Tampermonkey installed:
|
||||||
|
>
|
||||||
|
> **[Install Script](https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js)**
|
||||||
|
>
|
||||||
|
> Your userscript manager will intercept the download and show an installation dialog.
|
||||||
|
|
||||||
#### Desktop (Vivaldi + Violentmonkey)
|
#### Desktop (Vivaldi + Violentmonkey)
|
||||||
|
|
||||||
1. Install [Violentmonkey](https://violentmonkey.github.io/) extension in Vivaldi
|
1. Install [Violentmonkey](https://violentmonkey.github.io/) extension in Vivaldi
|
||||||
2. Open Violentmonkey dashboard → **+** → **Create new script**
|
2. Click the [Install Script](https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js) link
|
||||||
3. Paste the contents of `dist/opencode-voice-dictation.user.js`
|
3. Confirm installation in the Violentmonkey dialog
|
||||||
4. Save (Ctrl+S)
|
|
||||||
|
|
||||||
#### Android (Firefox + Tampermonkey)
|
#### Android (Firefox + Tampermonkey)
|
||||||
|
|
||||||
1. Install [Firefox for Android](https://play.google.com/store/apps/details?id=org.mozilla.firefox) from Play Store
|
1. Install [Firefox for Android](https://play.google.com/store/apps/details?id=org.mozilla.firefox) from Play Store
|
||||||
2. Install [Tampermonkey](https://addons.mozilla.org/en-US/android/addon/tampermonkey/) from Firefox Add-ons
|
2. Install [Tampermonkey](https://addons.mozilla.org/en-US/android/addon/tampermonkey/) from Firefox Add-ons
|
||||||
3. Open Tampermonkey dashboard → **+** → paste the script → Save
|
3. In Firefox, open the [Install Script](https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js) link
|
||||||
|
4. Confirm installation in the Tampermonkey dialog
|
||||||
|
|
||||||
|
#### Manual install (from GitHub Releases)
|
||||||
|
|
||||||
|
1. Go to [Releases](https://github.com/slaid098/opencode-voice-dictation/releases)
|
||||||
|
2. Download `opencode-voice-dictation.user.js` from the latest release
|
||||||
|
3. Open Violentmonkey/Tampermonkey dashboard → **+** → paste the file contents → Save
|
||||||
|
|
||||||
### Setup
|
### Setup
|
||||||
|
|
||||||
|
|
@ -65,6 +77,15 @@ Voice dictation for [OpenCode](https://opencode.ai) web interface using OpenAI W
|
||||||
3. Open Violentmonkey/Tampermonkey menu → **"Set Groq API Key"**
|
3. Open Violentmonkey/Tampermonkey menu → **"Set Groq API Key"**
|
||||||
4. Paste your key (`gsk_...`)
|
4. Paste your key (`gsk_...`)
|
||||||
|
|
||||||
|
### Auto-Update
|
||||||
|
|
||||||
|
The script updates automatically. No action needed.
|
||||||
|
|
||||||
|
- `@updateURL` checks for new versions periodically (every 24h in Tampermonkey, every 7 days in Violentmonkey)
|
||||||
|
- Only a tiny `.meta.js` (~1KB) is downloaded to check the version
|
||||||
|
- If a new version is found, the full `.user.js` (~18KB) is downloaded and installed
|
||||||
|
- Updates are published automatically by CI when code is pushed to `main`
|
||||||
|
|
||||||
### Usage
|
### Usage
|
||||||
|
|
||||||
1. Open OpenCode web in your browser
|
1. Open OpenCode web in your browser
|
||||||
|
|
@ -123,18 +144,30 @@ All settings available via the Violentmonkey/Tampermonkey menu:
|
||||||
|
|
||||||
### Установка
|
### Установка
|
||||||
|
|
||||||
|
> **Установка в один клик**: Откройте эту ссылку в браузере с установленным Violentmonkey/Tampermonkey:
|
||||||
|
>
|
||||||
|
> **[Установить скрипт](https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js)**
|
||||||
|
>
|
||||||
|
> Менеджер скриптов перехватит загрузку и покажет диалог установки.
|
||||||
|
|
||||||
#### ПК (Vivaldi + Violentmonkey)
|
#### ПК (Vivaldi + Violentmonkey)
|
||||||
|
|
||||||
1. Установите расширение [Violentmonkey](https://violentmonkey.github.io/) в Vivaldi
|
1. Установите расширение [Violentmonkey](https://violentmonkey.github.io/) в Vivaldi
|
||||||
2. Откройте панель Violentmonkey → **+** → **Создать новый скрипт**
|
2. Нажмите на ссылку [Установить скрипт](https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js)
|
||||||
3. Вставьте содержимое `dist/opencode-voice-dictation.user.js`
|
3. Подтвердите установку в диалоге Violentmonkey
|
||||||
4. Сохраните (Ctrl+S)
|
|
||||||
|
|
||||||
#### Android (Firefox + Tampermonkey)
|
#### Android (Firefox + Tampermonkey)
|
||||||
|
|
||||||
1. Установите [Firefox для Android](https://play.google.com/store/apps/details?id=org.mozilla.firefox) из Play Store
|
1. Установите [Firefox для Android](https://play.google.com/store/apps/details?id=org.mozilla.firefox) из Play Store
|
||||||
2. Установите [Tampermonkey](https://addons.mozilla.org/ru/android/addon/tampermonkey/) из дополнений Firefox
|
2. Установите [Tampermonkey](https://addons.mozilla.org/ru/android/addon/tampermonkey/) из дополнений Firefox
|
||||||
3. Откройте панель Tampermonkey → **+** → вставьте скрипт → Сохранить
|
3. В Firefox откройте ссылку [Установить скрипт](https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js)
|
||||||
|
4. Подтвердите установку в диалоге Tampermonkey
|
||||||
|
|
||||||
|
#### Ручная установка (из GitHub Releases)
|
||||||
|
|
||||||
|
1. Перейдите на страницу [Releases](https://github.com/slaid098/opencode-voice-dictation/releases)
|
||||||
|
2. Скачайте `opencode-voice-dictation.user.js` из последнего релиза
|
||||||
|
3. Откройте панель Violentmonkey/Tampermonkey → **+** → вставьте содержимое файла → Сохранить
|
||||||
|
|
||||||
### Настройка
|
### Настройка
|
||||||
|
|
||||||
|
|
@ -143,6 +176,15 @@ All settings available via the Violentmonkey/Tampermonkey menu:
|
||||||
3. Откройте меню Violentmonkey/Tampermonkey → **"Set Groq API Key"**
|
3. Откройте меню Violentmonkey/Tampermonkey → **"Set Groq API Key"**
|
||||||
4. Вставьте ваш ключ (`gsk_...`)
|
4. Вставьте ваш ключ (`gsk_...`)
|
||||||
|
|
||||||
|
### Автообновление
|
||||||
|
|
||||||
|
Скрипт обновляется автоматически. Ничего делать не нужно.
|
||||||
|
|
||||||
|
- `@updateURL` периодически проверяет новые версии (каждые 24ч в Tampermonkey, каждые 7 дней в Violentmonkey)
|
||||||
|
- Скачивается только маленький `.meta.js` (~1KB) для проверки версии
|
||||||
|
- Если найдена новая версия — скачивается полный `.user.js` (~18KB) и устанавливается
|
||||||
|
- Обновления публикуются автоматически CI при пуше в `main`
|
||||||
|
|
||||||
### Использование
|
### Использование
|
||||||
|
|
||||||
1. Откройте OpenCode web в браузере
|
1. Откройте OpenCode web в браузере
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,9 @@ export default defineConfig({
|
||||||
"run-at": "document-idle",
|
"run-at": "document-idle",
|
||||||
icon: "https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/main/assets/icon.png",
|
icon: "https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/main/assets/icon.png",
|
||||||
updateURL:
|
updateURL:
|
||||||
"https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/main/dist/opencode-voice-dictation.user.js",
|
"https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.meta.js",
|
||||||
downloadURL:
|
downloadURL:
|
||||||
"https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/main/dist/opencode-voice-dictation.user.js",
|
"https://raw.githubusercontent.com/slaid098/opencode-voice-dictation/dist/opencode-voice-dictation.user.js",
|
||||||
},
|
},
|
||||||
build: {
|
build: {
|
||||||
fileName: "opencode-voice-dictation.user.js",
|
fileName: "opencode-voice-dictation.user.js",
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue