Forgejo Actions: run the weekly update here, same behavior as GitHub #1

Merged
Aareon merged 1 commit from claude/forgejo-actions into main 2026-10-09 10:27:21 -05:00
Collaborator

Runs the weekly GeoNames update on Forgejo itself, so this repo no longer depends on GitHub. Behavior is the same as .github/workflows/update_allCountries.yml: every Sunday at 00:00 UTC it downloads allCountries.zip and publishes release <branch>-<n>, with the zip and the same notes.

Merge method: Fast-forward only, one commit on current main.

Changes

  • .forgejo/workflows/update_allCountries.yml (new): a step-for-step port of the GitHub workflow, on the Unraid runner as runs-on: ubuntu-latest. While .forgejo/workflows/ exists, Forgejo ignores .github/, and GitHub ignores .forgejo/. Each difference from the GitHub workflow is forced by Forgejo:
    • Release number: n = run_number + 114. This repo's run counter starts at 1, but the releases copied from GitHub end at main-114, so the first scheduled release here is main-115 or later.
    • Publishing: forgejo-release@v2.13.4 creates the release, instead of softprops/action-gh-release, which only talks to GitHub's API. The notes go through a file, not an expression, so their backticks never reach a shell.
    • Outputs: written to $FORGEJO_OUTPUT (runner v13). Artifacts use forgejo/upload-artifact@v4.
    • Manual runs take a dry_run input that does everything except publish.
  • update_allCountries.py: the releases URL comes from RELEASES_API_URL, with the GitHub URL as the default, so the GitHub workflow is unaffected. I also removed the duplicate URL constant inside get_previous_checksum. The file keeps its CRLF line endings.

Kept as-is on purpose

get_previous_checksum never matches, because the notes wrap the MD5 in backticks and the regex does not allow for them. So every successful run publishes a release, as on GitHub. Aareon chose to keep that behavior (2026-10-09).

After merge

  • The schedule only exists once the file is on main. The first scheduled run is Sunday 2026-10-11, 00:00 UTC.
  • No secret is needed: the job uses its own automatic token.

Tested

  • update_allCountries.py from this branch, run locally on Python 3.10 with RELEASES_API_URL pointed at this repo's Forgejo API:
    • downloaded 18.79 MB and counted 1,826,905 entries in 121 countries;
    • reached the Forgejo releases API (Bearer auth was accepted) and logged the same "MD5 checksum not found" warning the GitHub runs do;
    • wrote update_status.txt = update and notes in the same format.
  • The runner's ubuntu-latest image (catthehacker/ubuntu:act-24.04) has Python 3.12, pip, venv and node 24. actions/setup-python, actions/checkout and forgejo/upload-artifact all resolve from data.forgejo.org.
  • Git history and all 105 tags and 102 releases are intact after the mirror was converted.
  • Runner tests on this branch: results to follow in a comment.

Not tested

  • The schedule trigger itself. It only registers from main; the first real one is Sunday.

🤖 Generated with Aki acting as Claude (Agent: Aki)

Runs the weekly GeoNames update on Forgejo itself, so this repo no longer depends on GitHub. Behavior is the same as `.github/workflows/update_allCountries.yml`: every Sunday at 00:00 UTC it downloads `allCountries.zip` and publishes release `<branch>-<n>`, with the zip and the same notes. **Merge method:** Fast-forward only, one commit on current `main`. ## Changes - **`.forgejo/workflows/update_allCountries.yml`** (new): a step-for-step port of the GitHub workflow, on the Unraid runner as `runs-on: ubuntu-latest`. While `.forgejo/workflows/` exists, Forgejo ignores `.github/`, and GitHub ignores `.forgejo/`. Each difference from the GitHub workflow is forced by Forgejo: - **Release number:** `n` = `run_number + 114`. This repo's run counter starts at 1, but the releases copied from GitHub end at `main-114`, so the first scheduled release here is `main-115` or later. - **Publishing:** `forgejo-release@v2.13.4` creates the release, instead of `softprops/action-gh-release`, which only talks to GitHub's API. The notes go through a file, not an expression, so their backticks never reach a shell. - **Outputs:** written to `$FORGEJO_OUTPUT` (runner v13). Artifacts use `forgejo/upload-artifact@v4`. - **Manual runs** take a `dry_run` input that does everything except publish. - **`update_allCountries.py`:** the releases URL comes from `RELEASES_API_URL`, with the GitHub URL as the default, so the GitHub workflow is unaffected. I also removed the duplicate URL constant inside `get_previous_checksum`. The file keeps its CRLF line endings. ## Kept as-is on purpose `get_previous_checksum` never matches, because the notes wrap the MD5 in backticks and the regex does not allow for them. So every successful run publishes a release, as on GitHub. Aareon chose to keep that behavior (2026-10-09). ## After merge - The schedule only exists once the file is on `main`. The first scheduled run is Sunday 2026-10-11, 00:00 UTC. - **No secret is needed:** the job uses its own automatic token. ## Tested - `update_allCountries.py` from this branch, run locally on Python 3.10 with `RELEASES_API_URL` pointed at this repo's Forgejo API: - downloaded 18.79 MB and counted 1,826,905 entries in 121 countries; - reached the Forgejo releases API (`Bearer` auth was accepted) and logged the same "MD5 checksum not found" warning the GitHub runs do; - wrote `update_status.txt` = `update` and notes in the same format. - The runner's `ubuntu-latest` image (`catthehacker/ubuntu:act-24.04`) has Python 3.12, pip, venv and node 24. `actions/setup-python`, `actions/checkout` and `forgejo/upload-artifact` all resolve from data.forgejo.org. - Git history and all 105 tags and 102 releases are intact after the mirror was converted. - Runner tests on this branch: results to follow in a comment. ## Not tested - The schedule trigger itself. It only registers from `main`; the first real one is Sunday. 🤖 Generated with Aki acting as Claude (Agent: Aki)
.forgejo/workflows/update_allCountries.yml ports the GitHub workflow step
for step: Sunday 00:00 UTC, release <branch>-<n> with allCountries.zip and
the same notes. Forced differences: n = run_number + 114 to continue after
the main-114 copied from GitHub; forgejo-release instead of the GitHub-only
softprops action; outputs via FORGEJO_OUTPUT. update_allCountries.py now
reads the previous release from RELEASES_API_URL (default unchanged: the
GitHub API). Manual runs take dry_run to skip publishing.

Agent: Aki
Author
Collaborator

Runner tests on claude/forgejo-actions (3c51288):

  1. Run 1, dry_run=true, success.
    • setup-python installed CPython 3.10.22, and the deps installed.
    • The script downloaded 18.79 MB and read this repo's releases with the automatic token. It logged the same "MD5 checksum not found" warning as GitHub, then reported update.
    • The release name came out as claude/forgejo-actions-115, so the +114 offset works.
    • Create Release was skipped, as it should be, and the release-notes artifact uploaded.
  2. Run 2, dry_run=false, success.
    • forgejo-release published claude/forgejo-actions-116 with the automatic token, so no secret is needed. It was not a draft or a prerelease.
    • Title: "GeoNames Database Update - 2026-10-09".
    • The notes match the GitHub format exactly: backticks kept, no trailing newline.
    • allCountries.zip is 19,700,298 bytes, and the MD5 of the downloaded file (2e9a381a…) matches the one in the notes.

I deleted the test release and its tag afterwards. The repo is back to 102 releases and 105 tags.

Still untested: the schedule trigger, which registers only from main. The first real run is Sunday 2026-10-11 00:00 UTC, run #3, so release main-117. main-115 and main-116 are skipped, the same way failed runs left gaps on GitHub.

**Runner tests on `claude/forgejo-actions` (3c51288):** 1. **Run 1, `dry_run=true`, success.** - `setup-python` installed CPython 3.10.22, and the deps installed. - The script downloaded 18.79 MB and read this repo's releases with the automatic token. It logged the same "MD5 checksum not found" warning as GitHub, then reported `update`. - The release name came out as `claude/forgejo-actions-115`, so the `+114` offset works. - Create Release was skipped, as it should be, and the `release-notes` artifact uploaded. 2. **Run 2, `dry_run=false`, success.** - `forgejo-release` published `claude/forgejo-actions-116` with the automatic token, so no secret is needed. It was not a draft or a prerelease. - Title: "GeoNames Database Update - 2026-10-09". - The notes match the GitHub format exactly: backticks kept, no trailing newline. - `allCountries.zip` is 19,700,298 bytes, and the MD5 of the downloaded file (`2e9a381a…`) matches the one in the notes. I deleted the test release and its tag afterwards. The repo is back to 102 releases and 105 tags. **Still untested:** the `schedule` trigger, which registers only from `main`. The first real run is Sunday 2026-10-11 00:00 UTC, run #3, so release **`main-117`**. `main-115` and `main-116` are skipped, the same way failed runs left gaps on GitHub.
Aareon merged commit 3c51288324 into main 2026-10-09 10:27:21 -05:00
Aareon deleted branch claude/forgejo-actions 2026-10-09 10:27:21 -05:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Aareon/GeoNamesMirror!1
No description provided.