Update README.md #4
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Extract version from tag | |
id: version | |
run: | | |
# Extraire la version du tag (ex: v1.2.3 -> 1.2.3) | |
VERSION=${GITHUB_REF#refs/tags/} | |
VERSION=${VERSION#v} | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "✅ Version extraite du tag: $VERSION" | |
- name: Update manifest version | |
run: | | |
# Extraire la version du tag (ex: v1.2.3 -> 1.2.3) | |
VERSION=${GITHUB_REF#refs/tags/} | |
VERSION=${VERSION#v} | |
# Mettre à jour le manifest.json | |
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" manifest.json | |
echo "✅ Version mise à jour dans manifest.json: $VERSION" | |
- name: Run tests | |
run: | | |
npm run build | |
npm run lint | |
npx tsc --noEmit | |
- name: Build extension | |
run: npm run build | |
- name: Upload Extension Files | |
uses: actions/upload-artifact@v4 | |
with: | |
name: extension-files-${{ steps.version.outputs.version }} | |
path: dist/**/* | |
retention-days: 30 | |
- name: Show Release Info | |
run: | | |
echo "🎉 Release préparée pour la version ${{ steps.version.outputs.version }}" | |
echo "📁 Fichiers d'extension disponibles dans les artifacts" | |
echo "📝 Téléchargez l'artifact 'extension-files-${{ steps.version.outputs.version }}' pour obtenir le ZIP" | |
echo "📦 Le ZIP contiendra tous les fichiers de l'extension prêts pour Chrome Store" | |
build-firefox-release: | |
runs-on: ubuntu-latest | |
needs: release | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Use Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: "20.x" | |
cache: "npm" | |
- name: Install dependencies | |
run: npm ci | |
- name: Extract version from tag | |
id: version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
VERSION=${VERSION#v} | |
echo "version=$VERSION" >> $GITHUB_OUTPUT | |
echo "✅ Version extraite du tag: $VERSION" | |
- name: Update manifest version | |
run: | | |
VERSION=${GITHUB_REF#refs/tags/} | |
VERSION=${VERSION#v} | |
sed -i "s/\"version\": \"[^\"]*\"/\"version\": \"$VERSION\"/" manifest.json | |
echo "✅ Version mise à jour dans manifest.json: $VERSION" | |
- name: Build extension | |
run: npm run build | |
- name: Build Firefox extension | |
run: npm run build:firefox | |
- name: Verify Firefox build | |
run: | | |
if [ ! -d "web-ext-artifacts" ]; then | |
echo "❌ Firefox build directory 'web-ext-artifacts' not found" | |
exit 1 | |
fi | |
if ! ls web-ext-artifacts/*.zip 1> /dev/null 2>&1; then | |
echo "❌ No .zip file found in web-ext-artifacts directory" | |
exit 1 | |
fi | |
echo "✅ Firefox extension build successful" | |
ls -la web-ext-artifacts/ | |
- name: Upload Firefox Release Artifacts | |
uses: actions/upload-artifact@v4 | |
with: | |
name: firefox-extension-${{ steps.version.outputs.version }} | |
path: web-ext-artifacts/**/* | |
retention-days: 90 | |
- name: Show Firefox Release Info | |
run: | | |
echo "🦊 Firefox extension release préparée pour la version ${{ steps.version.outputs.version }}" | |
echo "📁 Fichiers Firefox disponibles dans les artifacts" | |
echo "📝 Téléchargez l'artifact 'firefox-extension-${{ steps.version.outputs.version }}' pour obtenir le ZIP Firefox" | |
echo "📦 Le ZIP contiendra l'extension prête pour Firefox Add-ons Store" |