Skip to content

Commit 83afe17

Browse files
committed
feat(extension): add releases section, update extension build instructions, and enhance package scripts for multi-browser support
1 parent cd77cb0 commit 83afe17

4 files changed

Lines changed: 309 additions & 6 deletions

File tree

.github/workflows/release.yml

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: Release Extension
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: "Version to release (e.g., v1.0.0)"
11+
required: true
12+
type: string
13+
14+
jobs:
15+
build-and-release:
16+
name: Build Extension and Create Release
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
packages: write
21+
22+
steps:
23+
- name: Checkout code
24+
uses: actions/checkout@v4
25+
26+
- name: Setup pnpm
27+
uses: pnpm/action-setup@v2
28+
with:
29+
version: latest
30+
31+
- name: Setup Node.js
32+
uses: actions/setup-node@v4
33+
with:
34+
node-version: "18"
35+
cache: "pnpm"
36+
37+
- name: Install dependencies
38+
run: pnpm install --frozen-lockfile
39+
40+
- name: Build extension for Chrome (MV3)
41+
run: |
42+
cd apps/extension
43+
pnpm build --target=chrome-mv3
44+
45+
- name: Build extension for Firefox
46+
run: |
47+
cd apps/extension
48+
pnpm build --target=firefox-mv2
49+
50+
- name: Package Chrome extension
51+
run: |
52+
cd apps/extension
53+
pnpm package --target=chrome-mv3
54+
55+
- name: Package Firefox extension
56+
run: |
57+
cd apps/extension
58+
pnpm package --target=firefox-mv2
59+
60+
- name: Get version from tag or input
61+
id: version
62+
run: |
63+
if [ "${{ github.event_name }}" == "workflow_dispatch" ]; then
64+
echo "version=${{ github.event.inputs.version }}" >> $GITHUB_OUTPUT
65+
else
66+
echo "version=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
67+
fi
68+
69+
- name: Rename build artifacts
70+
run: |
71+
cd apps/extension
72+
# Create releases directory
73+
mkdir -p releases
74+
75+
# Copy and rename Chrome build
76+
if [ -f "build/chrome-mv3-prod.zip" ]; then
77+
cp "build/chrome-mv3-prod.zip" "releases/lgamila-live-${{ steps.version.outputs.version }}-chrome.zip"
78+
fi
79+
80+
# Copy and rename Firefox build
81+
if [ -f "build/firefox-mv2-prod.zip" ]; then
82+
cp "build/firefox-mv2-prod.zip" "releases/lgamila-live-${{ steps.version.outputs.version }}-firefox.zip"
83+
fi
84+
85+
# List created files for verification
86+
ls -la releases/
87+
88+
- name: Create Release
89+
uses: softprops/action-gh-release@v1
90+
with:
91+
tag_name: ${{ steps.version.outputs.version }}
92+
name: LGamila Live ${{ steps.version.outputs.version }}
93+
body: |
94+
## LGamila Live Extension ${{ steps.version.outputs.version }}
95+
96+
Download the extension for your browser:
97+
98+
### 🌟 Chrome Extension
99+
- Download: `lgamila-live-${{ steps.version.outputs.version }}-chrome.zip`
100+
- Install: Unzip and load as unpacked extension in Chrome Developer Mode
101+
102+
### 🦊 Firefox Extension
103+
- Download: `lgamila-live-${{ steps.version.outputs.version }}-firefox.zip`
104+
- Install: Load as temporary add-on in Firefox about:debugging
105+
106+
### 📋 Installation Instructions
107+
108+
#### Chrome:
109+
1. Download the Chrome zip file
110+
2. Unzip the file to a folder
111+
3. Open Chrome and go to `chrome://extensions/`
112+
4. Enable "Developer mode" in the top right
113+
5. Click "Load unpacked" and select the unzipped folder
114+
115+
#### Firefox:
116+
1. Download the Firefox zip file
117+
2. Unzip the file to a folder
118+
3. Open Firefox and go to `about:debugging`
119+
4. Click "This Firefox" on the left
120+
5. Click "Load Temporary Add-on" and select the manifest.json from the unzipped folder
121+
122+
### 🚀 Features
123+
- Real-time tracking of Moroccan streamers on Twitch and Kick
124+
- Live notification when streamers go online
125+
- Search and filter functionality
126+
- Clean, modern interface
127+
128+
### 🐛 Bug Reports
129+
If you encounter any issues, please [report them here](https://github.com/stormix/moroccan-stream/issues).
130+
files: |
131+
apps/extension/releases/lgamila-live-${{ steps.version.outputs.version }}-chrome.zip
132+
apps/extension/releases/lgamila-live-${{ steps.version.outputs.version }}-firefox.zip
133+
draft: false
134+
prerelease: false
135+
env:
136+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
137+
138+
- name: Upload Chrome artifact
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: chrome-extension
142+
path: apps/extension/releases/lgamila-live-${{ steps.version.outputs.version }}-chrome.zip
143+
144+
- name: Upload Firefox artifact
145+
uses: actions/upload-artifact@v4
146+
with:
147+
name: firefox-extension
148+
path: apps/extension/releases/lgamila-live-${{ steps.version.outputs.version }}-firefox.zip

README.md

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,11 @@ A comprehensive platform for discovering and tracking Moroccan streamers on Twit
2525
- [Prerequisites](#prerequisites)
2626
- [Installation](#installation)
2727
5. [Usage](#usage)
28-
6. [Contributing](#contributing)
29-
7. [License](#license)
30-
8. [Contact](#contact)
31-
9. [Acknowledgments](#acknowledgments)
28+
6. [Releases](#releases)
29+
7. [Contributing](#contributing)
30+
8. [License](#license)
31+
9. [Contact](#contact)
32+
10. [Acknowledgments](#acknowledgments)
3233

3334
## About the Project
3435

@@ -133,10 +134,16 @@ The backend provides a REST API for accessing streamer data:
133134

134135
### Browser Extension
135136

136-
1. Build the extension: `pnpm --filter extension build`
137-
2. Load the extension in Chrome from `apps/extension/build/chrome-mv3-prod`
137+
1. Build the extension: `pnpm --filter extension build:all`
138+
2. Load the extension in your browser:
139+
- **Chrome**: Load from `apps/extension/build/chrome-mv3-prod`
140+
- **Firefox**: Load from `apps/extension/build/firefox-mv2-prod`
138141
3. The extension will show live Moroccan streamers in the popup
139142

143+
#### Download Pre-built Extension
144+
145+
You can also download pre-built extension files from our [GitHub Releases](https://github.com/stormix/moroccan-stream/releases).
146+
140147
### Web Platform
141148

142149
Visit the web platform to:
@@ -145,6 +152,21 @@ Visit the web platform to:
145152
- Suggest streamers to be added to the platform
146153
- Learn about the project
147154

155+
## Releases
156+
157+
Extension releases are automatically built and published via GitHub Actions. Each release includes:
158+
159+
- **Chrome Extension** (Manifest V3) - Compatible with Chrome, Edge, and Chromium browsers
160+
- **Firefox Extension** (Manifest V2) - Compatible with Firefox
161+
162+
### Download Latest Release
163+
164+
Visit our [GitHub Releases page](https://github.com/stormix/moroccan-stream/releases) to download the latest extension builds.
165+
166+
### Creating Releases
167+
168+
For maintainers, see [RELEASING.md](RELEASING.md) for detailed release instructions.
169+
148170
## Contributing
149171

150172
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are **greatly appreciated**.

RELEASING.md

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
# Release Guide
2+
3+
This document outlines how to create releases for the LGamila project.
4+
5+
## Browser Extension Releases
6+
7+
The project includes an automated GitHub Actions workflow that builds the browser extension for both Chrome and Firefox and publishes it as a GitHub release.
8+
9+
### Automated Release (Recommended)
10+
11+
#### Via Git Tags
12+
13+
1. **Update the version** in `apps/extension/package.json`
14+
2. **Commit your changes**:
15+
```bash
16+
git add apps/extension/package.json
17+
git commit -m "chore: bump extension version to v1.0.1"
18+
```
19+
3. **Create and push a git tag**:
20+
```bash
21+
git tag v1.0.1
22+
git push origin v1.0.1
23+
```
24+
4. **The workflow will automatically**:
25+
- Build the extension for Chrome (MV3) and Firefox (MV2)
26+
- Package both builds into zip files
27+
- Create a GitHub release with both files attached
28+
- Include detailed installation instructions
29+
30+
#### Via Manual Trigger
31+
32+
1. Go to the [Actions tab](https://github.com/stormix/moroccan-stream/actions) on GitHub
33+
2. Select the "Release Extension" workflow
34+
3. Click "Run workflow"
35+
4. Enter the version (e.g., `v1.0.1`)
36+
5. Click "Run workflow"
37+
38+
### Manual Release (Local Build)
39+
40+
If you need to build releases locally:
41+
42+
```bash
43+
# Navigate to extension directory
44+
cd apps/extension
45+
46+
# Build for both browsers
47+
pnpm build:all
48+
49+
# Package for both browsers
50+
pnpm package:all
51+
52+
# Files will be created in:
53+
# - build/chrome-mv3-prod.zip (Chrome)
54+
# - build/firefox-mv2-prod.zip (Firefox)
55+
```
56+
57+
## Release Workflow Details
58+
59+
The release workflow (`.github/workflows/release.yml`) performs the following steps:
60+
61+
1. **Environment Setup**: Installs Node.js, pnpm, and project dependencies
62+
2. **Multi-Browser Build**:
63+
- Builds extension for Chrome (Manifest V3)
64+
- Builds extension for Firefox (Manifest V2)
65+
3. **Packaging**: Creates zip files for both browser builds
66+
4. **Release Creation**: Creates a GitHub release with:
67+
- Proper semantic versioning
68+
- Detailed release notes
69+
- Installation instructions for both browsers
70+
- Both browser builds attached as assets
71+
72+
## Browser-Specific Notes
73+
74+
### Chrome (Manifest V3)
75+
76+
- Uses the latest Manifest V3 format
77+
- Supports all modern Chrome extension APIs
78+
- Compatible with Chrome, Edge, and other Chromium-based browsers
79+
80+
### Firefox (Manifest V2)
81+
82+
- Uses Manifest V2 for Firefox compatibility
83+
- Includes Firefox-specific adaptations
84+
- Tested with Firefox Developer Edition
85+
86+
## Version Management
87+
88+
- Extension version is managed in `apps/extension/package.json`
89+
- Git tags should follow semantic versioning (e.g., `v1.0.0`, `v1.0.1`, `v1.1.0`)
90+
- Release notes are automatically generated with installation instructions
91+
92+
## Testing Releases
93+
94+
Before creating a release:
95+
96+
1. **Test locally**:
97+
98+
```bash
99+
cd apps/extension
100+
pnpm build:all
101+
```
102+
103+
2. **Load both builds** in their respective browsers to ensure functionality
104+
105+
3. **Verify all features** work correctly in both browsers
106+
107+
## Troubleshooting
108+
109+
### Workflow Fails
110+
111+
- Check that all dependencies are properly listed
112+
- Ensure `apps/extension/package.json` has the correct version
113+
- Verify Plasmo build commands work locally
114+
115+
### Missing Browser Builds
116+
117+
- Confirm Plasmo supports the target browser
118+
- Check build logs for any browser-specific errors
119+
- Ensure all required permissions are set in manifest
120+
121+
### Release Creation Issues
122+
123+
- Verify GitHub token has proper permissions
124+
- Check that tag format matches workflow triggers
125+
- Ensure no existing release exists with the same tag

apps/extension/package.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,16 @@
66
"author": "Stormix <hello@stormix.dev>",
77
"scripts": {
88
"dev": "plasmo dev",
9+
"dev:chrome": "plasmo dev --target=chrome-mv3",
10+
"dev:firefox": "plasmo dev --target=firefox-mv2",
911
"build": "plasmo build",
12+
"build:chrome": "plasmo build --target=chrome-mv3",
13+
"build:firefox": "plasmo build --target=firefox-mv2",
1014
"package": "plasmo package",
15+
"package:chrome": "plasmo package --target=chrome-mv3",
16+
"package:firefox": "plasmo package --target=firefox-mv2",
17+
"build:all": "pnpm build:chrome && pnpm build:firefox",
18+
"package:all": "pnpm package:chrome && pnpm package:firefox",
1119
"lint": "npx ultracite lint",
1220
"format": "npx ultracite format",
1321
"check-types": "tsc --noEmit --skipLibCheck"

0 commit comments

Comments
 (0)