Files
firefox-containerbookmarks/.gitea/workflows/build.yaml
Elmar Kresse 8cc091c704
All checks were successful
Build Firefox Extension / build (push) Successful in 6s
Build Firefox Extension / release (push) Has been skipped
feat: add Gitea workflow to build and release the Firefox extension.
2026-01-20 01:04:27 +01:00

91 lines
2.4 KiB
YAML

name: Build Firefox Extension
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main
jobs:
build:
runs-on: docker
container:
image: node:20-alpine
steps:
- name: Install dependencies
run: apk add --no-cache zip jq git
- name: Checkout repository
uses: actions/checkout@v3
- name: Get version from manifest
id: version
run: |
VERSION=$(jq -r '.version' manifest.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Building version: $VERSION"
- name: Create extension package
run: |
# Create build directory
mkdir -p build
# Package the extension as XPI (which is just a ZIP file)
zip -r build/container-bookmarks-${{ steps.version.outputs.version }}.xpi \
manifest.json \
background.js \
icons/ \
popup/ \
README.md \
-x "*.git*" \
-x "*.md" \
-x "build/*" \
-x "node_modules/*" \
-x ".gitea/*"
# Also create a ZIP for convenience
cp build/container-bookmarks-${{ steps.version.outputs.version }}.xpi \
build/container-bookmarks-${{ steps.version.outputs.version }}.zip
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: container-bookmarks-${{ steps.version.outputs.version }}
path: build/*.xpi
release:
runs-on: docker
container:
image: node:20-alpine
needs: build
if: startsWith(github.ref, 'refs/tags/v')
steps:
- name: Install dependencies
run: apk add --no-cache jq git
- name: Checkout repository
uses: actions/checkout@v3
- name: Get version from manifest
id: version
run: |
VERSION=$(jq -r '.version' manifest.json)
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: Download artifact
uses: actions/download-artifact@v3
with:
name: container-bookmarks-${{ steps.version.outputs.version }}
path: build/
- name: Create Release
uses: softprops/action-gh-release@v1
with:
files: build/*.xpi
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}