Files
videospeed/.github/workflows/deploy.yml
T

67 lines
2.0 KiB
YAML

name: Build & Release Firefox Addon
on:
push:
tags:
- "v*"
branches:
- dev
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install deps
run: npm install -g web-ext
- name: Lint
run: web-ext lint
# Build & release steps only run on tags (not dev branch CI pushes)
- name: Build XPI
if: startsWith(github.ref, 'refs/tags/')
run: web-ext build --overwrite-dest
- name: Rename XPI
if: startsWith(github.ref, 'refs/tags/')
id: xpi
run: |
FILE=$(ls web-ext-artifacts/*.zip | head -n 1)
XPI="web-ext-artifacts/speeder-${{ github.ref_name }}.xpi"
mv "$FILE" "$XPI"
echo "file=$XPI" >> $GITHUB_OUTPUT
# Beta tag (v*-beta) → GitHub Prerelease with XPI for self-hosting
- name: Create GitHub Release (beta)
if: contains(github.ref_name, '-beta')
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: Beta ${{ github.ref_name }}
files: ${{ steps.xpi.outputs.file }}
prerelease: true
body: |
Beta build — manual installation only.
### Installation Instructions
1. Download the `.xpi` file
2. Open Firefox and go to `about:addons`
3. Click the gear icon and select "Install Add-on From File"
4. Select the downloaded `.xpi` file
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Stable tag (v* without -beta) → Sign & submit to public AMO listing
- name: Sign & Submit to AMO (stable)
if: startsWith(github.ref, 'refs/tags/') && !contains(github.ref_name, '-beta')
run: |
web-ext sign \
--api-key ${{ secrets.FIREFOX_API_KEY }} \
--api-secret ${{ secrets.FIREFOX_API_SECRET }} \
--source-dir . \
--artifacts-dir web-ext-artifacts \
--channel listed