From 553506c02b29300fb63f378a27b6c9b5c5a5bde1 Mon Sep 17 00:00:00 2001 From: Space-Banane Date: Tue, 17 Feb 2026 16:08:53 +0100 Subject: [PATCH] Remove old CI workflow and add new CI configuration with version bumping and publishing steps --- .gitea/workflows/.gitea-ci.yml | 30 --------------- .gitea/workflows/ci.yml | 70 ++++++++++++++++++++++++++++++++++ manifest.json | 2 + package.json | 19 +++++++++ 4 files changed, 91 insertions(+), 30 deletions(-) delete mode 100644 .gitea/workflows/.gitea-ci.yml create mode 100644 .gitea/workflows/ci.yml create mode 100644 package.json diff --git a/.gitea/workflows/.gitea-ci.yml b/.gitea/workflows/.gitea-ci.yml deleted file mode 100644 index 9bfd1cd..0000000 --- a/.gitea/workflows/.gitea-ci.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: CI - -on: - push: - branches: - - main - - master - pull_request: - branches: - - main - - master - -jobs: - build: - runs-on: node-24 - - steps: - - name: Checkout code - uses: actions/checkout@v4 - - - name: Setup Node.js 24 - uses: actions/setup-node@v4 - with: - node-version: '24' - - - name: Install web-ext - run: npm install -g web-ext - - - name: web-ext lint - run: web-ext lint -v \ No newline at end of file diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..04f0b3c --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,70 @@ +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + +jobs: + build-and-publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: '24' + cache: 'npm' + + - run: npm ci + + - name: web-ext lint + run: npx web-ext lint -v + + - name: Increment Version and Push + if: github.event_name == 'push' # Only push back on actual merges/pushes, not PRs + run: | + # 1. Increment logic + VERSION=$(jq -r '.version' manifest.json) + BASE=$(echo $VERSION | cut -d. -f1-2) + PATCH=$(echo $VERSION | cut -d. -f3) + NEW_VERSION="$BASE.$((PATCH + 1))" + + # Update manifest.json version + jq ".version = \"$NEW_VERSION\"" manifest.json > temp.manifest.json && mv temp.manifest.json manifest.json + + # Keep package.json version in sync, if present + if [ -f package.json ]; then + jq ".version = \"$NEW_VERSION\"" package.json > temp.package.json && mv temp.package.json package.json + fi + + # 2. Git Config + git config --local user.email "space@reversed.dev" + git config --local user.name "space" + + # 3. Commit and Push + git add manifest.json package.json + git commit -m "chore: bump version to $NEW_VERSION [skip ci]" + git push + + - name: web-ext build + run: npx web-ext build -s . -a dist --overwrite-dest + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: web-ext-build + path: dist/ + + - name: Publish to Mozilla Add-ons + if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master') + run: | + # Ensure dependencies are available (npm ci ran earlier in this job) + npx web-ext sign \ + --api-key ${{ secrets.MOZILLA_ADDON_API_KEY }} \ + --api-secret ${{ secrets.MOZILLA_ADDON_API_SECRET }} \ + --channel listed \ + --source-dir dist \ + --artifacts-dir dist \ + --overwrite-dest diff --git a/manifest.json b/manifest.json index 37a8e42..e6f58d5 100644 --- a/manifest.json +++ b/manifest.json @@ -2,6 +2,8 @@ "manifest_version": 2, "name": "vinted-favs-price", "version": "1.2.0", + "categories": { "firefox": ["shopping"] }, + "requires_payment": false, "content_scripts": [ { "matches": ["https://www.vinted.de/member/items/favourite_list"], diff --git a/package.json b/package.json new file mode 100644 index 0000000..20355d7 --- /dev/null +++ b/package.json @@ -0,0 +1,19 @@ +{ + "name": "vinted-favs-price", + "version": "1.2.0", + "description": "Firefox extension to track Vinted favorite prices.", + "main": "index.js", + "scripts": { + "start": "web-ext run", + "lint": "web-ext lint", + "build": "web-ext build -s . -a dist --overwrite-dest", + "sign": "web-ext sign" + }, + "devDependencies": { + "web-ext": "^8.0.0" + }, + "engines": { + "node": ">=24.0.0" + }, + "private": true +} \ No newline at end of file