From c1154a58d5ea809a4653db46763e988eaf16156c Mon Sep 17 00:00:00 2001 From: Mark Rapson Date: Sun, 19 Jul 2026 10:02:21 +0100 Subject: [PATCH] fix: correct github release mirroring --- .gitea/workflows/build.yml | 14 +++++++++----- package.json | 2 +- readme.md | 3 ++- 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index 346607b..92f308c 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -39,10 +39,9 @@ jobs: files: dist/*.exe - name: Mirror release to GitHub - if: ${{ env.GITHUB_RELEASE_REPO != '' && env.GITHUB_TOKEN != '' }} env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - GITHUB_RELEASE_REPO: ${{ secrets.GITHUB_RELEASE_REPO }} + GITHUB_TOKEN: ${{ secrets.RELEASE_GITHUB_TOKEN }} + RELEASE_GITHUB_REPO: ${{ secrets.RELEASE_GITHUB_REPO }} run: | python - <<'PY' import json @@ -52,8 +51,13 @@ jobs: import urllib.parse import urllib.request - token = os.environ["GITHUB_TOKEN"] - repository = os.environ["GITHUB_RELEASE_REPO"] + token = os.environ.get("GITHUB_TOKEN", "") + repository = os.environ.get("RELEASE_GITHUB_REPO", "") + + if not token or not repository: + print("Skipping GitHub mirror because RELEASE_GITHUB_REPO or RELEASE_GITHUB_TOKEN is missing.") + raise SystemExit(0) + tag = os.environ["BUILD_VERSION"] release_name = f"gSheets-Rate-Assistant {tag}" asset_path = next((os.path.join("dist", name) for name in os.listdir("dist") if name.endswith(".exe")), None) diff --git a/package.json b/package.json index 28c7e02..b8ff63d 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "google-sheets-rate-assistant", - "version": "2.1.7", + "version": "2.1.8", "description": "Pull Google Sheets data and export to CSV with configurable schedules and rate limiting.", "main": "index.js", "bin": "index.js", diff --git a/readme.md b/readme.md index 55a3ce1..0f46170 100644 --- a/readme.md +++ b/readme.md @@ -71,9 +71,10 @@ To build a Windows executable from source, run: npm run build:win ``` -That creates `dist/gSheets-Rate-Assistant-v2.1.7.exe` using the current version in the filename. For distribution, ship the exe alongside a `config.json` and any service account credential files, or set `GSA_CONFIG` to point at a different config file. +That creates `dist/gSheets-Rate-Assistant-v2.1.8.exe` using the current version in the filename. For distribution, ship the exe alongside a `config.json` and any service account credential files, or set `GSA_CONFIG` to point at a different config file. Gitea now builds only on version tags like `v1.1.1` through the workflow in `.gitea/workflows/build.yml`. +If you also want the same tag to create a GitHub release, add `RELEASE_GITHUB_TOKEN` and `RELEASE_GITHUB_REPO` as secrets in Gitea so the workflow can mirror the release and upload the Windows asset to GitHub. ## AI Disclosure