Compare commits
61
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f29d4a7e85 | ||
|
|
73ae7fb17c | ||
|
|
d0c1d411d3
|
||
|
|
2fa31bb8ef | ||
|
|
fcf83b8a9e
|
||
|
|
826c9e65d5
|
||
|
|
31794691e2 | ||
|
|
4639777798 | ||
|
|
644d04df7d
|
||
|
|
82fcdd1096 | ||
|
|
6fd21bfab4 | ||
|
|
e6084f031e | ||
|
|
497fb914a1
|
||
|
|
b93b3711b3 | ||
|
|
1a3f5d92e0
|
||
|
|
32c41e9433
|
||
|
|
1add936767 | ||
|
|
388bff999a
|
||
|
|
327b92e67a
|
||
|
|
9ef75e0898 | ||
|
|
cb2d304168 | ||
|
|
2ec39d75ba | ||
|
|
8cd5f84859 | ||
|
|
5cd13da233 | ||
|
|
2692572401
|
||
|
|
5b967e417f | ||
|
|
e910cce543 | ||
|
|
37e6d7d729 | ||
|
|
1a4db37f03 | ||
|
|
c3f5b43459 | ||
|
|
f37627518e | ||
|
|
76f8a8a055
|
||
|
|
18f3d7d709 | ||
|
|
7ad3616f24
|
||
|
|
872107131f
|
||
|
|
c133a00dc7 | ||
|
|
a3660e46d8
|
||
|
|
6b8ddf4830 | ||
|
|
462f117f37 | ||
|
|
3f473c337b | ||
|
|
68d5a4ded6
|
||
|
|
8a4c27a9f8
|
||
|
|
3e4cf6b431
|
||
|
|
6d70c16123
|
||
|
|
738634f326
|
||
|
|
3745faa9c1
|
||
|
|
cf307aa937
|
||
|
|
631b2f8aba
|
||
|
|
826e4bd0d4
|
||
|
|
966549d128
|
||
|
|
8e6582af9a | ||
|
|
a133c85607
|
||
|
|
79b57af093
|
||
|
|
fd04dfe08f
|
||
|
|
50e7724cb5
|
||
|
|
c09a89c4be
|
||
|
|
cd34ce42c7
|
||
|
|
f70468e995
|
||
|
|
a008740625 | ||
|
|
e8952ee548
|
||
|
|
13dd8434cf
|
No files matched your search
@@ -14,7 +14,8 @@ name: Reusable — Announce Release to Discord
|
||||
# uses: poli0981/.github/.gitea/workflows/announce-release.yml@<full-sha> # ops vYYYY.MM.N
|
||||
# with:
|
||||
# tag_override: ${{ inputs.tag }}
|
||||
# secrets: # explicit; `secrets: inherit` is VERIFY on Gitea
|
||||
# ops_ref: <full-sha> # the same SHA as `uses:`
|
||||
# secrets: # explicit, as the runbook asks (Gitea also has `inherit`)
|
||||
# DISCORD_RELEASES_WEBHOOK: ${{ secrets.DISCORD_RELEASES_WEBHOOK }}
|
||||
# DISCORD_REPO_WEBHOOK: ${{ secrets.DISCORD_REPO_WEBHOOK }}
|
||||
# DISCORD_PING_ROLE_ID: ${{ secrets.DISCORD_PING_ROLE_ID }}
|
||||
@@ -23,7 +24,9 @@ name: Reusable — Announce Release to Discord
|
||||
# (GET {api_url}/repos/{owner}/{repo}/releases/tags/{tag}, same field names as GitHub)
|
||||
# instead of `gh api`. Gitea releases carry notes + links only (no binaries), so the
|
||||
# "Downloads" field is normally empty — the links are in the release body.
|
||||
# VERIFY: the job token can read poli0981/.github from a caller repo (sparse checkout below).
|
||||
# The job token reads poli0981/.github from a caller repo because that repo is public: Gitea
|
||||
# gives every job token read access to public repos. Making it private needs the owner-level
|
||||
# cross-repo Actions setting instead.
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
@@ -32,6 +35,10 @@ on:
|
||||
description: "Optional tag (when re-running manually)"
|
||||
type: string
|
||||
default: ""
|
||||
ops_ref:
|
||||
description: "Ref of poli0981/.github the notifier script is loaded from: pass the SHA pinned in `uses:`"
|
||||
type: string
|
||||
default: "main"
|
||||
secrets:
|
||||
DISCORD_RELEASES_WEBHOOK:
|
||||
required: false
|
||||
@@ -54,7 +61,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
repository: poli0981/.github
|
||||
ref: main
|
||||
ref: ${{ inputs.ops_ref }}
|
||||
path: ops
|
||||
sparse-checkout: |
|
||||
.github/scripts
|
||||
@@ -63,7 +70,7 @@ jobs:
|
||||
- name: Resolve release data (Gitea API)
|
||||
id: release
|
||||
env:
|
||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
||||
GITEA_TOKEN: ${{ github.token }}
|
||||
API_URL: ${{ github.api_url }}
|
||||
INPUT_TAG: ${{ inputs.tag_override }}
|
||||
EVENT_TAG: ${{ github.event.release.tag_name }}
|
||||
|
||||
@@ -16,14 +16,17 @@ name: Reusable — Notify CI Failures to Discord
|
||||
# uses: poli0981/.github/.gitea/workflows/notify-ci-failure.yml@<full-sha> # ops vYYYY.MM.N
|
||||
# with:
|
||||
# default_branch: main
|
||||
# secrets: # explicit; `secrets: inherit` is VERIFY on Gitea
|
||||
# ops_ref: <full-sha> # the same SHA as `uses:`
|
||||
# secrets: # explicit, as the runbook asks (Gitea also has `inherit`)
|
||||
# DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
|
||||
#
|
||||
# Gitea port 2026-11-23:
|
||||
# - VERIFY: `workflow_run` triggers and the github.event.workflow_run.* payload on Gitea 28.
|
||||
# - Gitea's workflow_run payload is not GitHub's (read from the Gitea source, VERIFY on
|
||||
# 28.4.0): `workflow_run` has no `name` and no `head_commit`, and head_branch is empty
|
||||
# for tag runs. The workflow name is github.event.workflow.name, the commit title
|
||||
# workflow_run.display_title, and the ref the end of workflow_run.path ("<file>@<ref>").
|
||||
# - github.event.repository.default_branch → explicit input `default_branch` (runbook §4.1).
|
||||
# - VERIFY: the run link built by discord_notify.py ({server_url}/{repo}/actions/runs/{id})
|
||||
# opens the right run on Gitea.
|
||||
# - Run link {server_url}/{repo}/actions/runs/{id}: Gitea looks run IDs up first.
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
@@ -38,6 +41,10 @@ on:
|
||||
description: "Caller repo default branch (Gitea may not populate github.event.repository)"
|
||||
type: string
|
||||
default: "main"
|
||||
ops_ref:
|
||||
description: "Ref of poli0981/.github the notifier script is loaded from: pass the SHA pinned in `uses:`"
|
||||
type: string
|
||||
default: "main"
|
||||
secrets:
|
||||
DISCORD_CI_WEBHOOK:
|
||||
required: true
|
||||
@@ -50,19 +57,19 @@ jobs:
|
||||
notify:
|
||||
if: >
|
||||
github.event.workflow_run.conclusion == 'failure' &&
|
||||
!startsWith(github.event.workflow_run.name, 'Notify') &&
|
||||
!startsWith(github.event.workflow_run.name, 'Announce') &&
|
||||
!startsWith(github.event.workflow.name, 'Notify') &&
|
||||
!startsWith(github.event.workflow.name, 'Announce') &&
|
||||
(
|
||||
inputs.skip_dedicated_workflows == false ||
|
||||
(
|
||||
!contains(github.event.workflow_run.name, 'odeQL') &&
|
||||
!contains(github.event.workflow_run.name, 'ependabot') &&
|
||||
!contains(github.event.workflow_run.name, 'enovate') &&
|
||||
!contains(github.event.workflow_run.name, 'ependency') &&
|
||||
!contains(github.event.workflow_run.name, 'eploy') &&
|
||||
!contains(github.event.workflow_run.name, 'ages') &&
|
||||
!contains(github.event.workflow_run.name, 'elease') &&
|
||||
!contains(github.event.workflow_run.name, 'esktop')
|
||||
!contains(github.event.workflow.name, 'odeQL') &&
|
||||
!contains(github.event.workflow.name, 'ependabot') &&
|
||||
!contains(github.event.workflow.name, 'enovate') &&
|
||||
!contains(github.event.workflow.name, 'ependency') &&
|
||||
!contains(github.event.workflow.name, 'eploy') &&
|
||||
!contains(github.event.workflow.name, 'ages') &&
|
||||
!contains(github.event.workflow.name, 'elease') &&
|
||||
!contains(github.event.workflow.name, 'esktop')
|
||||
)
|
||||
) &&
|
||||
(
|
||||
@@ -83,7 +90,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
repository: poli0981/.github
|
||||
ref: main
|
||||
ref: ${{ inputs.ops_ref }}
|
||||
path: ops
|
||||
sparse-checkout: |
|
||||
.github/scripts
|
||||
@@ -92,13 +99,13 @@ jobs:
|
||||
- name: Post failure to Discord
|
||||
env:
|
||||
DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow.name }}
|
||||
RUN_ID: ${{ github.event.workflow_run.id }}
|
||||
RUN_NUMBER: ${{ github.event.workflow_run.run_number }}
|
||||
RUN_ATTEMPT: ${{ github.event.workflow_run.run_attempt }}
|
||||
BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
|
||||
COMMIT_MESSAGE: ${{ github.event.workflow_run.display_title }}
|
||||
ACTOR: ${{ github.event.workflow_run.actor.login }}
|
||||
EVENT_NAME: ${{ github.event.workflow_run.event }}
|
||||
run: python3 ops/.github/scripts/discord_notify.py failure
|
||||
@@ -13,6 +13,7 @@ name: Reusable — Notify Deploy Status to Discord
|
||||
# uses: poli0981/.github/.gitea/workflows/notify-deploy.yml@<full-sha> # ops vYYYY.MM.N
|
||||
# with:
|
||||
# deploy_url: https://example.poli0981.dev # live site shown on success (optional)
|
||||
# ops_ref: <full-sha> # the same SHA as `uses:`
|
||||
# secrets:
|
||||
# DISCORD_CI_WEBHOOK: ${{ secrets.DISCORD_CI_WEBHOOK }}
|
||||
#
|
||||
@@ -20,7 +21,10 @@ name: Reusable — Notify Deploy Status to Discord
|
||||
# - The GitHub Pages lookup (`gh api repos/.../pages`) is removed — Pages does not exist on
|
||||
# Gitea and sites deploy to Cloudflare Workers. Pass the live URL with `deploy_url`.
|
||||
# - github.event.repository.default_branch → explicit input `default_branch` (runbook §4.1).
|
||||
# - VERIFY: `workflow_run` triggers and payload on Gitea 28.
|
||||
# - Gitea's workflow_run payload is not GitHub's (read from the Gitea source, VERIFY on
|
||||
# 28.4.0): `workflow_run` has no `name` and no `head_commit`, and head_branch is empty
|
||||
# for tag runs. The workflow name is github.event.workflow.name, the commit title
|
||||
# workflow_run.display_title, and the ref the end of workflow_run.path ("<file>@<ref>").
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
@@ -33,6 +37,10 @@ on:
|
||||
description: "Caller repo default branch (Gitea may not populate github.event.repository)"
|
||||
type: string
|
||||
default: "main"
|
||||
ops_ref:
|
||||
description: "Ref of poli0981/.github the notifier script is loaded from: pass the SHA pinned in `uses:`"
|
||||
type: string
|
||||
default: "main"
|
||||
secrets:
|
||||
DISCORD_CI_WEBHOOK:
|
||||
required: true
|
||||
@@ -46,14 +54,14 @@ jobs:
|
||||
if: >
|
||||
(github.event.workflow_run.conclusion == 'success' || github.event.workflow_run.conclusion == 'failure') &&
|
||||
(
|
||||
contains(github.event.workflow_run.name, 'eploy') ||
|
||||
contains(github.event.workflow_run.name, 'ages') ||
|
||||
contains(github.event.workflow_run.name, 'ublish')
|
||||
contains(github.event.workflow.name, 'eploy') ||
|
||||
contains(github.event.workflow.name, 'ages') ||
|
||||
contains(github.event.workflow.name, 'ublish')
|
||||
) &&
|
||||
!startsWith(github.event.workflow_run.name, 'Notify') &&
|
||||
!contains(github.event.workflow_run.name, 'odeQL') &&
|
||||
!contains(github.event.workflow_run.name, 'ependabot') &&
|
||||
!contains(github.event.workflow_run.name, 'enovate') &&
|
||||
!startsWith(github.event.workflow.name, 'Notify') &&
|
||||
!contains(github.event.workflow.name, 'odeQL') &&
|
||||
!contains(github.event.workflow.name, 'ependabot') &&
|
||||
!contains(github.event.workflow.name, 'enovate') &&
|
||||
(
|
||||
github.event.workflow_run.head_branch == inputs.default_branch ||
|
||||
github.event.workflow_run.head_branch == 'main' ||
|
||||
@@ -69,7 +77,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
repository: poli0981/.github
|
||||
ref: main
|
||||
ref: ${{ inputs.ops_ref }}
|
||||
path: ops
|
||||
sparse-checkout: |
|
||||
.github/scripts
|
||||
@@ -78,7 +86,7 @@ jobs:
|
||||
- name: Detect deploy target from workflow name
|
||||
id: target
|
||||
env:
|
||||
WF_NAME: ${{ github.event.workflow_run.name }}
|
||||
WF_NAME: ${{ github.event.workflow.name }}
|
||||
run: |
|
||||
TARGET="Deploy"
|
||||
# Later matches win. No GitHub Pages on Gitea; sites deploy to Cloudflare Workers.
|
||||
@@ -95,11 +103,11 @@ jobs:
|
||||
DEPLOY_STATUS: ${{ github.event.workflow_run.conclusion }}
|
||||
DEPLOY_TARGET: ${{ steps.target.outputs.target }}
|
||||
DEPLOY_URL: ${{ github.event.workflow_run.conclusion == 'success' && inputs.deploy_url || '' }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow.name }}
|
||||
RUN_ID: ${{ github.event.workflow_run.id }}
|
||||
RUN_NUMBER: ${{ github.event.workflow_run.run_number }}
|
||||
BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||
COMMIT_SHA: ${{ github.event.workflow_run.head_sha }}
|
||||
COMMIT_MESSAGE: ${{ github.event.workflow_run.head_commit.message }}
|
||||
COMMIT_MESSAGE: ${{ github.event.workflow_run.display_title }}
|
||||
ACTOR: ${{ github.event.workflow_run.actor.login }}
|
||||
run: python3 ops/.github/scripts/discord_notify.py deploy
|
||||
@@ -11,14 +11,26 @@ name: Reusable — Notify Release Pipeline to Discord
|
||||
# jobs:
|
||||
# notify:
|
||||
# uses: poli0981/.github/.gitea/workflows/notify-release-pipeline.yml@<full-sha> # ops vYYYY.MM.N
|
||||
# with:
|
||||
# ops_ref: <full-sha> # the same SHA as `uses:`
|
||||
# secrets:
|
||||
# DISCORD_RELEASE_PIPELINE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PIPELINE_WEBHOOK }}
|
||||
#
|
||||
# Gitea port 2026-11-23: VERIFY `workflow_run` triggers on Gitea 28 and that head_branch
|
||||
# carries the tag name (v*) for tag-push runs, as on GitHub.
|
||||
# Gitea port 2026-11-23:
|
||||
# - Gitea's workflow_run payload is not GitHub's (read from the Gitea source, VERIFY on
|
||||
# 28.4.0): `workflow_run` has no `name` and no `head_commit`, and head_branch is empty
|
||||
# for tag runs. The workflow name is github.event.workflow.name, the commit title
|
||||
# workflow_run.display_title, and the ref the end of workflow_run.path ("<file>@<ref>").
|
||||
# - So tag runs are recognised by "@refs/tags/v" in workflow_run.path, and the tag is cut
|
||||
# from it (step "Resolve release tag").
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
ops_ref:
|
||||
description: "Ref of poli0981/.github the notifier script is loaded from: pass the SHA pinned in `uses:`"
|
||||
type: string
|
||||
default: "main"
|
||||
secrets:
|
||||
DISCORD_RELEASE_PIPELINE_WEBHOOK:
|
||||
required: true
|
||||
@@ -31,18 +43,19 @@ jobs:
|
||||
notify:
|
||||
if: >
|
||||
(
|
||||
contains(github.event.workflow_run.name, 'elease') ||
|
||||
contains(github.event.workflow_run.name, 'esktop')
|
||||
contains(github.event.workflow.name, 'elease') ||
|
||||
contains(github.event.workflow.name, 'esktop')
|
||||
) &&
|
||||
!startsWith(github.event.workflow_run.name, 'Notify') &&
|
||||
!startsWith(github.event.workflow_run.name, 'Announce') &&
|
||||
!contains(github.event.workflow_run.name, 'odeQL') &&
|
||||
!contains(github.event.workflow_run.name, 'ependabot') &&
|
||||
!startsWith(github.event.workflow.name, 'Notify') &&
|
||||
!startsWith(github.event.workflow.name, 'Announce') &&
|
||||
!contains(github.event.workflow.name, 'odeQL') &&
|
||||
!contains(github.event.workflow.name, 'ependabot') &&
|
||||
(
|
||||
github.event.workflow_run.event == 'release' ||
|
||||
github.event.workflow_run.event == 'workflow_dispatch' ||
|
||||
startsWith(github.event.workflow_run.head_branch, 'v') ||
|
||||
startsWith(github.event.workflow_run.head_branch, 'desktop-v')
|
||||
contains(github.event.workflow_run.path, '@refs/tags/v') ||
|
||||
contains(github.event.workflow_run.path, '@refs/tags/desktop-v') ||
|
||||
contains(github.event.workflow_run.path, '@refs/tags/android-v')
|
||||
) &&
|
||||
(
|
||||
github.event.workflow_run.conclusion == 'success' ||
|
||||
@@ -59,7 +72,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
repository: poli0981/.github
|
||||
ref: main
|
||||
ref: ${{ inputs.ops_ref }}
|
||||
path: ops
|
||||
sparse-checkout: |
|
||||
.github/scripts
|
||||
@@ -68,12 +81,12 @@ jobs:
|
||||
- name: Detect packager
|
||||
id: detect
|
||||
env:
|
||||
WF_NAME: ${{ github.event.workflow_run.name }}
|
||||
WF_NAME: ${{ github.event.workflow.name }}
|
||||
REPO: ${{ github.repository }}
|
||||
run: |
|
||||
PACKAGER=""
|
||||
case "$REPO" in
|
||||
*autoclick*|*captureimg*|*randomizerMAC*|*HashTool*) PACKAGER="Velopack" ;;
|
||||
*autoclick*|*captureimg*|*randomizerMAC*|*HashTool*|*CommandForge*|*OmniDeck*|*frameledger*|*AppLedger*) PACKAGER="Velopack" ;;
|
||||
*youtube-generator*|*free-steam-games-list*|*free-games-itchio-list*) PACKAGER="Tauri" ;;
|
||||
*)
|
||||
if echo "$WF_NAME" | grep -qi 'tauri\|desktop'; then PACKAGER="Tauri"; fi
|
||||
@@ -82,13 +95,28 @@ jobs:
|
||||
esac
|
||||
echo "packager=$PACKAGER" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Resolve release tag
|
||||
id: tag
|
||||
env:
|
||||
WF_PATH: ${{ github.event.workflow_run.path }} # "<file>.yml@<ref>" on Gitea
|
||||
HEAD_BRANCH: ${{ github.event.workflow_run.head_branch }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
# Gitea leaves head_branch empty for tag runs; the ref is the end of workflow_run.path.
|
||||
ref="${WF_PATH#*@}"
|
||||
case "$ref" in
|
||||
refs/tags/*) tag="${ref#refs/tags/}" ;;
|
||||
*) tag="$HEAD_BRANCH" ;;
|
||||
esac
|
||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Post release pipeline status
|
||||
env:
|
||||
DISCORD_RELEASE_PIPELINE_WEBHOOK: ${{ secrets.DISCORD_RELEASE_PIPELINE_WEBHOOK }}
|
||||
BUILD_STATUS: ${{ github.event.workflow_run.conclusion }}
|
||||
BUILD_PLATFORM: ${{ github.event.workflow_run.event }}
|
||||
BUILD_PACKAGER: ${{ steps.detect.outputs.packager }}
|
||||
RELEASE_TAG: ${{ github.event.workflow_run.head_branch }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow_run.name }}
|
||||
RELEASE_TAG: ${{ steps.tag.outputs.tag }}
|
||||
WORKFLOW_NAME: ${{ github.event.workflow.name }}
|
||||
RUN_ID: ${{ github.event.workflow_run.id }}
|
||||
run: python3 ops/.github/scripts/discord_notify.py release-build
|
||||
@@ -0,0 +1,69 @@
|
||||
# Self-check for the ops repo: the workflows here are linted before any caller pins them
|
||||
# (runbook §4.1).
|
||||
# - actionlint, with shellcheck on every `run:` script. .github/actionlint.yaml ignores only
|
||||
# the Gitea features actionlint does not know (the `releases` scope, full-URL actions, the
|
||||
# switched-off macOS workflow).
|
||||
# - Python syntax of the notifier script and the tools.
|
||||
# Both tools are downloaded at pinned versions and SHA-256 verified. Renovate does not update
|
||||
# them (they are not actions): bump version and checksum together, by hand.
|
||||
|
||||
name: Ops lint
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
concurrency:
|
||||
group: ops-lint-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
name: actionlint + Python
|
||||
runs-on: ubuntu-latest # Gitea: Docker, docker.gitea.com/runner-images
|
||||
timeout-minutes: 10
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
ACTIONLINT_VERSION: 1.7.12
|
||||
ACTIONLINT_SHA256: 8aca8db96f1b94770f1b0d72b6dddcb1ebb8123cb3712530b08cc387b349a3d8 # actionlint_1.7.12_linux_amd64.tar.gz (release checksums file)
|
||||
SHELLCHECK_VERSION: v0.11.0
|
||||
SHELLCHECK_SHA256: 8c3be12b05d5c177a04c29e3c78ce89ac86f1595681cab149b65b97c4e227198 # shellcheck-v0.11.0.linux.x86_64.tar.xz (no checksums file upstream; hashed 2026-11-23)
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Install actionlint ${{ env.ACTIONLINT_VERSION }} + shellcheck ${{ env.SHELLCHECK_VERSION }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tmp="${RUNNER_TEMP:-/tmp}"
|
||||
bin="$tmp/lint-bin"
|
||||
mkdir -p "$bin"
|
||||
curl -fsSL --retry 3 -o "$tmp/actionlint.tar.gz" \
|
||||
"https://github.com/rhysd/actionlint/releases/download/v${ACTIONLINT_VERSION}/actionlint_${ACTIONLINT_VERSION}_linux_amd64.tar.gz"
|
||||
echo "${ACTIONLINT_SHA256} $tmp/actionlint.tar.gz" | sha256sum -c -
|
||||
tar -xzf "$tmp/actionlint.tar.gz" -C "$bin" actionlint
|
||||
curl -fsSL --retry 3 -o "$tmp/shellcheck.tar.xz" \
|
||||
"https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_VERSION}/shellcheck-${SHELLCHECK_VERSION}.linux.x86_64.tar.xz"
|
||||
echo "${SHELLCHECK_SHA256} $tmp/shellcheck.tar.xz" | sha256sum -c -
|
||||
tar -xJf "$tmp/shellcheck.tar.xz" -C "$bin" --strip-components=1 "shellcheck-${SHELLCHECK_VERSION}/shellcheck"
|
||||
echo "$bin" >> "$GITHUB_PATH"
|
||||
|
||||
- name: actionlint
|
||||
run: |
|
||||
actionlint -version
|
||||
shellcheck --version | sed -n 2p
|
||||
actionlint -color -config-file .github/actionlint.yaml \
|
||||
-shellcheck "$(command -v shellcheck)" .gitea/workflows/*.yml
|
||||
|
||||
- name: Python syntax
|
||||
run: |
|
||||
python3 --version
|
||||
python3 -m py_compile .github/scripts/*.py tools/*.py
|
||||
@@ -12,7 +12,7 @@
|
||||
# with: { name: r2-release, path: r2-release/ }
|
||||
# publish:
|
||||
# needs: build
|
||||
# if: startsWith(github.ref, 'refs/tags/v')
|
||||
# if: startsWith(github.ref, 'refs/tags/')
|
||||
# permissions:
|
||||
# contents: read
|
||||
# uses: poli0981/.github/.gitea/workflows/publish-r2.yml@<full-sha> # ops vYYYY.MM.N
|
||||
@@ -39,7 +39,10 @@
|
||||
# stale feed — the job fails before uploading anything
|
||||
# - rclone pinned + SHA-256 verified; configured only through env vars, with an empty
|
||||
# config file so the host-mode Windows runner never picks up a local rclone.conf
|
||||
# - runs only for tag pushes (refs/tags/v*) or workflow_dispatch (runbook §2 rule 10)
|
||||
# - runs only on a tag: a tag push, or workflow_dispatch started on that tag
|
||||
# (runbook §2 rule 10). Any tag name: a repo that releases several things
|
||||
# tags each its own way (free-steam-games-list: v* for the dataset,
|
||||
# desktop-v* and android-v* for the apps)
|
||||
|
||||
name: Reusable / Publish to R2
|
||||
|
||||
@@ -82,7 +85,7 @@ permissions:
|
||||
jobs:
|
||||
publish:
|
||||
# Release credentials: tag pushes or manual runs only (runbook §2 rule 10)
|
||||
if: ${{ (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || github.event_name == 'workflow_dispatch' }}
|
||||
if: ${{ startsWith(github.ref, 'refs/tags/') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||
runs-on: ${{ inputs.runs-on }}
|
||||
timeout-minutes: 30
|
||||
permissions:
|
||||
@@ -100,9 +103,13 @@ jobs:
|
||||
R2_BUCKET: poli0981-releases
|
||||
PUBLIC_BASE: https://releases.poli0981.dev
|
||||
ARTIFACT_DIR: _r2
|
||||
RCLONE_VERSION: v1.76.0
|
||||
RCLONE_SHA256_WINDOWS: 8b4fd2737ade4e70c057ef4a49deb7cffe94b0fb9d7587c189d149823f21a1dc # rclone-v1.76.0-windows-amd64.zip
|
||||
RCLONE_SHA256_LINUX: b00f00b3266c3764413afe599d3ec316f6f43b3e0ea8a0bc1d186d2133e46df7 # rclone-v1.76.0-linux-amd64.zip
|
||||
# Never name these RCLONE_*: rclone reads every RCLONE_<FLAG> variable as
|
||||
# that flag, and RCLONE_VERSION made `rclone version` die with "Invalid
|
||||
# value when setting --version from environment variable" (v2026.11.3,
|
||||
# free-steam-games-list android-v2.6.0: nothing was uploaded).
|
||||
PINNED_RCLONE_VERSION: v1.76.0
|
||||
PINNED_RCLONE_SHA256_WINDOWS: 8b4fd2737ade4e70c057ef4a49deb7cffe94b0fb9d7587c189d149823f21a1dc # rclone-v1.76.0-windows-amd64.zip
|
||||
PINNED_RCLONE_SHA256_LINUX: b00f00b3266c3764413afe599d3ec316f6f43b3e0ea8a0bc1d186d2133e46df7 # rclone-v1.76.0-linux-amd64.zip
|
||||
# rclone remote "r2" — env-only config, same scheme as the server backup script.
|
||||
# The access keys are added only on the upload steps.
|
||||
RCLONE_CONFIG_R2_TYPE: s3
|
||||
@@ -160,11 +167,11 @@ jobs:
|
||||
Write-Host "Feed files ($($feeds.Count)) -> uploaded last: $($seen.Keys -join ', ')"
|
||||
|
||||
$tmp = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { [IO.Path]::GetTempPath() }
|
||||
$pkg = "rclone-$($env:RCLONE_VERSION)-windows-amd64"
|
||||
$pkg = "rclone-$($env:PINNED_RCLONE_VERSION)-windows-amd64"
|
||||
$zip = Join-Path $tmp "$pkg.zip"
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://downloads.rclone.org/$($env:RCLONE_VERSION)/$pkg.zip" -OutFile $zip
|
||||
Invoke-WebRequest -UseBasicParsing -Uri "https://downloads.rclone.org/$($env:PINNED_RCLONE_VERSION)/$pkg.zip" -OutFile $zip
|
||||
$hash = (Get-FileHash -Algorithm SHA256 -LiteralPath $zip).Hash.ToLowerInvariant()
|
||||
if ($hash -ne $env:RCLONE_SHA256_WINDOWS) { Fail "rclone checksum mismatch: $hash" }
|
||||
if ($hash -ne $env:PINNED_RCLONE_SHA256_WINDOWS) { Fail "rclone checksum mismatch: $hash" }
|
||||
$dest = Join-Path $tmp 'rclone'
|
||||
Expand-Archive -LiteralPath $zip -DestinationPath $dest -Force
|
||||
$bin = Join-Path $dest $pkg
|
||||
@@ -263,9 +270,9 @@ jobs:
|
||||
echo "Feed files ($nfeeds) -> uploaded last: ${!seen[*]}"
|
||||
|
||||
tmp="${RUNNER_TEMP:-/tmp}"
|
||||
pkg="rclone-${RCLONE_VERSION}-linux-amd64"
|
||||
curl -fsSL --retry 3 -o "$tmp/$pkg.zip" "https://downloads.rclone.org/${RCLONE_VERSION}/$pkg.zip"
|
||||
echo "${RCLONE_SHA256_LINUX} $tmp/$pkg.zip" | sha256sum -c -
|
||||
pkg="rclone-${PINNED_RCLONE_VERSION}-linux-amd64"
|
||||
curl -fsSL --retry 3 -o "$tmp/$pkg.zip" "https://downloads.rclone.org/${PINNED_RCLONE_VERSION}/$pkg.zip"
|
||||
echo "${PINNED_RCLONE_SHA256_LINUX} $tmp/$pkg.zip" | sha256sum -c -
|
||||
if command -v unzip >/dev/null 2>&1; then
|
||||
unzip -q -o "$tmp/$pkg.zip" -d "$tmp"
|
||||
else
|
||||
|
||||
@@ -28,9 +28,9 @@
|
||||
# R2_RELEASES_SECRET_ACCESS_KEY: ${{ secrets.R2_RELEASES_SECRET_ACCESS_KEY }}
|
||||
#
|
||||
# Gitea port 2026-11-23: ubuntu-latest = Docker image docker.gitea.com/runner-images.
|
||||
# VERIFY on pilot: the nested call `uses: ./.gitea/workflows/publish-r2.yml` must resolve to
|
||||
# this ops repo at the same commit. If Gitea resolves `./` against the CALLER repo, change it
|
||||
# to `poli0981/.github/.gitea/workflows/publish-r2.yml@<sha of the same ops tag>`.
|
||||
# The nested call `uses: ./.gitea/workflows/publish-r2.yml` resolves to THIS ops repo at the
|
||||
# same commit: Gitea reads `./` against the repo and commit of the file that holds the
|
||||
# `uses:`, not against the caller repo (read from the Gitea source; VERIFY on 28.4.0).
|
||||
# Actions pinned to commit SHAs (Renovate keeps them current).
|
||||
|
||||
name: Reusable / Chrome Extension
|
||||
@@ -84,7 +84,7 @@ jobs:
|
||||
|
||||
- name: Setup Node.js ${{ inputs.node-version }}
|
||||
if: ${{ inputs.package-manager != 'none' }}
|
||||
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: ${{ inputs.package-manager }}
|
||||
@@ -156,7 +156,7 @@ jobs:
|
||||
|
||||
- name: Setup Node.js ${{ inputs.node-version }}
|
||||
if: ${{ inputs.package-manager != 'none' }}
|
||||
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: ${{ inputs.package-manager }}
|
||||
@@ -211,7 +211,7 @@ jobs:
|
||||
if: ${{ inputs.release && startsWith(github.ref, 'refs/tags/v') && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }}
|
||||
permissions:
|
||||
contents: read
|
||||
uses: ./.gitea/workflows/publish-r2.yml # VERIFY: resolves to this ops repo (see header)
|
||||
uses: ./.gitea/workflows/publish-r2.yml # this ops repo, same commit (see header)
|
||||
with:
|
||||
app: ${{ needs.package.outputs.app }}
|
||||
artifact: r2-release
|
||||
|
||||
@@ -116,7 +116,7 @@ jobs:
|
||||
"DOTNET_INSTALL_DIR=$(Join-Path $base 'dotnet')" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Setup .NET ${{ inputs.dotnet-version }}
|
||||
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: ${{ inputs.dotnet-version }}
|
||||
|
||||
@@ -165,7 +165,7 @@ jobs:
|
||||
"DOTNET_INSTALL_DIR=$(Join-Path $base 'dotnet')" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Setup .NET ${{ inputs.dotnet-version }}
|
||||
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: ${{ inputs.dotnet-version }}
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup Go (${{ inputs.go-version }})
|
||||
uses: actions/setup-go@924ae3a1cded613372ab5595356fb5720e22ba16 # v6.5.0
|
||||
uses: actions/setup-go@d8cbb8045d7f43706b9177cceb36c1f91a6644d5 # v7.1.0
|
||||
with:
|
||||
go-version: ${{ inputs.go-version }}
|
||||
check-latest: true
|
||||
|
||||
@@ -42,7 +42,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup JDK ${{ inputs.java-version }} (${{ inputs.distribution }})
|
||||
uses: actions/setup-java@b6effb05e454b25005698d916606bdc6ffcbf961 # v5.7.0
|
||||
uses: actions/setup-java@d1374f8ac74474200d16ef8ecee22c7ae7a51880 # v6.3.0
|
||||
with:
|
||||
java-version: ${{ inputs.java-version }}
|
||||
distribution: ${{ inputs.distribution }}
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup Python ${{ inputs.lint-python-version }}
|
||||
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
with:
|
||||
python-version: ${{ inputs.lint-python-version }}
|
||||
|
||||
@@ -85,7 +85,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6.3.0
|
||||
uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
cache: pip
|
||||
|
||||
@@ -0,0 +1,268 @@
|
||||
# Reusable Qodana scan with the Qodana CLI (runbook §3.5). Replaces JetBrains/qodana-action,
|
||||
# which needs GitHub's APIs. Gitea has no code-scanning UI, so the findings live in Qodana Cloud
|
||||
# and in the `qodana-report` artifact (SARIF + HTML report).
|
||||
#
|
||||
# Lives in poli0981/.github (Gitea) → called via:
|
||||
# on:
|
||||
# push:
|
||||
# branches: [main]
|
||||
# pull_request:
|
||||
# workflow_dispatch:
|
||||
# schedule:
|
||||
# - cron: '<m> <13-15> * * <d>' # weekly, inside 13:00–16:00 UTC, a FREE slot (runbook §8)
|
||||
# permissions:
|
||||
# contents: read
|
||||
# jobs:
|
||||
# qodana:
|
||||
# uses: poli0981/.github/.gitea/workflows/reusable-qodana.yml@<full-sha> # ops vYYYY.MM.N
|
||||
# with:
|
||||
# package-manager: pnpm # JS/TS: qodana-js reads the dependencies' types
|
||||
# prepare-command: pnpm exec astro sync
|
||||
# secrets:
|
||||
# QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
#
|
||||
# .NET whose solution targets net*-windows (WPF): `runs-on: windows-latest` and
|
||||
# `dotnet-version: 10.0.x` → native mode in HOST MODE on the maintainer PC (runbook §3.5).
|
||||
# Two Qodana Cloud projects in one repo (e.g. Rust + TS): call this twice with `config`,
|
||||
# `artifact-name` and each project's token.
|
||||
# A project in a subdirectory (free-steam-games-list: web/, scripts/, web/src-tauri/):
|
||||
# `project-dir: <dir>` and `repository-root: .`, and `working-directory: <dir>` when its
|
||||
# package.json is there too. `extra-args` reaches `qodana scan` as is, split on spaces
|
||||
# (qodana-rust in Docker needs `-u root -e CARGO_HOME=/data/cache/cargo`).
|
||||
#
|
||||
# How it runs:
|
||||
# - Native mode by default (`--within-docker false`): on ubuntu-latest the job already is a
|
||||
# container. A linter without a native mode (qodana-rust) needs `within-docker: true`,
|
||||
# best on windows-latest, where Docker Desktop on the maintainer PC runs the Linux image
|
||||
# (VERIFY on pilot; on ubuntu-latest it would need the runner to hand the job a Docker socket).
|
||||
# - The linter comes from qodana.yaml (`linter:`) unless `linter` is set.
|
||||
# - Runs started by renovate-bot (push or pull request) skip the job: Gitea gives same-repo
|
||||
# pull requests the repo's secrets, and such a run installs the very update under review.
|
||||
# Dependencies are installed with lifecycle scripts off.
|
||||
# - The CLI is downloaded at a pinned version and SHA-256 verified (JetBrains publishes both
|
||||
# in qodana-action's common/cli.json). Renovate does not update it: bump the version and
|
||||
# both checksums together, by hand.
|
||||
# - Results go to the runner's temp dir. On Linux the cache does too (the container is
|
||||
# thrown away); on the Windows host the CLI keeps its default per-user cache, so the
|
||||
# linter is not downloaded again on every run.
|
||||
# VERIFY on pilot: native mode of each linter on its runner (ticktune runs qodana-js this way).
|
||||
|
||||
name: Reusable / Qodana
|
||||
|
||||
on:
|
||||
workflow_call:
|
||||
inputs:
|
||||
runs-on:
|
||||
description: "'ubuntu-latest' (Docker) | 'windows-latest' (host mode; needed for net*-windows)"
|
||||
type: string
|
||||
default: 'ubuntu-latest'
|
||||
linter:
|
||||
description: "Linter (e.g. qodana-js, qodana-dotnet, qodana-python); empty = qodana.yaml's `linter:`"
|
||||
type: string
|
||||
default: ''
|
||||
config:
|
||||
description: 'Qodana config file (empty = qodana.yaml in the project dir)'
|
||||
type: string
|
||||
default: ''
|
||||
project-dir:
|
||||
description: 'Directory to analyse (empty = repo root)'
|
||||
type: string
|
||||
default: ''
|
||||
repository-root:
|
||||
description: "Git root passed as --repository-root when project-dir is a subdirectory (usually '.'); empty = not passed"
|
||||
type: string
|
||||
default: ''
|
||||
working-directory:
|
||||
description: 'Directory holding package.json and the lockfile, where Node dependencies are installed'
|
||||
type: string
|
||||
default: '.'
|
||||
extra-args:
|
||||
description: "Extra `qodana scan` arguments, split on spaces (e.g. qodana-rust in Docker: '-u root -e CARGO_HOME=/data/cache/cargo')"
|
||||
type: string
|
||||
default: ''
|
||||
package-manager:
|
||||
description: "'none' | 'npm' | 'pnpm': install Node dependencies (scripts off) before the scan"
|
||||
type: string
|
||||
default: 'none'
|
||||
node-version:
|
||||
description: 'Node.js version, used when node-version-file is empty'
|
||||
type: string
|
||||
default: '24'
|
||||
node-version-file:
|
||||
description: 'File with the Node.js version (e.g. .nvmrc); wins over node-version'
|
||||
type: string
|
||||
default: ''
|
||||
dotnet-version:
|
||||
description: '.NET SDK to install (empty = none)'
|
||||
type: string
|
||||
default: ''
|
||||
dotnet-global-json-file:
|
||||
description: 'global.json that pins the .NET SDK (wins over dotnet-version)'
|
||||
type: string
|
||||
default: ''
|
||||
within-docker:
|
||||
description: 'true = run the linter image in Docker (for linters with no native mode, e.g. qodana-rust)'
|
||||
type: boolean
|
||||
default: false
|
||||
prepare-command:
|
||||
description: 'One command run after the install, in the runner shell (bash on Linux, pwsh on Windows)'
|
||||
type: string
|
||||
default: ''
|
||||
artifact-name:
|
||||
type: string
|
||||
default: 'qodana-report'
|
||||
secrets:
|
||||
QODANA_TOKEN:
|
||||
required: true
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
scan:
|
||||
name: Qodana
|
||||
# Same check for push and pull_request runs (github.event.pull_request is empty on a push).
|
||||
if: ${{ github.actor != 'renovate-bot' && github.event.pull_request.user.login != 'renovate-bot' }}
|
||||
runs-on: ${{ inputs.runs-on }}
|
||||
timeout-minutes: 45
|
||||
permissions:
|
||||
contents: read
|
||||
env:
|
||||
QODANA_CLI_VERSION: 2026.3.1
|
||||
QODANA_CLI_SHA256_LINUX: dae6d31f481ed15c6c016fd746e907978f0c1437010326fa04a92f13c7c52338 # qodana_linux_x86_64.tar.gz
|
||||
QODANA_CLI_SHA256_WINDOWS: 33ed647c79468c68c016e72ce7f3f9483278143f5e5199da1d6159c2f5594ba2 # qodana_windows_x86_64.zip
|
||||
QODANA_ENDPOINT: 'https://qodana.cloud'
|
||||
LINTER: ${{ inputs.linter }}
|
||||
CONFIG: ${{ inputs.config }}
|
||||
PROJECT_DIR: ${{ inputs.project-dir }}
|
||||
REPOSITORY_ROOT: ${{ inputs.repository-root }}
|
||||
EXTRA_ARGS: ${{ inputs.extra-args }}
|
||||
WITHIN_DOCKER: ${{ inputs.within-docker }}
|
||||
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
|
||||
DOTNET_NOLOGO: '1'
|
||||
steps:
|
||||
- name: Checkout (full history, for Qodana's blame and contributor count)
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Keep .NET SDK installs in the runner tool cache (Windows host mode)
|
||||
if: ${{ (inputs.dotnet-version != '' || inputs.dotnet-global-json-file != '') && runner.os == 'Windows' }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$base = if ($env:RUNNER_TOOL_CACHE) { $env:RUNNER_TOOL_CACHE } else { Join-Path $env:LOCALAPPDATA 'gitea-runner\toolcache' }
|
||||
"DOTNET_INSTALL_DIR=$(Join-Path $base 'dotnet')" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Setup .NET
|
||||
if: ${{ inputs.dotnet-version != '' || inputs.dotnet-global-json-file != '' }}
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: ${{ inputs.dotnet-global-json-file == '' && inputs.dotnet-version || '' }}
|
||||
global-json-file: ${{ inputs.dotnet-global-json-file }}
|
||||
|
||||
- name: Setup pnpm
|
||||
if: ${{ inputs.package-manager == 'pnpm' }}
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
with:
|
||||
package_json_file: ${{ inputs.working-directory }}/package.json
|
||||
|
||||
- name: Setup Node.js
|
||||
if: ${{ inputs.package-manager != 'none' }}
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version-file == '' && inputs.node-version || '' }}
|
||||
node-version-file: ${{ inputs.node-version-file }}
|
||||
cache: ${{ inputs.package-manager }}
|
||||
cache-dependency-path: ${{ inputs.working-directory }}/${{ inputs.package-manager == 'pnpm' && 'pnpm-lock.yaml' || 'package-lock.json' }}
|
||||
|
||||
# --ignore-scripts: no dependency runs code at install time in a job that holds a token.
|
||||
# The analysis needs the packages' types, not their builds.
|
||||
- name: Install dependencies (scripts off)
|
||||
if: ${{ inputs.package-manager != 'none' }}
|
||||
working-directory: ${{ inputs.working-directory }}
|
||||
run: ${{ inputs.package-manager == 'pnpm' && 'pnpm install --frozen-lockfile --ignore-scripts' || 'npm ci --ignore-scripts' }}
|
||||
|
||||
- name: Prepare
|
||||
if: ${{ inputs.prepare-command != '' }}
|
||||
run: ${{ inputs.prepare-command }}
|
||||
|
||||
# ---------------- Linux (Docker) ----------------
|
||||
- name: Install the Qodana CLI (Linux)
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
shell: bash
|
||||
run: |
|
||||
set -euo pipefail
|
||||
tmp="${RUNNER_TEMP:-/tmp}"
|
||||
tgz="$tmp/qodana.tar.gz"
|
||||
curl -fsSL --retry 3 -o "$tgz" \
|
||||
"https://github.com/JetBrains/qodana-cli/releases/download/v${QODANA_CLI_VERSION}/qodana_linux_x86_64.tar.gz"
|
||||
echo "${QODANA_CLI_SHA256_LINUX} $tgz" | sha256sum -c -
|
||||
mkdir -p "$tmp/qodana-cli"
|
||||
tar -xzf "$tgz" -C "$tmp/qodana-cli" qodana
|
||||
echo "$tmp/qodana-cli" >> "$GITHUB_PATH"
|
||||
|
||||
- name: Qodana scan (Linux)
|
||||
if: ${{ runner.os != 'Windows' }}
|
||||
shell: bash
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
if [ -z "$QODANA_TOKEN" ]; then echo "::error::QODANA_TOKEN was not passed"; exit 1; fi
|
||||
tmp="${RUNNER_TEMP:-/tmp}"
|
||||
args=(scan --within-docker "$WITHIN_DOCKER" --results-dir "$tmp/qodana/results" --cache-dir "$tmp/qodana/cache")
|
||||
if [ -n "$LINTER" ]; then args+=(--linter "$LINTER"); fi
|
||||
if [ -n "$CONFIG" ]; then args+=(--config "$CONFIG"); fi
|
||||
if [ -n "$PROJECT_DIR" ]; then args+=(--project-dir "$PROJECT_DIR"); fi
|
||||
if [ -n "$REPOSITORY_ROOT" ]; then args+=(--repository-root "$REPOSITORY_ROOT"); fi
|
||||
read -r -a extra <<< "$EXTRA_ARGS"
|
||||
args+=("${extra[@]}")
|
||||
qodana --version
|
||||
qodana "${args[@]}"
|
||||
|
||||
# ---------------- Windows (host mode, PowerShell) ----------------
|
||||
- name: Install the Qodana CLI (Windows)
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
shell: pwsh
|
||||
run: |
|
||||
$ErrorActionPreference = 'Stop'
|
||||
$ProgressPreference = 'SilentlyContinue'
|
||||
$tmp = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { [IO.Path]::GetTempPath() }
|
||||
$zip = Join-Path $tmp 'qodana.zip'
|
||||
Invoke-WebRequest -UseBasicParsing -OutFile $zip `
|
||||
-Uri "https://github.com/JetBrains/qodana-cli/releases/download/v$($env:QODANA_CLI_VERSION)/qodana_windows_x86_64.zip"
|
||||
$hash = (Get-FileHash -Algorithm SHA256 -LiteralPath $zip).Hash.ToLowerInvariant()
|
||||
if ($hash -ne $env:QODANA_CLI_SHA256_WINDOWS) { Write-Host "::error::Qodana CLI checksum mismatch: $hash"; exit 1 }
|
||||
$dest = Join-Path $tmp 'qodana-cli'
|
||||
Expand-Archive -LiteralPath $zip -DestinationPath $dest -Force
|
||||
$dest >> $env:GITHUB_PATH
|
||||
|
||||
- name: Qodana scan (Windows)
|
||||
if: ${{ runner.os == 'Windows' }}
|
||||
shell: pwsh
|
||||
env:
|
||||
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
|
||||
run: |
|
||||
if (-not $env:QODANA_TOKEN) { Write-Host '::error::QODANA_TOKEN was not passed'; exit 1 }
|
||||
$tmp = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { [IO.Path]::GetTempPath() }
|
||||
$scanArgs = @('scan', '--within-docker', $env:WITHIN_DOCKER, '--results-dir', (Join-Path $tmp 'qodana\results'))
|
||||
if ($env:LINTER) { $scanArgs += @('--linter', $env:LINTER) }
|
||||
if ($env:CONFIG) { $scanArgs += @('--config', $env:CONFIG) }
|
||||
if ($env:PROJECT_DIR) { $scanArgs += @('--project-dir', $env:PROJECT_DIR) }
|
||||
if ($env:REPOSITORY_ROOT) { $scanArgs += @('--repository-root', $env:REPOSITORY_ROOT) }
|
||||
$scanArgs += @($env:EXTRA_ARGS -split '\s+' | Where-Object { $_ })
|
||||
qodana --version
|
||||
& qodana @scanArgs
|
||||
exit $LASTEXITCODE
|
||||
|
||||
# !cancelled(), not the implicit success(): a scan that FINDS something fails, and those
|
||||
# are exactly the findings the report must keep.
|
||||
- name: Keep the report
|
||||
if: ${{ !cancelled() }}
|
||||
uses: christopherhx/gitea-upload-artifact@81f940d004763f986ba3582c007fd842dd5cb0d7 # v4
|
||||
with:
|
||||
name: ${{ inputs.artifact-name }}
|
||||
path: ${{ runner.temp }}/qodana/results/
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
@@ -35,7 +35,7 @@ jobs:
|
||||
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
|
||||
|
||||
- name: Setup Ruby ${{ inputs.ruby-version }}
|
||||
uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
|
||||
uses: ruby/setup-ruby@145243922b4465b78e04dd66294782c7de45901f # v1.345.0
|
||||
with:
|
||||
ruby-version: ${{ inputs.ruby-version }}
|
||||
bundler-cache: true # bundle install + cache automatically
|
||||
|
||||
@@ -75,7 +75,7 @@ jobs:
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
|
||||
- name: Setup Node.js ${{ inputs.node-version }}
|
||||
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: ${{ inputs.package-manager }}
|
||||
@@ -138,7 +138,7 @@ jobs:
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
|
||||
- name: Setup Node.js ${{ inputs.node-version }}
|
||||
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
|
||||
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
|
||||
with:
|
||||
node-version: ${{ inputs.node-version }}
|
||||
cache: ${{ inputs.package-manager }}
|
||||
|
||||
@@ -311,7 +311,7 @@ jobs:
|
||||
"DOTNET_INSTALL_DIR=$(Join-Path $base 'dotnet')" >> $env:GITHUB_ENV
|
||||
|
||||
- name: Setup .NET ${{ inputs.dotnet-version }}
|
||||
uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5.4.0
|
||||
uses: actions/setup-dotnet@0f4a354dd5547a28c70b7853dbd95d5b67886e73 # v6.1.0
|
||||
with:
|
||||
dotnet-version: ${{ inputs.dotnet-version }}
|
||||
|
||||
@@ -320,6 +320,9 @@ jobs:
|
||||
shell: bash
|
||||
env:
|
||||
SOLUTION: ${{ inputs.dotnet-solution }}
|
||||
# docker.gitea.com/runner-images ship no ICU, and .NET stops at start-up without it ("Couldn't find a
|
||||
# valid ICU package", seen 2026-11-26 on HashTool). A restore needs no cultures.
|
||||
DOTNET_SYSTEM_GLOBALIZATION_INVARIANT: '1'
|
||||
run: |
|
||||
set -uo pipefail
|
||||
# shellcheck disable=SC2086
|
||||
|
||||
@@ -10,9 +10,10 @@ name: Weekly Digest
|
||||
# Required repo secrets (set on poli0981/.github):
|
||||
# DISCORD_DIGEST_WEBHOOK — webhook for #announcements
|
||||
# OPS_GITEA_TOKEN — Gitea PAT (Settings → Applications), scopes:
|
||||
# read:repository + read:issue. The job token
|
||||
# (GITEA_TOKEN) only sees this repo, so it cannot
|
||||
# aggregate the others.
|
||||
# read:repository + read:issue + read:user
|
||||
# (GET /users/{owner}/repos needs user AND repository).
|
||||
# The job token (GITEA_TOKEN) does not see private
|
||||
# repos, so it cannot aggregate them.
|
||||
#
|
||||
# Run on demand: Actions → Weekly Digest → Run workflow
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
# actionlint settings for the ops repo. Used by .gitea/workflows/ops-lint.yml and by a local
|
||||
# `actionlint` run from the repo root. Only Gitea features that actionlint does not know are
|
||||
# ignored here; everything else stays an error.
|
||||
paths:
|
||||
.gitea/workflows/*.yml:
|
||||
ignore:
|
||||
# Gitea's own token scope for releases (runbook §3.2 item 5)
|
||||
- 'unknown permission scope "releases"'
|
||||
# Gitea resolves full-URL actions; bare owner/repo goes to github.com (runbook §1)
|
||||
- 'specifying action "https://gitea\.com/[^"]+" in invalid format'
|
||||
.gitea/workflows/reusable-macos-swift.yml:
|
||||
ignore:
|
||||
# Kept but switched off on purpose: there is no macOS runner (runbook §5.6)
|
||||
- 'constant expression "false" in condition'
|
||||
@@ -441,7 +441,7 @@ def post_weekly_digest() -> int:
|
||||
|
||||
Env:
|
||||
DISCORD_DIGEST_WEBHOOK — webhook for #announcements
|
||||
OPS_GITEA_TOKEN — Gitea PAT, scopes read:repository + read:issue
|
||||
OPS_GITEA_TOKEN — Gitea PAT, scopes read:repository + read:issue + read:user
|
||||
(the job token only sees its own repo)
|
||||
GH_OWNER — owner username (default: owner part of GITHUB_REPOSITORY)
|
||||
GITEA_API_URL — API root, e.g. https://git.poli0981.dev/api/v1
|
||||
@@ -473,7 +473,13 @@ def post_weekly_digest() -> int:
|
||||
]
|
||||
|
||||
# Releases: no cross-repo endpoint, so list them per repo and filter by published_at.
|
||||
repos = _gitea_paged(base, f"/users/{quote(owner, safe='')}/repos", token)
|
||||
try:
|
||||
repos = _gitea_paged(base, f"/users/{quote(owner, safe='')}/repos", token)
|
||||
except HTTPError as e:
|
||||
if e.code in (401, 403):
|
||||
print("[ERROR] OPS_GITEA_TOKEN cannot list the repos: GET /users/{owner}/repos needs "
|
||||
"the scopes read:user + read:repository.")
|
||||
return 1
|
||||
releases_by_repo: dict[str, list[dict]] = defaultdict(list)
|
||||
for repo in repos:
|
||||
repo_full = repo.get("full_name", "")
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
.idea/
|
||||
.idea/**/workspace.xml
|
||||
.idea/**/tasks.xml
|
||||
.idea/**/usage.statistics.xml
|
||||
|
||||
@@ -0,0 +1,519 @@
|
||||
# Gitea Migration Runbook (GitHub → git.poli0981.dev)
|
||||
|
||||
> **Audience:** AI coding agents (Claude Code sessions) and the maintainer (Kokone / `poli0981`).
|
||||
> **Scope:** apply this runbook **one repository per session**. Start with the ops repo (§4), then a pilot repo, then the rest.
|
||||
> **Last verified against:** Gitea 28.4.0, gitea-runner 2.x, Velopack CLI 1.2.x, Renovate 44.257.9, November 2026. Items marked **VERIFY** must be confirmed on the pilot repo before being applied everywhere. Items marked **(source)** were read from the Gitea source (main, 2026-11-23): one look on the pilot still settles them.
|
||||
|
||||
---
|
||||
|
||||
## 0. How to use this file
|
||||
|
||||
1. Open a session in the target repository.
|
||||
2. Tell the agent: *"Follow `GITEA-MIGRATION.md` (§3) for this repo. Work on branch `chore/gitea-migration`. Stop at §3.8 and give me the hand-off report."*
|
||||
3. The maintainer does the manual steps listed in the hand-off report (secrets, enabling Actions, R2, Qodana, mirror).
|
||||
4. Tick the repo off in §8.
|
||||
|
||||
Repo-specific guides are in [`migration/`](migration/README.md): one file per inventoried repo, the cron-slot registry and the decisions shared by several repos (D1–D16). When a repo has a guide, give it to the agent together with this file.
|
||||
|
||||
The agent must **not** improvise around anything still listed as an open maintainer decision (§7). If something here conflicts with the repo's own `CLAUDE.md`, this file wins for migration topics only and the conflict must be reported.
|
||||
|
||||
---
|
||||
|
||||
## 1. Fixed facts (do not change)
|
||||
|
||||
| Item | Value |
|
||||
|---|---|
|
||||
| Forge | Gitea 28.4.0, self-hosted, `https://git.poli0981.dev` (canonical home of every repo) |
|
||||
| Owner | `poli0981` (user account, not an org) |
|
||||
| HTTPS clone | `https://git.poli0981.dev/poli0981/<repo>.git` |
|
||||
| SSH clone | `ssh://git@git.poli0981.dev:2222/poli0981/<repo>.git` |
|
||||
| Web URLs | repo `https://git.poli0981.dev/poli0981/<repo>` · releases page `…/<repo>/releases` |
|
||||
| Local remotes | `origin` = Gitea. `github` = old GitHub remote (account suspended; keep, never push) |
|
||||
| Registration | Disabled on the instance. Outside people **cannot** open issues or PRs on Gitea |
|
||||
| Public mirror | `https://gitlab.com/poli0981/<repo>`: push mirror fed by Gitea only (`sync_on_commit` + every 8 h). GitLab CI is disabled there. **This is where outside issues and merge requests go** |
|
||||
| Contact | Patches / questions: `code@poli0981.dev`. Security reports: `security@poli0981.dev`. If a repo already documents another address of the same domain, keep it |
|
||||
| CI | Gitea Actions. Job token: `GITEA_TOKEN`; `secrets.GITHUB_TOKEN` and `github.token` are the same token, in called workflows too (source). Contexts `github.*` and `gitea.*` both work. Events caused by the job token start no workflow (§6) |
|
||||
| Action source | Bare `uses: owner/action@ref` resolves to **github.com**. Gitea-hosted actions need a full URL: `uses: https://gitea.com/actions/<name>@<ref>` |
|
||||
| Runner | One runner on the maintainer's Windows 11 PC, user-scoped (only `poli0981` repos). Online only while the PC is on. A second registration on the same PC, Docker labels only, takes the long data jobs ([migration/README](migration/README.md) D15) |
|
||||
| Runner labels | `windows-latest`, `windows` → **host mode** (no isolation, PowerShell). `ubuntu-latest`, `ubuntu-24.04`, `ubuntu-22.04` → Docker (`docker.gitea.com/runner-images:*`) |
|
||||
| Scheduled jobs | **Only 13:00–16:00 UTC** (20:00–23:00 Vietnam), when the PC is normally on. If the PC is off, the run waits as "waiting" and starts when the runner comes online; after 24 h unpicked it is cancelled (`ABANDONED_JOB_TIMEOUT`). Delays from power cuts etc. are accepted |
|
||||
| Maintenance window | Gitea stops for a few seconds daily for backup at **19:30–19:45 UTC** (02:30 Vietnam). Never schedule anything there (already outside the window above) |
|
||||
| Not available | macOS runners, GitHub-hosted runners, OIDC `id-token`, GitHub code scanning / SARIF UI, Dependabot, CodeQL, GitHub Pages, GitHub Packages |
|
||||
| Static analysis | Qodana (licensed). Security/deps: Opengrep, gitleaks, osv-scanner, cargo-deny, NuGetAudit (§3.5) |
|
||||
| Dependency updates | Renovate, self-hosted, central preset repo `poli0981/renovate-config` (§4.2) |
|
||||
| Release hosting | Cloudflare R2 bucket **`poli0981-releases`**, public only through **`https://releases.poli0981.dev/<app>/`** (`r2.dev` URL disabled). `<app>` = repo name in lowercase. No directory listing: link to exact files |
|
||||
| Release caching | Cloudflare cache is **bypassed** for files whose content changes under the same name: `*.json`, `RELEASES`, `*-Setup.exe`, `*-Setup.pkg`, `*-Portable.zip`, `*.AppImage`, and any name containing `-latest.` (convention for stable download aliases on any platform, e.g. `<app>-latest.apk`, `<app>-latest.dmg`). Everything else may be cached at the edge, so every other file name must be versioned and never overwritten |
|
||||
| Gitea releases | Notes + links to `releases.poli0981.dev` only. Do not attach installers or packages (server disk is 40 GB) |
|
||||
| Web hosting | Cloudflare Workers (deploy with Wrangler from Gitea CI) |
|
||||
| License | GPL-3.0 (sites: CC BY-SA 4.0 where already set) |
|
||||
|
||||
---
|
||||
|
||||
## 2. Hard rules for the agent
|
||||
|
||||
1. **Never push to the `github` remote, never delete it, never rewrite history.**
|
||||
2. **Never create, print, or commit secret values.** Only list secret *names* the maintainer must create (§3.6).
|
||||
3. **Do not enable Actions, change repo settings, or call the Gitea or GitLab API.** The maintainer does that after review.
|
||||
4. **Do not touch the server** (`/opt/gitea`, Docker, Caddy, backups) **or the GitLab mirror** (no `gitlab` remote, no pushes there).
|
||||
5. Keep the repo's conventions: GPL-3.0 headers, Clean Architecture layout, explicit `permissions:` blocks on workflows and caller stubs, EN/VI/JA `.resx` parity.
|
||||
6. **Pin every third-party action to a full 40-char commit SHA** with a version comment (`# v4.2.2`). Renovate keeps them updated. Tags alone are not acceptable (tag force-push attacks hit trivy-action in March 2026).
|
||||
7. One logical change per commit. Work only on branch `chore/gitea-migration`.
|
||||
8. If a step needs a capability listed as "Not available" in §1, **disable or remove that job and say so** in the hand-off report. Do not invent workarounds silently.
|
||||
9. Anything marked **VERIFY**: implement the documented approach, then flag it in the hand-off report as "needs pilot verification".
|
||||
10. Release credentials (`R2_RELEASES_*`, signing keys, store tokens) may only be referenced in jobs triggered by a tag push (`on: push: tags: ['v*']`) or `workflow_dispatch`, never in `pull_request` or scheduled jobs.
|
||||
|
||||
---
|
||||
|
||||
## 3. Per-repo procedure
|
||||
|
||||
### 3.1 Inventory (read-only, report the results first)
|
||||
|
||||
Run the ops repo's inventory tool from the repo root (read-only, tracked files only) and summarise it before changing anything:
|
||||
|
||||
```bash
|
||||
python3 <ops clone>/tools/migration-inventory.py . # on the PC: E:\.github\tools\migration-inventory.py
|
||||
```
|
||||
|
||||
It lists every workflow (triggers, crons outside the window, runners, actions that do not work on Gitea, unpinned actions, unsupported permissions, secrets, calls to the ops repo), the migration markers and the GitHub references left. Then, for what it does not cover:
|
||||
|
||||
```bash
|
||||
git remote -v
|
||||
git status --short
|
||||
ls -la .github .gitea .gitlab 2>/dev/null
|
||||
find .github .gitea .gitlab -type f 2>/dev/null | sort
|
||||
grep -rIn --exclude-dir={.git,node_modules,bin,obj,target,dist,.svelte-kit} \
|
||||
-e 'github\.com/poli0981' -e 'githubusercontent' -e 'api\.github\.com' \
|
||||
-e 'GithubSource' -e 'ghcr\.io' -e 'gh ' -e 'github\.io' -e '@poli0981\.dev' .
|
||||
grep -rIn -e 'uses:' -e 'runs-on:' -e 'permissions:' -e 'id-token' -e 'secrets\.' -e 'cron:' .github/workflows 2>/dev/null
|
||||
```
|
||||
|
||||
Classify the repo into one or more **stack profiles** (§5) and list every workflow with: trigger (including cron in UTC), jobs, `runs-on`, actions used, secrets used. List every e-mail address the repo already documents.
|
||||
|
||||
### 3.2 Workflows
|
||||
|
||||
1. **Move** `.github/workflows/*` → `.gitea/workflows/` (same filenames) and delete `.github/workflows/`. Keep `.github/ISSUE_TEMPLATE`, PR templates and `CODEOWNERS` where they are (see §3.4 for GitLab templates).
|
||||
2. **Delete GitHub-only workflows/config:** CodeQL (`github/codeql-action`), `.github/dependabot.yml`, dependency-review, `actions/upload-pages-artifact`/`deploy-pages`, stale-bot, GitHub-App-based bots, `github/codeql-action/upload-sarif`.
|
||||
3. **Caller stubs → ops repo.** Replace calls to `poli0981/.github/.github/workflows/<x>.yml@…` with:
|
||||
```yaml
|
||||
uses: poli0981/.github/.gitea/workflows/<x>.yml@<full-sha> # ops vYYYY.MM.N
|
||||
```
|
||||
Pass secrets **explicitly** (`secrets: { NAME: ${{ secrets.NAME }} }`), the repo convention; Gitea also supports `secrets: inherit` (source).
|
||||
Callers of the notifiers (`notify-*`, `announce-release`) also pass `ops_ref: <the same full-sha>`, so the script they load matches the workflow.
|
||||
Renovate does **not** bump these pins. It reads no version in `# ops …`, so it skips the stub as `unversioned-reference` (measured, Renovate 44). Bump them by hand when the ops repo is tagged (§4.1).
|
||||
4. **`runs-on` mapping:**
|
||||
|
||||
| Was | Becomes | Note |
|
||||
|---|---|---|
|
||||
| `windows-latest`, `windows-2022/2025` | `windows-latest` | Host mode on the maintainer PC. Tools already installed there; do not `choco install` system-wide |
|
||||
| `ubuntu-latest`, `ubuntu-2x.04` | same label | Docker image `docker.gitea.com/runner-images` |
|
||||
| `macos-*` | **remove job** or guard with `if: false` + comment `# no macOS runner (Gitea)` | Report it |
|
||||
| matrix over OS | drop the macOS entries | |
|
||||
|
||||
5. **`permissions:` mapping** (keep explicit blocks, it is the repo convention):
|
||||
- Keep: `contents`, `issues`, `pull-requests`, `actions`, `packages`.
|
||||
- **Remove** (unsupported on Gitea): `id-token`, `statuses`, `checks`, `deployments`, `security-events`, `pages`, `attestations`.
|
||||
- Release jobs: add `releases: write` next to `contents: write` (**VERIFY** which one Gitea enforces).
|
||||
6. **Action replacement table** (pin SHAs, see rule 6):
|
||||
|
||||
| GitHub action | Gitea replacement |
|
||||
|---|---|
|
||||
| `actions/checkout`, `actions/setup-dotnet`, `actions/setup-node`, `actions/setup-python`, `pnpm/action-setup`, `astral-sh/setup-uv`, `dtolnay/rust-toolchain`, `actions/cache` | Keep (work on Gitea). Pin SHA |
|
||||
| `actions/upload-artifact@v4+` / `download-artifact@v4+` | `christopherhx/gitea-upload-artifact@v4` / `christopherhx/gitea-download-artifact@v4` (upstream v4 refuses to run on non-GitHub servers). **VERIFY** |
|
||||
| `softprops/action-gh-release`, `ncipollo/release-action` | `https://gitea.com/actions/gitea-release-action@<sha>` (inputs: `files`, `tag_name`, `name`, `body_path`, `draft`, `prerelease`; token defaults to `github.token`). Notes + links only, no binaries (§1) |
|
||||
| `tauri-apps/tauri-action` | Remove. Build with the Tauri CLI and publish to R2 (§5.2) |
|
||||
| `cloudflare/wrangler-action` | `npx wrangler deploy` (or `pnpm dlx`) with `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` env |
|
||||
| `JetBrains/qodana-action` | Ops `reusable-qodana.yml` (§4.5), or its CLI steps in a local job when the scan needs build pre-steps. The action relies on GitHub APIs for annotations |
|
||||
| `github/codeql-action/*` | Delete; Opengrep job from ops repo (§4.3) |
|
||||
| `SonarSource/*` (SonarQube Cloud) | Remove everywhere, with `sonar-project.properties`, `dotnet-sonarscanner` and the `SONAR_TOKEN` secret (decided 2026-11-23, D1) |
|
||||
| `actions/attest-build-provenance`, `ossf/scorecard-action`, `actions/dependency-review-action` | Remove (no OIDC, no code-scanning UI, no dependency graph); report it (D7) |
|
||||
| `gh` CLI in `run:` steps | Gitea REST API with the job token ([`migration/README.md`](migration/README.md), "`gh` CLI → Gitea API") |
|
||||
| `actions/github-script`, `peter-evans/*` (create-PR, comment) | Remove or rewrite against the Gitea API with `GITEA_TOKEN`; report it |
|
||||
| `aquasecurity/trivy-action`, `setup-trivy` | Remove (supply-chain incident Mar 2026). osv-scanner covers dependencies |
|
||||
| Any R2 / S3 upload action | Ops reusable workflow `publish-r2.yml` (§4.4) or `vpk upload s3` (§5.1) |
|
||||
|
||||
7. **Expressions/contexts:** `github.repository`, `github.ref_name`, `github.sha`, `github.server_url` work. Hard-coded `https://github.com` in expressions → `${{ github.server_url }}`.
|
||||
8. **Ignored or different on Gitea:** `jobs.<id>.environment` (ignored), problem matchers/annotations (ignored), PR `ref` is `refs/pull/N/head` (no merge preview), `GITEA_TOKEN` cannot publish to the repo's own package registry (use a PAT secret if ever needed).
|
||||
9. **Schedules:**
|
||||
- Cron is **UTC**. Every `cron:` must fall inside **13:00–16:00 UTC** (20:00–23:00 Vietnam). Convert existing crons and list old → new in the hand-off report.
|
||||
- Do not use the `TZ=` prefix (Gitea supports it, GitHub tooling and actionlint do not).
|
||||
- Pick a non-round minute (e.g. `17 13 * * *`, not `0 13 * * *` or `30 13 * * *`) and do not reuse a slot already taken in §8, so jobs from different repos do not pile up on the single runner.
|
||||
- Daily or weekly only. Anything that needs to run more often than daily, or must run while the PC is off: stop and report (§7).
|
||||
- Scheduled workflows run from the default branch only.
|
||||
|
||||
### 3.3 Release & update channel
|
||||
|
||||
Releases move from GitHub Releases to **R2: `https://releases.poli0981.dev/<app>/`** (update feeds and downloads) plus an optional **Gitea release** with notes and links. Per stack:
|
||||
|
||||
- **Velopack apps:** §5.1. `UpdateManager` source → `https://releases.poli0981.dev/<app>`.
|
||||
- **Tauri apps:** §5.2. Updater endpoint → `https://releases.poli0981.dev/<app>/latest.json`.
|
||||
- **Web apps:** no release artifacts; deploy job only.
|
||||
- **Chrome extension:** store submission only; optional zip under `releases.poli0981.dev/<app>/<version>/`.
|
||||
|
||||
Rules for everything uploaded to R2:
|
||||
- Upload versioned files first, the files clients poll (`releases.*.json`, `RELEASES`, `latest.json`) **last**, so a client never sees a feed that points to files not uploaded yet.
|
||||
- Only names listed under "Release caching" in §1 may be overwritten. All other names must contain the version.
|
||||
- Never delete objects from CI, except Velopack's own `--keepMaxReleases` pruning (§5.1).
|
||||
|
||||
Existing installs still point at GitHub and **cannot be redirected** from here. Report which apps are affected (§7 item 5).
|
||||
|
||||
### 3.4 Metadata, links, docs
|
||||
|
||||
Replace `github.com/poli0981/<repo>` as follows:
|
||||
|
||||
| Kind of link | New target |
|
||||
|---|---|
|
||||
| Source, clone, homepage, `RepositoryUrl`, `repository` fields | `https://git.poli0981.dev/poli0981/<repo>` |
|
||||
| Bug report / issue / feature request links (README, `package.json` `bugs`, `pyproject` `Issues`, in-app "Report a bug") | `https://gitlab.com/poli0981/<repo>/-/issues` (new issue: `…/-/issues/new`) |
|
||||
| Download links | `https://releases.poli0981.dev/<app>/…` (exact file names, §5) |
|
||||
|
||||
Files to check:
|
||||
|
||||
- `README*.md`: badges, clone commands, issue links. Workflow badge: `https://git.poli0981.dev/poli0981/<repo>/actions/workflows/<file>.yml/badge.svg?branch=main` (**VERIFY**; Gitea's Actions page has a badge dialog). Add a short **"Where things live"** section:
|
||||
> Source: `git.poli0981.dev/poli0981/<repo>` (canonical). Mirror for issues and merge requests: `gitlab.com/poli0981/<repo>`. Patches and questions: `code@poli0981.dev`. Security: `security@poli0981.dev` (see `SECURITY.md`).
|
||||
- `.csproj` / `Directory.Build.props`: `RepositoryUrl`, `PackageProjectUrl`, `RepositoryType=git`.
|
||||
- `package.json`: `repository`, `bugs`, `homepage`. `Cargo.toml`: `repository`, `homepage`. `pyproject.toml`: `[project.urls]` (`Source` → Gitea, `Issues` → GitLab).
|
||||
- `tauri.conf.json` updater endpoints (§5.2); WXT/extension manifest `homepage_url`.
|
||||
- **In-app strings:** About/Help/"Report a bug" links in `.resx` (EN/VI/JA kept in parity), Svelte i18n files, constants. "Report a bug" → GitLab issues.
|
||||
- `CLAUDE.md` and the doc suite: CI paths (`.gitea/workflows`), release process (R2), forge URLs, runner and schedule facts (§1). Add a short "Forge & CI" section pointing to this runbook.
|
||||
- `SECURITY.md`: GitHub private vulnerability reporting no longer exists. Report by e-mail to `security@poli0981.dev` (or the address the repo already uses). Say explicitly: **do not open public issues on the GitLab mirror for vulnerabilities.**
|
||||
- `CONTRIBUTING.md`: canonical repo is on Gitea (read-only for outsiders). Issues and merge requests: GitLab mirror. Patches by e-mail (`git format-patch` / `git send-email`) to `code@poli0981.dev`. The maintainer applies accepted changes on Gitea; the mirror then updates GitLab and the MR is marked merged or closed. Mention that GitLab CI does not run on MRs; the maintainer runs CI on Gitea.
|
||||
- Issue/MR templates: GitLab does not read GitHub issue forms. Convert each `.github/ISSUE_TEMPLATE/*.yml|*.md` to Markdown in `.gitlab/issue_templates/<Name>.md` and the PR template to `.gitlab/merge_request_templates/Default.md`. Keep the `.github/` originals: Gitea reads `.gitea/ISSUE_TEMPLATE`, `.github/ISSUE_TEMPLATE` and `.github/issue_template` (source). Drop `config.yml` contact links that point to GitHub.
|
||||
- `.github/CODEOWNERS` → `.gitea/CODEOWNERS`: Gitea reads only `CODEOWNERS`, `docs/CODEOWNERS` and `.gitea/CODEOWNERS`, and treats a pattern without `*` as a regular expression (source).
|
||||
- `.gitmodules`: GitHub URLs → Gitea URLs (only for repos that now live on Gitea).
|
||||
- Leave historical `CHANGELOG` entries untouched.
|
||||
|
||||
### 3.5 Dependencies, security, quality
|
||||
|
||||
1. **Renovate:** add `renovate.json` at repo root:
|
||||
```json
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["local>poli0981/renovate-config"]
|
||||
}
|
||||
```
|
||||
Delete `.github/dependabot.yml`. Do not add a `schedule` or a github.com token here: the central runner's cron is the schedule, and github.com tags are read over git (§4.2). Two steps belong to the maintainer, so list them in the hand-off (§3.8): add `renovate-bot` as a Write collaborator, or Renovate never sees the repo; and create the labels `dependencies` and `security`, or its PRs go out unlabelled. `maintainer/gitea-repo-setup.ps1 -Only <repo>` in the ops repo does both.
|
||||
2. **Security workflow:** add a caller to the ops repo's `security.yml` (§4.3) on `push` to `main`, `pull_request`, and a weekly schedule inside the window (§3.2 item 9).
|
||||
3. **.NET:** keep NuGetAudit on. `net10.0+` audits transitive packages by default; for `net8.0`/`net9.0` projects set `<NuGetAuditMode>all</NuGetAuditMode>` in `Directory.Build.props`. CI should fail on `NU1903`/`NU1904` (high/critical) only. Consider `<AnalysisMode>All</AnalysisMode>` for CA security rules if not already set (report, don't force).
|
||||
4. **Rust (Tauri):** add `deny.toml` (advisories + licenses compatible with GPL-3.0 + sources = crates.io only) for `cargo deny check`.
|
||||
5. **Qodana:** keep `qodana.yaml`. Call the ops `reusable-qodana.yml` (§4.5) with `QODANA_TOKEN`, or run the same CLI steps in a local job when the scan needs build pre-steps:
|
||||
- .NET/WPF (`net*-windows` TFMs) **must** run in native mode on `windows-latest`: `qodana scan --linter qodana-dotnet --within-docker false` (flags as in the CLI 2026.3.1 README; native mode on the runner is **VERIFY**).
|
||||
- JS/TS, Python: Docker linters on `ubuntu-latest` are fine.
|
||||
- Report that the Qodana Cloud project's VCS URL must point to the Gitea HTTPS URL (maintainer task).
|
||||
|
||||
### 3.6 Secrets inventory (output only)
|
||||
|
||||
Produce a table for the maintainer. Prefer **user-level** Actions secrets/variables (Gitea → Settings → Actions) for values shared by many repos; repo-level only when specific.
|
||||
|
||||
| Name | Kind | Used by | Level | Source |
|
||||
|---|---|---|---|---|
|
||||
| `QODANA_TOKEN` | secret | qodana job | repo | Qodana Cloud project |
|
||||
| `R2_RELEASES_ACCESS_KEY_ID` / `R2_RELEASES_SECRET_ACCESS_KEY` | secret | release upload | user | R2 API token, Object Read & Write on `poli0981-releases` only |
|
||||
| `R2_ACCOUNT_ID` | **variable** | release upload | user | Cloudflare account ID. Use `${{ vars.R2_ACCOUNT_ID }}`; never hard-code it |
|
||||
| `CLOUDFLARE_API_TOKEN` / `CLOUDFLARE_ACCOUNT_ID` | secret | Workers deploy | user | Cloudflare API token (Workers edit) |
|
||||
| `TAURI_SIGNING_PRIVATE_KEY` / `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` | secret | Tauri release | repo | existing key (do not regenerate: it would break updates) |
|
||||
| store/publish tokens (NuGet, PyPI, Chrome Web Store) | secret | publish jobs | repo | only if the repo publishes |
|
||||
|
||||
Do **not** carry over `GITHUB_TOKEN` PAT secrets or anything GitHub-specific. That includes a github.com token for Renovate: none is needed (§4.2).
|
||||
|
||||
### 3.7 Verification (agent side)
|
||||
|
||||
- [ ] `grep` from §3.1 shows no remaining `github.com/poli0981` except history/changelog.
|
||||
- [ ] No `.github/workflows/` left; every workflow in `.gitea/workflows/` parses (`actionlint` if available; Gitea-specific keys may warn).
|
||||
- [ ] Every `uses:` is pinned to a 40-char SHA with a version comment.
|
||||
- [ ] No `macos-*`, `id-token`, CodeQL, Dependabot, `upload-sarif`, `tauri-action`, `trivy-action` left.
|
||||
- [ ] Every `cron:` is inside 13:00–16:00 UTC, on a non-round minute, daily or weekly.
|
||||
- [ ] Release secrets appear only in tag-push / `workflow_dispatch` jobs (rule 10).
|
||||
- [ ] Issue links point to GitLab, source links to Gitea, downloads to `releases.poli0981.dev`.
|
||||
- [ ] Project builds and tests pass locally (same commands CI runs).
|
||||
- [ ] `.resx` EN/VI/JA keys still in parity if strings changed.
|
||||
- [ ] Docs (`README`, `CLAUDE.md`, `SECURITY.md`, `CONTRIBUTING.md`, `.gitlab/` templates) updated.
|
||||
|
||||
### 3.8 Commit & hand-off report
|
||||
|
||||
Commit on `chore/gitea-migration`, push to `origin` (Gitea) only. Then output:
|
||||
|
||||
```
|
||||
## Gitea migration – <repo>
|
||||
Profiles: <…>
|
||||
Changed: <files grouped by purpose>
|
||||
Removed jobs/features: <macOS, CodeQL, … and why>
|
||||
Schedules: <old cron → new cron (UTC)>
|
||||
Needs pilot verification: <VERIFY items touched>
|
||||
Secrets/variables to create: <table from §3.6>
|
||||
Maintainer steps:
|
||||
1. Review & merge chore/gitea-migration (a new, empty repo has no main to merge into: §6)
|
||||
2. Create secrets / variables
|
||||
3. Repo Settings → enable Actions (was disabled during import)
|
||||
4. Qodana Cloud: set VCS URL to https://git.poli0981.dev/poli0981/<repo>.git
|
||||
5. GitLab mirror: run setup-mirrors.ps1 -Only <repo> if the repo is not mirrored yet
|
||||
6. Renovate: maintainer/gitea-repo-setup.ps1 -Only <repo> (renovate-bot as Write collaborator, labels dependencies + security; §3.5)
|
||||
7. <release/R2/Workers steps if any>
|
||||
Open questions: <…>
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## 4. Ops repo `poli0981/.github` (do this first)
|
||||
|
||||
### 4.1 Reusable workflows
|
||||
|
||||
- Move all 13 reusable workflows to `.gitea/workflows/`. Gitea 1.27+ expands reusable workflows server-side (nested calls, inputs, outputs, matrix supported); cross-instance URLs are not supported.
|
||||
- Apply §3.2 rules to each. Drop macOS/Swift jobs (keep the files for future, disabled with a header comment).
|
||||
- Replace caller-side assumptions (`github.event.repository.*` fields that Gitea may not populate) with explicit `inputs`. **VERIFY** per workflow.
|
||||
- Tag releases of the ops repo (`vYYYY.MM.N`) and have callers pin the **commit SHA** of the tag. Latest: **`v2026.11.5`** (2026-11-26, `b93b3711b3049a879cfdfd515f7e72c23864da8f`, signed): the release-pipeline notifier names the Velopack apps released from Gitea, and `security.yml` restores .NET on Docker runners without ICU. HashTool and CommandForge pin it; the other migrated repos stay on their tag until their next change.
|
||||
- How Gitea runs a called workflow (source): it expands the call on the server. `owner/repo/…@ref` reads that repo on this instance, never `DEFAULT_ACTIONS_URL`. `./…` inside a called workflow resolves to the called workflow's own repo and commit, so the ops reusables call each other with `./`. A job-level `if:` sees the caller's `github.event_name`. Called jobs get only the secrets in the caller's `secrets:` map, plus the job token.
|
||||
- `workflow_run` on Gitea (source): `workflow_run` has no `name` and no `head_commit`, and `head_branch` is empty for tag runs. Use `github.event.workflow.name`, `workflow_run.display_title` (the commit title) and the ref after `@` in `workflow_run.path`. The ops notifiers do.
|
||||
- `.gitea/workflows/ops-lint.yml` lints every workflow here (actionlint + shellcheck; `.github/actionlint.yaml` ignores only the Gitea features actionlint does not know) and the Python.
|
||||
- `renovate.json` lets Renovate bump the actions pinned here. Tools downloaded by SHA-256 (gitleaks, Opengrep, osv-scanner, cargo-deny, rclone, Qodana CLI, actionlint, shellcheck) are bumped by hand, version and checksum together.
|
||||
|
||||
### 4.2 `poli0981/renovate-config` (new repo)
|
||||
|
||||
`default.json` (as shipped 2026-11-23):
|
||||
```json
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended",
|
||||
"helpers:pinGitHubActionDigests",
|
||||
"group:allNonMajor"
|
||||
],
|
||||
"timezone": "Asia/Ho_Chi_Minh",
|
||||
"osvVulnerabilityAlerts": true,
|
||||
"labels": ["dependencies"],
|
||||
"dependencyDashboard": { "enabled": true, "osvVulnerabilitySummary": "unresolved" },
|
||||
"vulnerabilityAlerts": { "labels": ["dependencies", "security"] },
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "No github.com token on the runner, and GitHub's API refuses unauthenticated tag lookups: read the tags over git (ls-remote) instead. Our own repos live on Gitea and are never looked up on github.com.",
|
||||
"matchDatasources": ["github-tags"],
|
||||
"matchPackageNames": ["!poli0981/**"],
|
||||
"overrideDatasource": "git-tags",
|
||||
"overridePackageName": "https://github.com/{{packageName}}"
|
||||
},
|
||||
{
|
||||
"description": "Actions pinned to a branch (`@<sha> # main`) go through the github-digest datasource, which also needs GitHub's API: read the branch head over git (ls-remote) instead.",
|
||||
"matchDatasources": ["github-digest"],
|
||||
"matchPackageNames": ["!poli0981/**"],
|
||||
"overrideDatasource": "git-refs",
|
||||
"overridePackageName": "https://github.com/{{packageName}}"
|
||||
},
|
||||
{
|
||||
"description": "Supply-chain buffer: a new npm, NuGet, crates.io or PyPI release is proposed only once it is 3 days old. Not applied to git-tags/git-refs (the github.com lookups above) or docker: git has no release timestamps, docker has them only on Docker Hub (not ghcr.io), and minimumReleaseAgeBehaviour's default (timestamp-required) would hold an update without one forever. Security PRs are exempt: vulnerabilityAlerts sets minimumReleaseAge to null, and OSV fixes apply that config.",
|
||||
"matchDatasources": ["npm", "nuget", "crate", "pypi"],
|
||||
"minimumReleaseAge": "3 days"
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
No `schedule` key: Renovate only runs when the runner workflow below runs, and a late start (PC switched on late) must not be blocked by a time window. `dependencyDashboard` is an object since Renovate 44: the boolean form fails `renovate-config-validator --strict`.
|
||||
|
||||
Runner workflow `.gitea/workflows/renovate.yml` in the same repo: runs self-hosted Renovate on `ubuntu-latest`, cron `31 13 * * *` (20:31 Vietnam) plus `workflow_dispatch`, with:
|
||||
- The job inside Renovate's own image, `ghcr.io/renovatebot/renovate:<version>@sha256:<digest>`: the slim (containerbase) image installs each repo's lockfile tools at runtime. act replaces a job container's ENTRYPOINT, so the step runs `/usr/local/sbin/renovate-entrypoint.sh renovate` itself (**VERIFY**). The repo's own `renovate.json` keeps the image pin current.
|
||||
- `RENOVATE_PLATFORM=gitea`, `RENOVATE_ENDPOINT=https://git.poli0981.dev/api/v1`, `RENOVATE_AUTODISCOVER=true`, `RENOVATE_AUTODISCOVER_FILTER=poli0981/*`
|
||||
- `RENOVATE_TOKEN` = PAT of a dedicated `renovate-bot` user (scopes: repository R/W, user R, issue R/W, organization R). Maintainer creates the user and PAT.
|
||||
- `RENOVATE_GIT_AUTHOR="Renovate Bot <renovate-bot@poli0981.dev>"`
|
||||
- `RENOVATE_GITHUB_TOKEN_WARN=false`: a global-only option, so it lives here and not in the preset (see below).
|
||||
- `concurrency: renovate` so a late run and a manual run never overlap.
|
||||
|
||||
**github.com without a token** (nothing GitHub-specific, §3.6). With no github.com token, Renovate skips every `github-tags` / `github-releases` dependency as `github-token-required`, every action pin included. The fix has two parts, and needs both: `RENOVATE_GITHUB_TOKEN_WARN=false` lets those dependencies reach the lookup, and the preset's package rule sends it to `git-tags` (`git ls-remote`, with annotated tags resolved to their commit). The switch alone fails, because `github-tags` asks GitHub's GraphQL API, which refuses unauthenticated calls (403). Measured 2026-11-23 on ticktune's 7 workflows under `.gitea/workflows`: 38 of 38 action pins resolved, no call to `api.github.com`. Still not covered: a `github-releases` dependency fails, visibly on the Dependency Dashboard, and PRs get no release notes from GitHub. Actions pinned to a branch (`@<sha> # main`) go through `github-digest`, which needs the API too; the second rule reads the branch head over git (`git-refs`).
|
||||
|
||||
**Vulnerabilities.** OSV alerts open their own PRs, labelled `dependencies` + `security`, without the 3-day release age that holds every other npm, NuGet, crates.io, PyPI and pub.dev update (pub.dev joined on 2026-11-27, renovate-config #7, for MarkLens: the block above is the file as first shipped); the Dependency Dashboard lists the open advisories.
|
||||
|
||||
**Which repos.** Gitea autodiscovery lists the repos the bot owns or collaborates on, and Renovate keeps the ones it can push to. So add `renovate-bot` as a **Write** collaborator on each repo (`poli0981` is a user, not an org: there are no teams). Create the labels `dependencies` and `security` in each repo: Renovate drops a missing label silently. `maintainer/gitea-repo-setup.ps1` (ops repo) does both steps for every repo; run it with `-DryRun` first. Onboarding stays on. A repo the bot can see without a `renovate.json` gets a "Configure Renovate" PR that proposes `local>poli0981/renovate-config`, because Renovate finds the preset by this repo's name.
|
||||
|
||||
### 4.3 `security.yml` (reusable)
|
||||
|
||||
Inputs: `rust` (bool), `node` (bool), `dotnet` (bool), `python` (bool). Jobs on `ubuntu-latest` unless noted:
|
||||
|
||||
| Job | Tool | Notes |
|
||||
|---|---|---|
|
||||
| secrets | gitleaks | full history scan, redact output, fail on findings |
|
||||
| sast | Opengrep | `--taint-intrafile`, SARIF uploaded as artifact (no code-scanning UI on Gitea). Pin rule sources |
|
||||
| deps | osv-scanner | scan lockfiles (`packages.lock.json`, `pnpm-lock.yaml`, `Cargo.lock`, `uv.lock`) |
|
||||
| rust | cargo-deny | only when `rust: true` |
|
||||
| dotnet | `dotnet restore` with NuGetAudit | `windows-latest` when the solution targets `net*-windows` |
|
||||
|
||||
Pin tool versions and verify checksums when downloading binaries. Check exact CLI flags with `--help` (**VERIFY**). Callers schedule it weekly inside the window, e.g. `43 14 * * 6` (Saturday 21:43 Vietnam), staggered per repo.
|
||||
|
||||
### 4.4 `publish-r2.yml` (reusable, new)
|
||||
|
||||
For uploads that are not done by `vpk` (Tauri, extension zips, other files).
|
||||
|
||||
- Inputs: `app` (string, folder under the bucket), `versioned-dir` (path uploaded first), `feed-files` (newline list of paths uploaded last, e.g. `latest.json`), `runs-on` (default `windows-latest`).
|
||||
- Secrets: `R2_RELEASES_ACCESS_KEY_ID`, `R2_RELEASES_SECRET_ACCESS_KEY`. Variable: `R2_ACCOUNT_ID`.
|
||||
- Tool: rclone (pinned version, checksum verified), configured only through env vars, as in the server backup script:
|
||||
`RCLONE_CONFIG_R2_TYPE=s3`, `RCLONE_CONFIG_R2_PROVIDER=Cloudflare`, `RCLONE_CONFIG_R2_ENDPOINT=https://<account>.r2.cloudflarestorage.com`, `RCLONE_CONFIG_R2_REGION=auto`, `RCLONE_CONFIG_R2_NO_CHECK_BUCKET=true`, keys from secrets.
|
||||
No other variable may start with `RCLONE_`: rclone reads every `RCLONE_<FLAG>` as that flag, and the pin `RCLONE_VERSION` broke `rclone version` in v2026.11.3, before anything was uploaded. The pins are `PINNED_RCLONE_*` since v2026.11.4.
|
||||
- Steps: `rclone copy <versioned-dir> r2:poli0981-releases/<app>/` (never `sync`, never `delete`), then `rclone copyto` each feed file, then `curl -fsSI https://releases.poli0981.dev/<app>/<feed>` as a smoke test.
|
||||
- Runs on any tag (`refs/tags/*`, push or dispatch), not only `v*`: free-steam-games-list releases its apps from `desktop-v*` and `android-v*` tags (ops v2026.11.3). Feeds land at `<app>/<file name>`, so two feeds of one app need two names (`latest.json`, `android-latest.json`).
|
||||
- Permissions: `contents: read` only.
|
||||
|
||||
### 4.5 `reusable-qodana.yml` (reusable, new)
|
||||
|
||||
Qodana CLI scan for any stack; replaces `JetBrains/qodana-action`.
|
||||
|
||||
- Inputs: `runs-on` (`ubuntu-latest` | `windows-latest`), `linter`, `config`, `project-dir`, `repository-root`, `working-directory` (where `package.json` and the lockfile are), `extra-args`, `package-manager` (`none` | `npm` | `pnpm`; installs with scripts off), `node-version` / `node-version-file`, `dotnet-version` / `dotnet-global-json-file`, `prepare-command`, `within-docker`, `artifact-name`. Secret: `QODANA_TOKEN`.
|
||||
- A project in a subdirectory passes `project-dir: <dir>` with `repository-root: .`; `extra-args` reaches `qodana scan` split on spaces (qodana-rust in Docker: `-u root -e CARGO_HOME=/data/cache/cargo`). Added in ops v2026.11.3 for free-steam-games-list's three projects.
|
||||
- Native mode by default. `within-docker: true` is for linters without one (`qodana-rust`): on `windows-latest` Docker Desktop runs the image (verified 2026-11-24 with free-steam-games-list's qodana-js and qodana-rust; the Rust image's apt and timeout traps are in [its guide](migration/free-steam-games-list.md)).
|
||||
- CLI pinned and SHA-256 verified; the report stays an artifact (no code-scanning UI); runs started by `renovate-bot` skip the job.
|
||||
|
||||
### 4.6 Tools and maintainer scripts in the ops repo
|
||||
|
||||
- `tools/migration-inventory.py`: the read-only inventory of §3.1.
|
||||
- `maintainer/gitea-repo-setup.ps1`: for every repo of `poli0981`, add `renovate-bot` as a Write collaborator and create the labels `dependencies` + `security` (`-DryRun`, `-Only`, `-Exclude`). Token: repository Read and Write, issue Read and Write, user Read.
|
||||
- [`migration/`](migration/README.md): per-repo guides, the cron-slot registry, the shared decisions D1–D16 and the `gh` → Gitea API table.
|
||||
|
||||
---
|
||||
|
||||
## 5. Stack profiles
|
||||
|
||||
### 5.1 .NET / WPF / Velopack (FrameLedger, OmniDeck, CommandForge, …)
|
||||
- Build/test/pack on `windows-latest` (host). C++ parts (FrameLedger hook engine) use the PC's existing MSVC toolchain.
|
||||
- Release job (tag push), credentials passed as env so they never appear on the command line:
|
||||
```yaml
|
||||
env:
|
||||
VPK_BUCKET: poli0981-releases
|
||||
VPK_PREFIX: <app>/ # trailing slash: objects become <app>/releases.win.json
|
||||
VPK_ENDPOINT: https://${{ vars.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com
|
||||
VPK_KEY_ID: ${{ secrets.R2_RELEASES_ACCESS_KEY_ID }}
|
||||
VPK_SECRET: ${{ secrets.R2_RELEASES_SECRET_ACCESS_KEY }}
|
||||
```
|
||||
1. `vpk download s3 --channel win -o releases` (previous release, for delta packages; first release: ignore the "nothing found" result).
|
||||
2. `vpk pack -u <PackId> -v <version> -p <publish dir> -o releases …` (existing flags of the repo).
|
||||
3. `vpk upload s3 --channel win -o releases --keepMaxReleases 10`.
|
||||
- **Verified 2026-11-26 on CommandForge** (vpk 1.2.161, [its guide](migration/commandforge.md)): `vpk … s3` works against R2 with the endpoint only (no region, default checksums), the objects land under `<app>/`, and vpk reads every option from `VPK_<OPTION>` environment variables. `vpk download s3` on an empty folder finds 0 releases and exits 0, so a dispatched dry run can check the credentials. `vpk upload s3` publishes the packages, Setup.exe and Portable.zip, then `releases.win.json` and `RELEASES` (`no-cache`); not `assets.win.json`. Fallback if it ever cannot talk to R2: `vpk download http --url https://releases.poli0981.dev/<app>` + `publish-r2.yml` (packages first, `releases.win.json` and `RELEASES` last).
|
||||
- Public files: the stable-named installer and portable zip that `vpk pack` writes, with the channel in the name: `<PackId>-win-Setup.exe` / `<PackId>-win-Portable.zip` (CommandForge, vpk 1.2.161). Both are matched by the cache-bypass rule. Link them from README and the Gitea release notes.
|
||||
- Other platforms later: Velopack makes a `.pkg` + portable `.zip` on macOS (needs a Mac; no macOS runner) and only a portable `.AppImage` on Linux. Feeds are `releases.osx.json` / `releases.linux.json`. All of these names are already covered by the cache-bypass rule (§1).
|
||||
- App code: `new UpdateManager("https://releases.poli0981.dev/<app>")` (HTTP source). Remove `GithubSource` usage and any GitHub token logic.
|
||||
- Qodana: native mode on Windows (§3.5).
|
||||
|
||||
### 5.2 Tauri 2 + React/TS + Rust (PipDock, …)
|
||||
- Build on `windows-latest` with the Tauri CLI; `TAURI_SIGNING_PRIVATE_KEY(_PASSWORD)` env produces `.sig` files.
|
||||
- Layout in the bucket: installer + `.sig` under `<app>/<version>/` (versioned, cacheable), `latest.json` at `<app>/latest.json` (not cached). Linux/macOS builds, if added later, go in the same `latest.json` (`linux-x86_64`, `darwin-aarch64`, …) with their files under `<version>/`; no cache change needed.
|
||||
- Generate `latest.json` (Tauri v2 updater format: `version`, `notes`, `pub_date`, `platforms.windows-x86_64.{signature,url}` with `url` = `https://releases.poli0981.dev/<app>/<version>/<installer>`) with a small script; upload with `publish-r2.yml` (`versioned-dir` first, `latest.json` last).
|
||||
- `tauri.conf.json` → `plugins.updater.endpoints: ["https://releases.poli0981.dev/<app>/latest.json"]`. **Keep the same updater public key.**
|
||||
- Add `cargo deny`, `cargo clippy -- -D warnings` if not present.
|
||||
|
||||
### 5.3 Web: Astro / SvelteKit + Cloudflare Workers (poli0981.dev, SoftHarbor, TickTune, TilePier, RepoLens, freeitchgames.win)
|
||||
- CI on `ubuntu-latest`: install, lint, typecheck, build, test.
|
||||
- Deploy job on `main`: `wrangler deploy` with `CLOUDFLARE_API_TOKEN`/`CLOUDFLARE_ACCOUNT_ID`. Disconnect Cloudflare's GitHub integration for the project (maintainer, dashboard).
|
||||
- Scheduled data refresh jobs (e.g. freeitchgames.win catalog): keep as a scheduled workflow, daily, inside 13:00–16:00 UTC (decided: delays when the PC is off are accepted). Update user-facing text that promises a time (e.g. "updated daily around 20:00–23:00 Vietnam time, may be delayed").
|
||||
- **RepoLens:** its data source was the GitHub API (GraphQL, with the suspended account's token). It reads the Gitea REST API anonymously since 2026-11-26 (v1.6.0); what that took is in [migration/repolens.md](migration/repolens.md).
|
||||
|
||||
### 5.4 Chrome extension: WXT + Svelte 5 (BookmarkMagic)
|
||||
- CI on `ubuntu-latest`: build + zip. Store submission stays manual or uses store API secrets (repo-level).
|
||||
- Update `homepage_url` and any "GitHub" links in the UI/store listing text kept in the repo (issues → GitLab).
|
||||
|
||||
### 5.5 Python (PipDock adapters, CommandForge for Linux, scripts)
|
||||
- CI on `ubuntu-latest` with `uv`. Ruff with `S` rules if not present (report).
|
||||
- PyPI Trusted Publishing (OIDC) is unavailable → API token secret, only if the project publishes.
|
||||
|
||||
### 5.6 Go / Swift / other stacks in the CI suite
|
||||
- Go: unchanged on `ubuntu-latest`.
|
||||
- Swift/macOS: no runner. Disable with a comment; report.
|
||||
|
||||
---
|
||||
|
||||
## 6. Known Gitea Actions & mirror behaviours (reference)
|
||||
|
||||
- Workflows directory: use `.gitea/workflows/` (official examples). Do not keep both `.github/workflows/` and `.gitea/workflows/`.
|
||||
- Reusable workflows: supported, including from private repos (1.26+) and nested (1.27+). `$/` prefix supported (28.x).
|
||||
- `concurrency`: supported (1.26+). `continue-on-error`: implemented (28.x). Older docs that say "ignored" are outdated.
|
||||
- `permissions`: supported for `GITEA_TOKEN` with Gitea scopes (`code`, `releases`, `wiki`, `projects` added; GitHub-only scopes unsupported).
|
||||
- Artifacts v4: server supports it; use the patched Gitea artifact actions (§3.2).
|
||||
- Schedules: cron is evaluated in UTC unless a `TZ=` prefix is given; only the default branch's workflows are scheduled. Jobs nobody picks up stay "waiting" and are cancelled after `ABANDONED_JOB_TIMEOUT` (24 h default).
|
||||
- Empty repos: the first branch pushed to an empty repo becomes its default branch, so its scheduled workflows are the ones that run. Seen 2026-11-23 on `renovate-config`: `HEAD` is `chore/gitea-migration` and there is no `main`. For a new repo, create `main` from the reviewed branch (`git push origin <branch>:main`), make it the default branch, then delete the branch.
|
||||
- Job containers (`jobs.<id>.container`): act replaces the image's ENTRYPOINT with its own keep-alive command. An image that needs its entrypoint must have it called from a step, as Renovate's is (§4.2). **VERIFY**.
|
||||
- Fork PRs: never run on the host-mode Windows runner without review.
|
||||
- Events caused by the job token start no workflow: Gitea skips the Actions user, as GitHub skips `GITHUB_TOKEN` (scheduled workflows are still refreshed). A release or PR made by CI triggers nothing. `workflow_dispatch` through the API starts a run whoever calls it; the job token needs `actions: write` (source).
|
||||
- **A dispatched run writes no commit status** (measured 2026-11-24 on 28.4.0, poli0981-dev): statuses come from push and pull_request runs only. A bot PR that waits for a dispatched CI run (D5) never meets a required check, and merging is refused with 405 "Not all required status checks successful". Record the result yourself from a later job of the same run: `POST /repos/{owner}/{repo}/statuses/{sha}` `{state, context, target_url}` with the job token (`contents: write`), using a context the protection pattern matches (`CI / build (workflow_dispatch)` for `CI / build (*)`).
|
||||
- Steps and processes (measured 2026-11-24): a process a step starts in the background (`cmd &`) is gone when the next step starts, so start a server and run what needs it in the same step. In the job container `localhost` can resolve to ::1 for a server and to 127.0.0.1 for a client (Node's fetch): bind and call `127.0.0.1` explicitly. An action whose tarball holds paths that differ only in case cannot be unpacked (the runner's action cache sits on the Windows disk), e.g. `treosh/lighthouse-ci-action`; run its CLI with `npx` instead.
|
||||
- .NET on the runners (measured 2026-11-26, HashTool): the Docker images (`docker.gitea.com/runner-images`) have **no ICU**, and .NET stops at start-up without it. Jobs that need cultures (tests, an app's smoke test) `apt-get install libicu-dev` (the container runs as root); jobs that only restore, build or run tools set `DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1`. On the host-mode Windows runner, `shell: bash` may resolve to `System32\bash.exe` (WSL), there is no `python3`, and PowerShell cannot load `Microsoft.PowerShell.Archive` (`Compress-Archive` fails; use `[IO.Compression.ZipFile]`): write Windows steps in `pwsh`.
|
||||
- The job token reads any public repo of the instance; another private repo only with the owner's cross-repo Actions setting (source).
|
||||
- Run links `/{owner}/{repo}/actions/runs/{id}` take the run ID; old run-number links redirect (source).
|
||||
- Issue templates: Gitea reads `.gitea/ISSUE_TEMPLATE`, `.github/ISSUE_TEMPLATE` and `.github/issue_template` (source). GitLab only reads `.gitlab/issue_templates/*.md` and `.gitlab/merge_request_templates/*.md`.
|
||||
- Push mirror to GitLab: Gitea force-pushes all branches and tags (deletions included) after each push and every 8 h. GitLab protects the default branch against force pushes, so rewriting `main` on Gitea makes the mirror fail (`last_error`) until fixed on GitLab. LFS objects are pushed too.
|
||||
|
||||
---
|
||||
|
||||
## 7. Maintainer decisions
|
||||
|
||||
### Resolved (November 2026)
|
||||
|
||||
1. **Release hosting:** R2 bucket `poli0981-releases`, public only via `releases.poli0981.dev`, one folder per app (§1, §3.3, §5).
|
||||
2. **Outside contributions:** through the GitLab mirror (issues, merge requests) or by e-mail (`code@`, `security@` and other addresses already in the repos). Gitea registration stays disabled.
|
||||
3. **Mirrors:** every public, non-archived repo gets a push mirror to GitLab (`setup-mirrors.ps1`), except `.github` and `.profile` unless renamed with `-NameMap`.
|
||||
4. **Scheduled jobs:** run only 13:00–16:00 UTC (20:00–23:00 Vietnam) while the PC is on; delays from power cuts and similar are accepted. No Workers Cron or VPS jobs for now.
|
||||
|
||||
Also resolved (2026-11-23): **Renovate and github.com.** No github.com token; Renovate reads github.com tags over git (§4.2).
|
||||
|
||||
Also resolved (2026-11-23): **SonarQube Cloud is dropped** in every repo (D1 in [`migration/README.md`](migration/README.md)).
|
||||
|
||||
Also resolved (2026-11-23), by the agent on the maintainer's instruction; the maintainer can reverse any of them:
|
||||
|
||||
5. **Existing users on GitHub update feeds:** one announcement post on poli0981.dev and the Discord announcement. It names each app, its new download page (`releases.poli0981.dev/<app>/`) and what an installed copy does: Velopack and Tauri apps released before their move check a feed that no longer answers, so their users download the new version once by hand; macOS installs get no further builds (D9). SoftHarbor's listings change in their own data PRs. A GitHub bridge release only if the account is ever restored.
|
||||
6. **Ops repo name:** keep `.github`. Every caller pins its path, so a rename would touch every repo for nothing. Owner-level workflows are evaluated after the migration.
|
||||
7. **Web deploys while the PC is off:** no Workers Builds on the GitLab mirror. Deploys run from Gitea CI (D3) and wait for the PC like any job.
|
||||
8. **Shared decisions for the remaining repos:** [`migration/README.md`](migration/README.md) D2–D16, all decided.
|
||||
|
||||
### Open
|
||||
|
||||
None (2026-11-23). A new question goes into [`migration/README.md`](migration/README.md) as D17 onward; the agent flags it and does not choose.
|
||||
|
||||
---
|
||||
|
||||
## 8. Progress tracker
|
||||
|
||||
| Repo | Profile | Migrated branch | Secrets set | Actions on | CI green | Release path OK | GitLab mirror | Cron slots (UTC) |
|
||||
|---|---|---|---|---|---|---|---|---|
|
||||
| `.github` (ops) | ops | ☑ merged | ☐ | ☐ | ☐ | n/a | excluded | `7 14 * * 0` (weekly digest) |
|
||||
| `renovate-config` | ops | ☑ merged | ☑ | ☑ | ☑ first run 2026-11-23 | n/a | ☐ | `31 13 * * *` (Renovate) |
|
||||
| ticktune (pilot) | web | ☑ merged 2026-11-23 (Gitea #1, #2) | ☑ | ☑ | ☑ | ☑ v2.3.1 deployed from a signed tag | ☑ | `37 14 * * 1`, `13 15 * * 1`, `29 15 * * 3` |
|
||||
| pipdock | tauri | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed in [migration/](migration/README.md) |
|
||||
| frameledger | dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| OmniDeck | dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| bookmarkmagic | extension | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| softharbor | web | ☑ merged 2026-11-24 (Gitea #1, #2, #3) | ☑ | ☑ | ☑ | ☑ v1.5.0 deployed by the CI `deploy` job, Gitea release published by hand | ☑ | `17 13 * * *`, `59 13 * * *`, `43 14 * * 1`, `37 15 * * 2` |
|
||||
| poli0981-dev | web | ☑ merged 2026-11-24 (Gitea #1, #3) | ☑ | ☑ | ☑ | ☑ v2.4.0 deployed by the CI `deploy` job | ☑ | `13 14 * * 3` (security) |
|
||||
| tilepier | web | ☐ | ☐ | ☐ | ☐ | n/a | ☐ | proposed |
|
||||
| HashTool | dotnet | ☑ merged 2026-11-26 (Gitea #2) | ☑ | ☑ | ☑ | ☑ 1.3.1 on R2 (`vpk upload s3` win + linux, rclone for `<version>/`), Gitea release by CI | ☑ | `43 13 * * 1` (security), `53 13 * * 4` (qodana) |
|
||||
| youtube-generator | web + tauri | ☑ merged 2026-11-26 (Gitea #2, #3, #4) | ☑ | ☑ | ☑ | ☑ v1.7.0 on R2, site deployed by the CI `deploy` job | ☑ | `37 13 * * 3` (security), `53 15 * * 1` (rust) |
|
||||
| youtube-auto-post | python | ☐ | ☐ | ☐ | ☐ | n/a | ☐ | proposed |
|
||||
| jsonPrism | web + tauri | ☑ merged 2026-11-27 (Gitea #2) | ☑ (two Discord webhooks missing, see its guide) | ☑ | ☑ | ☑ v2.3.0 on R2, site deployed by the CI `deploy` job | ☑ | `19 13 * * 5` (security) |
|
||||
| MarkLens | flutter | ☑ merged 2026-11-27 (Gitea #2, #3) | ☑ | ☑ | ☑ | ☑ v1.1.0 on R2 with the `latest.json` feed, Gitea release by CI | ☑ | `23 15 * * 5` (security) |
|
||||
| captureimg | dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| QuoteAtlas | web + tauri | not on Gitea yet | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| AppLedger | dotnet | not on Gitea yet | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| WardSweep | rust + dotnet | ☐ | ☐ | ☐ | ☐ | ☐ | ☐ | proposed |
|
||||
| free-steam-games-list | data + web + tauri | ☑ merged 2026-11-24 (Gitea #1) | ☑ | ☑ | ☑ | ☑ v4.8.0 / apps 2.6.0 on R2 | ☐ | `3 13 * * *` (data-daily), `49 15 * * 2` (security) |
|
||||
| free-games-itchio-list | data + web + tauri | ☑ merged 2026-11-25 (Gitea #1) | ☑ | ☑ | ☑ | ☑ v4.7.0 on R2 | ☑ | `27 13 * * *` (update), `49 13 * * *` (refresh), `1 15 * * 3` (security) |
|
||||
| RepoLens | web | ☑ merged 2026-11-26 (Gitea #2) | ☑ | ☑ | ☑ | ☑ v1.6.0 deployed by the CI `deploy` job | ☑ private (2026-11-27) | `11 13 * * *` (smoke), `33 14 * * 2` (security) |
|
||||
| content | content (submodule of poli0981-dev) | ☑ main on Gitea 2026-11-24 | n/a | n/a | n/a | n/a | ☑ | none |
|
||||
| CommandForge | dotnet | ☑ merged 2026-11-26 (Gitea #2, #3) | ☑ | ☑ | ☑ | ☑ v2.3.0 on R2 (`vpk upload s3`), Gitea release by CI | ☑ | `11 14 * * 5` (security) |
|
||||
| any repo not listed (not inventoried) | | | | | | | | |
|
||||
|
||||
The cron slots themselves are registered in [migration/README.md](migration/README.md#cron-slots-utc--the-registry).
|
||||
|
||||
---
|
||||
|
||||
## 9. GitLab mirror & outside contributions (maintainer)
|
||||
|
||||
**Setup / new repo:** `.\setup-mirrors.ps1 -GitLabNamespace poli0981 -DryRun`, then without `-DryRun` (or `-Only <repo>`). Revoke the short-lived `api` token afterwards.
|
||||
|
||||
**Token rotation:** the `write_repository` token stored in Gitea expires after at most 365 days. Before that date: create a new token, run the script with `-Rotate`, then revoke the old token.
|
||||
|
||||
**Notifications:** GitLab → Preferences → Notifications: set the global level (or each project) to **Watch**, otherwise new issues and MRs from strangers do not send e-mail.
|
||||
|
||||
**Applying a GitLab merge request** (on the PC, in the Gitea clone):
|
||||
```bash
|
||||
git fetch https://gitlab.com/poli0981/<repo>.git merge-requests/<iid>/head:mr-<iid>
|
||||
git log --oneline main..mr-<iid> # review; run tests / CI on a Gitea branch first if needed
|
||||
git switch main
|
||||
git merge --no-ff mr-<iid> # keeps the contributor's commit SHAs
|
||||
git push origin main # Gitea pushes to GitLab; the MR normally shows as merged
|
||||
```
|
||||
If the commits were rebased or squashed (new SHAs), close the MR on GitLab with a link to the commit on Gitea.
|
||||
|
||||
**Patches by e-mail:** save the mails as `.patch`/`.mbox`, then `git am --3way <file>` on a branch, review, merge, push to Gitea.
|
||||
|
||||
**Security reports:** handled only by e-mail (`security@`). If one arrives as a public GitLab issue, make the issue confidential on GitLab and continue by e-mail.
|
||||
@@ -0,0 +1,167 @@
|
||||
# Per-repo migration guides
|
||||
|
||||
> **Audience:** the maintainer and the agent session that migrates one repository (runbook §0).
|
||||
> **Written:** 2026-11-23, from `tools/migration-inventory.py` run on the local clones in `E:\` and a read of each workflow's header (three batches: 8 repos, 7 more, then the last 6). Each guide names the commit it was written against. If the repo has moved on, re-run the inventory and trust the repo.
|
||||
|
||||
The runbook ([`../GITEA-MIGRATION.md`](../GITEA-MIGRATION.md)) is the procedure. A guide here only adds what is specific to one repository: what was decided for it, what to do with each workflow, the new cron slots, the secrets, the release path and the files that still point at GitHub.
|
||||
|
||||
## How to run one migration
|
||||
|
||||
1. Read the repo's **Decided** section and do any step it gives you before the session (a few repos are not on Gitea yet).
|
||||
2. Open a Claude Code session in the repo and give it:
|
||||
|
||||
> Follow `E:\.github\docs\GITEA-MIGRATION.md` §3 for this repo, with `E:\.github\docs\migration\<repo>.md` for the repo-specific steps. Work on branch `chore/gitea-migration`, one logical change per commit. Run `python3 E:\.github\tools\migration-inventory.py .` first and report what differs from the guide. Stop at §3.8 with the hand-off report.
|
||||
|
||||
3. Do the hand-off steps, then tick the repo in the runbook's tracker (§8).
|
||||
|
||||
For a repo without a guide, the same prompt works with only the runbook: §3.1 starts with the inventory tool.
|
||||
|
||||
## Suggested order
|
||||
|
||||
1. **free-steam-games-list** and **RepoLens**: their live sites read GitHub at runtime and have had no data since the suspension.
|
||||
2. **free-games-itchio-list**: the site still serves its last build, but nothing new is ingested or deployed.
|
||||
3. **poli0981-dev** with **content**, then the other web repos (deploys stopped with Workers Builds).
|
||||
4. The desktop apps, in any order. AppLedger and QuoteAtlas are pushed to Gitea first.
|
||||
|
||||
## Status
|
||||
|
||||
| Repo (local folder) | Profile | State on 2026-11-23 | Guide |
|
||||
|---|---|---|---|
|
||||
| `ticktune` | web (Astro, Workers) | **Pilot, done.** Merged 2026-11-23 (Gitea #1, #2); v2.3.1 deployed from a signed tag | [ticktune.md](ticktune.md) |
|
||||
| `pipdock` | Tauri + Rust + React | not started | [pipdock.md](pipdock.md) |
|
||||
| `frameledger` | .NET/WPF + C++, Velopack | not started | [frameledger.md](frameledger.md) |
|
||||
| `OmniDeck` | .NET/WPF, Velopack | not started | [omnideck.md](omnideck.md) |
|
||||
| `bookmarkmagic` | Chrome/Edge/Firefox extension (WXT) | not started | [bookmarkmagic.md](bookmarkmagic.md) |
|
||||
| `softharbor` | web (Astro, Workers) + data bots | **Done.** Merged 2026-11-24 (Gitea #1, #2, #3); v1.5.0 deployed by the CI `deploy` job, tagged and announced from Gitea | [softharbor.md](softharbor.md) |
|
||||
| `poli0981-dev` | web (Astro, Workers) + admin | **Done.** Merged 2026-11-24 (Gitea #1, #3); v2.4.0 deployed by the CI `deploy` job, admin publishing through Gitea | [poli0981-dev.md](poli0981-dev.md) |
|
||||
| `content` (`E:\content`) | content submodule of `poli0981-dev` | **Done** with it (2026-11-24) | [poli0981-dev.md](poli0981-dev.md#the-content-submodule-poli0981content-econtent) |
|
||||
| `tilepier` | web (SvelteKit, Workers) | not started | [tilepier.md](tilepier.md) |
|
||||
| `HashTool` (`E:\hash`) | Avalonia/.NET 10 + NativeAOT CLI, Velopack win/linux (osx dropped) | **Done.** Merged 2026-11-26 (Gitea #2); 1.3.1 released to R2 | [hashtool.md](hashtool.md) |
|
||||
| `youtube-generator` (`E:\youtube`) | web (Workers) + Tauri + Android | **Done.** Merged 2026-11-26 (Gitea #2, #3, #4); v1.7.0 released to R2, the site deployed by the CI `deploy` job | [youtube-generator.md](youtube-generator.md) |
|
||||
| `youtube-auto-post` | Python bot on a schedule | not started | [youtube-auto-post.md](youtube-auto-post.md) |
|
||||
| `jsonPrism` | web + API (Workers) + Tauri + Android | **Done.** Merged 2026-11-27 (Gitea #2); v2.3.0 released to R2, the site deployed by the CI `deploy` job | [jsonprism.md](jsonprism.md) |
|
||||
| `MarkLens` (`E:\marklens`) | Flutter desktop (Windows, Linux) | **Done.** Merged 2026-11-27 (Gitea #2, #3); v1.1.0 released to R2 with the `latest.json` update feed, the first Flutter repo; maintenance mode | [marklens.md](marklens.md) |
|
||||
| `captureimg` (`E:\capture\captureimg`) | .NET/WPF, Velopack | not started | [captureimg.md](captureimg.md) |
|
||||
| `QuoteAtlas` (`E:\qoute`) | web + Tauri + Android | **not on Gitea yet** (origin is still GitHub) | [quoteatlas.md](quoteatlas.md) |
|
||||
| `AppLedger` (`E:\appledger`) | .NET/WPF, Velopack, never released | **not on Gitea yet** (origin is still GitHub) | [appledger.md](appledger.md) |
|
||||
| `WardSweep` (`E:\wardsweep`) | Rust broker + .NET/WPF UI, Velopack | not started | [wardsweep.md](wardsweep.md) |
|
||||
| `free-steam-games-list` (`E:\2`) | Python data pipeline + SvelteKit on Workers + Tauri + Android | **Done.** Data restored 2026-11-24 (49 GitHub-only data commits pushed, the Worker reads Gitea); migration merged as Gitea #1; v4.8.0 / apps 2.6.0 released to R2 | [free-steam-games-list.md](free-steam-games-list.md) |
|
||||
| `free-games-itchio-list` (`E:\game`) | Python data pipeline + React on Workers + Tauri + Android | **Done.** Catalog restored 2026-11-24 from the live site (+235 games); migration merged as Gitea #1; v4.7.0 released to R2 | [free-games-itchio-list.md](free-games-itchio-list.md) |
|
||||
| `RepoLens` (`E:\repo`) | SvelteKit on Workers, data from the Gitea API | **Done.** Merged 2026-11-26 (Gitea #2); deployed by the CI `deploy` job, v1.6.0; repository private on Gitea | [repolens.md](repolens.md) |
|
||||
| `CommandForge` (`E:\cmd`) | .NET/WPF, Velopack | **Done.** Merged 2026-11-26 (Gitea #2, #3); v2.3.0 released to R2, the first Velopack app there | [commandforge.md](commandforge.md) |
|
||||
| any repo not listed | — | not inventoried | run the inventory |
|
||||
|
||||
## Cron slots (UTC) — the registry
|
||||
|
||||
Every scheduled workflow gets its own slot inside 13:00–16:00 UTC (runbook §3.2 item 9), so nothing piles up on the runners. Take a free slot from here and add it to this table in the same change. Long data jobs start first, on the Docker-only runner (D15).
|
||||
|
||||
| Slot (UTC) | Days | Repo · workflow | Status |
|
||||
|---|---|---|---|
|
||||
| 13:03 | daily | free-steam-games-list · data-daily | live |
|
||||
| 13:11 | daily | RepoLens · production smoke | live |
|
||||
| 13:17 | daily | softharbor · quarantine | live |
|
||||
| 13:19 | Fri | jsonPrism · security | live |
|
||||
| 13:23 | daily | pipdock · security-scan | proposed |
|
||||
| 13:27 | daily | free-games-itchio-list · update (ingest) | live |
|
||||
| 13:31 | daily | renovate-config · renovate | live |
|
||||
| 13:37 | Wed | youtube-generator · security (workflow lint + ops caller in one workflow; its 13:41 Tue slot was not needed) | live |
|
||||
| 13:43 | Mon | HashTool · security (local checks, workflow lint and the ops caller in one workflow; its 15:19 Tue slot was not needed) | live |
|
||||
| 13:47 | daily | pipdock · ci-integration (nightly) | proposed |
|
||||
| 13:49 | daily | free-games-itchio-list · refresh | live |
|
||||
| 13:53 | Thu | HashTool · qodana | live |
|
||||
| 13:59 | daily | softharbor · vt-recheck | live |
|
||||
| 14:07 | Sun | .github · weekly-digest | live |
|
||||
| 14:11 | Fri | CommandForge · security (workflow lint + ops caller in one workflow) | live |
|
||||
| 14:13 | Wed | poli0981-dev · security | live |
|
||||
| 14:17 | Mon | captureimg · docs (external links) | proposed |
|
||||
| 14:19 | Thu | pipdock · security (ops caller, D4) | proposed |
|
||||
| 14:23 | Sat | OmniDeck · security | proposed |
|
||||
| 14:27 | Mon | WardSweep · dependency audit | proposed |
|
||||
| 14:29 | daily | tilepier · e2e | proposed |
|
||||
| 14:31 | Thu | AppLedger · security | proposed |
|
||||
| 14:33 | Tue | RepoLens · security | live |
|
||||
| 14:37 | Mon | ticktune · audit | live |
|
||||
| 14:41 | Fri | frameledger · security | proposed |
|
||||
| 14:43 | Mon | softharbor · link-check | live |
|
||||
| 14:47 | daily | youtube-auto-post · notify (YA1) | proposed |
|
||||
| 14:53 | Tue | pipdock · ci-integration (weekly fixtures) | proposed |
|
||||
| 14:59 | Sun | bookmarkmagic · security | proposed |
|
||||
| 15:01 | Wed | free-games-itchio-list · security | live |
|
||||
| 15:03 | Thu | WardSweep · security (local, WS1) | proposed |
|
||||
| 15:07 | Thu | tilepier · security | proposed |
|
||||
| 15:11 | Sat | captureimg · security | proposed |
|
||||
| 15:13 | Mon | ticktune · qodana | live |
|
||||
| 15:23 | Fri | MarkLens · security (workflow lint + ops caller in one workflow) | live |
|
||||
| 15:29 | Wed | ticktune · security | live |
|
||||
| 15:33 | Sun | QuoteAtlas · security | proposed |
|
||||
| 15:37 | Tue | softharbor · security | live |
|
||||
| 15:41 | Mon | bookmarkmagic · qodana | proposed |
|
||||
| 15:47 | Thu | youtube-auto-post · security | proposed |
|
||||
| 15:49 | Tue | free-steam-games-list · security | live |
|
||||
| 15:53 | Mon | youtube-generator · rust | live |
|
||||
|
||||
## Decisions that cover several repos
|
||||
|
||||
D1 is the maintainer's. D2–D16 were decided by the agent on the maintainer's instruction (2026-11-23). Any of them can still be reversed before a repo's session; the guides then change in the same commit. Each guide has a **Decided** section for its own questions.
|
||||
|
||||
| # | Question | Decided |
|
||||
|---|---|---|
|
||||
| D1 | SonarQube Cloud | **Removed everywhere** (maintainer): Sonar jobs and workflows, `sonar-project.properties`, `dotnet-sonarscanner` in `.config/dotnet-tools.json`, the Sonar text in CLAUDE.md and the docs, the `SONAR_TOKEN` secret. Qodana and Opengrep cover the analysis |
|
||||
| D2 | Maintenance-mode triage (`triage.yml` / `maintenance-triage.yml`): outsiders cannot open issues or PRs on Gitea, and GitLab mirror issues are not seen by Gitea Actions | **Removed** with its script. The policy text stays in CONTRIBUTING; the maintainer closes out-of-scope items by hand on GitLab (the pilot did this) |
|
||||
| D3 | Web deploys: Cloudflare Workers Builds pulled from GitHub and stopped | **`wrangler deploy` from Gitea CI** (a deploy job on `main`, or the pilot's tag-only `deploy.yml` where a repo already deploys from tags), with `CLOUDFLARE_API_TOKEN`/`CLOUDFLARE_ACCOUNT_ID`. Workers Builds on the GitLab mirror is not used: it would deploy a second time on every mirror push. The maintainer disconnects each project's GitHub integration in the dashboard |
|
||||
| D4 | Repos whose workflows are project-local on purpose (pipdock, AppLedger, WardSweep) | **Call the ops repo for security**, and for notifications where the repo has none of its own, pinned by SHA; the rest stays local. Exception: WardSweep (WS1 in its guide), whose distribution-trust document requires every step to be readable in the repo |
|
||||
| D5 | Bot pull requests (softharbor quarantine / vt-recheck / link-check, poli0981-dev content-bump): a PR opened with the job token starts no workflow | **Dispatch CI on the bot branch** (`POST …/actions/workflows/<file>/dispatches` with the job token and `actions: write`: Gitea starts a dispatched run whoever asks; read from the source, **VERIFY** on 28.4.0) |
|
||||
| D6 | Required checks and rulesets were GitHub's | **Gitea branch protection on `main`**: the CI checks the ruleset required, no force push, no deletion. A maintainer step in every hand-off; `.github/rulesets/*` goes |
|
||||
| D7 | GitHub-only extras: build-provenance attestations (no OIDC), OpenSSF Scorecard, dependency review, dependency submission / SBOM export, the GitHub Wiki | **Dropped.** osv-scanner, cargo-deny and NuGetAudit cover vulnerabilities; a repo that needs a licence gate runs it locally (`nuget-license`, as HashTool). An SBOM, where a repo shipped one, is generated in the build (CycloneDX) and uploaded next to the release on R2. Release notes stop telling users to run `gh attestation verify` |
|
||||
| D8 | In-app update checks that asked `api.github.com/…/releases/latest` (MarkLens, QuoteAtlas, the free-steam-games-list Android app). Velopack apps are covered by runbook §5.1 | **A `latest.json`** (version + download URLs) at `releases.poli0981.dev/<app>/…/latest.json`, uploaded last by `publish-r2.yml` (a `*.json` name, so the edge does not cache it). Not the Gitea API: apps stay off the forge. The app's privacy text and CSP name the new host |
|
||||
| D9 | macOS builds: there is no macOS runner (HashTool's `osx`/`osx-x64`; the DMGs of youtube-generator, jsonPrism, QuoteAtlas, the two catalog apps) | **Dropped from CI**; README and the release docs say so. Existing macOS installs keep the GitHub feed they have, which cannot be redirected |
|
||||
| D10 | Android APKs: Gitea's `docker.gitea.com/runner-images` most likely ship no Android SDK (**VERIFY**) | **Installed in the job** on `ubuntu-latest`: pinned command-line tools, `sdkmanager` with the repo's platform and NDK versions, cached. Never installed system-wide on the PC |
|
||||
| D11 | GitHub Pages notice/redirect sites and Discussions (youtube-generator, jsonPrism, captureimg, the two catalog repos) | **Deleted** with the files that only serve them. The `poli0981.github.io/…` sites died with the account; Discord gets the announcements |
|
||||
| D12 | Code that **writes** to a repo at runtime through a GitHub App or token (poli0981-dev admin, free-steam-games-list and free-games-itchio-list Workers) | **The Gitea API with a token of the bot user `poli0981-bot`**, a collaborator with write access on exactly the repos it writes (`poli0981-dev`, `content`, `free-steam-games-list`, `free-games-itchio-list`), token scope `write:repository`, stored as a Worker secret. Several files in one commit: `POST /repos/{owner}/{repo}/contents` with each file's current `sha`, which is the optimistic lock that replaces `createCommitOnBranch`'s `expectedHeadOid` (**VERIFY** that a stale `sha` is refused with 409/422; the Workers' retry loops depend on it). A push by this user is a real user's push, so it starts workflows (ingest jobs) as the GitHub App's did. Commits are unsigned unless Gitea's server-side signing is set up; nothing requires it |
|
||||
| D13 | Code that **reads** repo data at runtime (raw files, commits, releases, activity) | **Gitea without a token**: raw files at `https://git.poli0981.dev/poli0981/<repo>/raw/branch/main/<path>` (or `GET /repos/{owner}/{repo}/raw/{path}?ref=main`), and the REST API for the rest. The repos are public; the Workers keep their caches, so each new file version is fetched once per data centre |
|
||||
| D14 | Public bug-report endpoints that opened GitHub issues (poli0981-dev, RepoLens) | **Issues on the GitLab mirror** through `POST /api/v4/projects/:id/issues`. The token is a project access token if the GitLab.com plan allows one, else a personal access token of a GitLab bot account with the Reporter role (scope `api`). Either expires within a year: note the date in the hand-off. When the call fails, the endpoint tells the reader to e-mail `code@` instead |
|
||||
| D15 | Runner time: the two catalog pipelines need about four runner-hours a day, more than one job slot holds inside 13:00–16:00 next to the other repos' schedules | **A second runner registration on the PC with Docker labels only** (`ubuntu-latest`, `ubuntu-24.04`, `ubuntu-22.04`), capacity 1. Host-mode (`windows-latest`) jobs stay one at a time on the first runner; a long data job no longer blocks a Windows build. The data pipelines also run once a day with smaller time budgets (their guides). If the PC is off, the day's runs wait and catch up when it comes back (runbook §7 item 4) |
|
||||
| D16 | Sites that bundle their data at build time (free-games-itchio-list): a data commit pushed with the job token starts no workflow, so no deploy | **The data workflow dispatches `deploy.yml`** after a successful commit (job token, `actions: write`). `deploy.yml` keeps `push` for code changes |
|
||||
|
||||
## Maintainer steps, once for all repos
|
||||
|
||||
1. Add your GPG public key to the Gitea account, so `https://git.poli0981.dev/poli0981.gpg` serves it (the pilot's tag check, OmniDeck's OD3).
|
||||
2. Create the user `poli0981-bot` on Gitea (registration is off: Site Administration), add it as a Write collaborator on the four repos of D12, and create its token (`write:repository`). The token goes into each Worker as a secret during that repo's hand-off.
|
||||
3. Register the second runner on the PC with Docker labels only (D15).
|
||||
4. The GitLab issue token of D14, with its expiry date written down.
|
||||
5. In the Cloudflare dashboard, disconnect Workers Builds' GitHub integration of every project the migrated repos deploy (D3).
|
||||
6. The announcement (runbook §7 item 5): one post on poli0981.dev and the Discord announcement.
|
||||
|
||||
## `gh` CLI → Gitea API
|
||||
|
||||
`gh` only talks to github.com. On Gitea, call the REST API with the job token (`${{ github.token }}`, `Authorization: token …`) at `${{ github.api_url }}` (= `https://git.poli0981.dev/api/v1`). The routes below were checked against the Gitea source on 2026-11-23.
|
||||
|
||||
| `gh` | Gitea API |
|
||||
|---|---|
|
||||
| `gh issue create` | `POST /repos/{owner}/{repo}/issues` `{title, body, labels:[<label ids>]}` |
|
||||
| `gh issue edit --body-file` / `gh issue close` | `PATCH /repos/{owner}/{repo}/issues/{n}` `{body}` / `{state:"closed"}` |
|
||||
| `gh issue comment` / `gh pr comment` | `POST /repos/{owner}/{repo}/issues/{n}/comments` `{body}` |
|
||||
| find an open issue by title | `GET /repos/{owner}/{repo}/issues?state=open&type=issues&q=<words>` |
|
||||
| `gh pr create` | `POST /repos/{owner}/{repo}/pulls` `{base, head, title, body}` |
|
||||
| `gh pr merge --auto --squash` | `POST /repos/{owner}/{repo}/pulls/{n}/merge` `{do:"squash", merge_when_checks_succeed:true}` |
|
||||
| `gh workflow run <file> --ref <b>` | `POST /repos/{owner}/{repo}/actions/workflows/<file>/dispatches` `{ref}` (job token with `actions: write`) |
|
||||
| `gh run list` (is a workflow running or waiting?) | `GET /repos/{owner}/{repo}/actions/runs?status=…` (**VERIFY** the route and its filters on 28.4.0) |
|
||||
| `gh api …/pulls/{n}/files` | `GET /repos/{owner}/{repo}/pulls/{n}/files` |
|
||||
| `gh api …/git/tags/{sha}` (`verification`) | `GET /repos/{owner}/{repo}/git/tags/{sha}` (has `verification`; needs the GPG key on the account) |
|
||||
| `gh release create/edit/upload` | `https://gitea.com/actions/gitea-release-action` (notes + links, no binaries: runbook §1), or `POST /repos/{owner}/{repo}/releases` |
|
||||
| `gh release download` (old assets) | nothing to download from: put what a workflow still needs on R2 under a versioned name |
|
||||
| GraphQL `createCommitOnBranch` | `POST /repos/{owner}/{repo}/contents` `{branch, message, files:[{operation, path, content (base64), sha}]}` (D12) |
|
||||
| `raw.githubusercontent.com/<owner>/<repo>/main/<path>` | `https://git.poli0981.dev/<owner>/<repo>/raw/branch/main/<path>` (D13) |
|
||||
|
||||
Events caused by the job token start no workflow (Gitea skips the Actions user, as GitHub skips `GITHUB_TOKEN`): a release published by CI does not fire `release: published`, a PR opened by CI runs no checks (D5), and a data commit deploys nothing (D16).
|
||||
|
||||
## Shared replacements and rules
|
||||
|
||||
- **CodeQL** (local, or a caller of `reusable-codeql.yml@main`, which the ops repo no longer has) → a caller of the ops `security.yml` (gitleaks, Opengrep, osv-scanner, cargo-deny, NuGetAudit).
|
||||
- **`JetBrains/qodana-action`** → a caller of the ops `reusable-qodana.yml` (Qodana CLI, native mode, report as an artifact). The SARIF upload to GitHub code scanning goes. A linter without a native mode (`qodana-rust`), or one that needs a plugin native mode cannot install, runs with `runs-on: windows-latest` and `within-docker: true` (Docker Desktop on the PC, **VERIFY**); if that fails, the project leaves Qodana.
|
||||
- **`actions/upload-artifact` / `download-artifact`** → `christopherhx/gitea-upload-artifact` / `gitea-download-artifact` at the SHAs the ops repo pins.
|
||||
- **Discord notifications** → callers of the ops `notify-*` / `announce-release` workflows, with `ops_ref` set to the same SHA as `uses:` and the secrets passed by name. Delete vendored copies of `discord_notify.py` (they call `api.github.com`).
|
||||
- **Unpinned actions** (`@v7`) → pin the 40-char SHA with a version comment (runbook rule 6).
|
||||
- **A repo's own actionlint / zizmor jobs:** both only find `.github/workflows` by themselves, so pass the `.gitea/workflows` files explicitly (as the ops `ops-lint.yml` does; **VERIFY** zizmor's discovery). Run `zizmorcore/zizmor-action` with `online-audits: false` (its online audits query GitHub with the job token) and `advanced-security: false` (no code-scanning upload).
|
||||
- **`concurrency` with `queue: max`** (the catalog pipelines): GitHub added `queue` in 2026. **VERIFY** what Gitea 28.4.0 does with it before a pipeline relies on runs waiting in turn; a scheduled pipeline is one workflow for that reason (its guide).
|
||||
- **Host mode is the maintainer's PC** (`windows-latest`, runbook §1). A job that starts an app points the app's data folder at the job's temp dir (HashTool: `HASHTOOL_DATA_DIR`), never runs an installer (`Setup.exe`, `.msi`, `.pkg`), never runs tests that need elevation or change the machine (AppLedger's `Category=Admin`, WardSweep's ignored machine test), and installs SDKs into the runner tool cache, never system-wide.
|
||||
@@ -0,0 +1,39 @@
|
||||
# AppLedger — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `7d40c38` (local clone `E:\appledger`). Profile: .NET 10 WPF app + elevated Agent, Velopack, **never released** (runbook §5.1). Four self-contained workflows by design (docs/18_CI_CD.md). Shared decisions: [README](README.md).
|
||||
|
||||
**This repo is not on Gitea yet.** `origin` is still `https://github.com/poli0981/appledger.git` and there is no `github` remote. The working tree is clean.
|
||||
|
||||
## Before the migration session
|
||||
|
||||
1. `.\push-to-gitea.ps1 -Root E:\appledger -DryRun`, then without `-DryRun`: it renames `origin` → `github`, creates `poli0981/appledger` on Gitea with Actions off and pushes every branch and tag.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **AL1 — feeds:** nothing has shipped, so every network call in `docs/12_PRIVACY_AND_RETENTION.md` §Network calls moves to R2 before the first release, with no bridge:
|
||||
- update check: Velopack HTTP source `https://releases.poli0981.dev/appledger` (`vpk upload s3`, `VPK_PREFIX=appledger/`);
|
||||
- catalog rules: `appledger/appledger-catalog-latest.json` and `appledger-catalog-latest.json.minisig`. Both names contain `-latest.`, so the edge never serves a stale file or a signature that no longer matches (runbook §1, release caching);
|
||||
- the GeoIP download: the same `-latest.` naming under `appledger/`.
|
||||
`legal/PRIVACY_POLICY.md` (three rows) and docs/12, 13 and 16 name `releases.poli0981.dev`; nobody has accepted the old text yet.
|
||||
- **D4:** security comes from the ops repo (CodeQL's replacement); `notify.yml` stays local (it works on Gitea as it is: publishing the draft release by hand fires `release: published`). Build, test and release stay in this repo, as docs/18 wants.
|
||||
- **Host mode:** CI keeps `Category!=Admin`. On `windows-latest` an Admin test would run elevated on your PC and could register the Agent's scheduled task. No CI job installs, starts or registers the Agent.
|
||||
- D6: branch protection on `main` requires the CI checks.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | build/test on `windows-latest`, `sonar` job (MSBuild scanner), upstream `upload-artifact` | Move; Gitea artifact action; remove the `sonar` job (D1) and its notes in docs/18 |
|
||||
| `codeql.yml` | CodeQL C# on `windows-latest`, cron `23 4 * * 1` | **Delete** → ops `security.yml` caller: `dotnet: true`, `dotnet-runs-on: windows-latest`, `dotnet-solution: AppLedger.slnx` (**VERIFY** the reusable restores a `.slnx`), cron **`31 14 * * 4`** |
|
||||
| `notify.yml` | `release: published` → Discord (`DISCORD_WEBHOOK`), skips without the secret | Move unchanged; pin its actions by SHA |
|
||||
| `release.yml` | `v*` tags, Velopack, GitHub release, never run yet | Velopack to R2 (AL1), catalog + `.minisig` and the GeoIP file to R2 with `publish-r2.yml`, a **draft** Gitea release with links (`gitea-release-action`). The minisign key is a secret of this job only (rule 10). Its first run is still the dry run on a pre-release tag that the file asks for |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json` (Central Package Management: Renovate reads `Directory.Packages.props`; WPF-UI stays on its verified pin, so add a `packageRules` entry that holds it).
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md`, `CONTRIBUTING.md`, `SECURITY.md` (GitHub advisories → `security@poli0981.dev`), `.github/ISSUE_TEMPLATE/config.yml`, `Directory.Build.props`, `legal/PRIVACY_POLICY.md` and `legal/DISCLAIMER.md`, docs/12, 13, 16 and 18, and `src/AppLedger.App/ViewModels/OnboardingViewModel.cs` (it opens the privacy policy on GitHub: point it at Gitea). Issue templates → GitLab (runbook §3.4). The `github.io` hits in `PublicSuffixTests.cs` are test data: leave them.
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `DISCORD_WEBHOOK`. Create (user level): R2 keys + `R2_ACCOUNT_ID`; the minisign secret key for catalog signing (repo level, release job only). Drop `SONAR_TOKEN`.
|
||||
@@ -0,0 +1,30 @@
|
||||
# bookmarkmagic — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `acad57a`. Profile: browser extension (WXT + Svelte 5) for Chrome, Edge and Firefox, store submissions from CI (runbook §5.4). Its docs/12 describes the CI. Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- D2: the triage workflow goes. D6: branch protection requires "Quality gates" and "Build + package / build".
|
||||
- **BM1 — where users download the zip:** R2 under `releases.poli0981.dev/bookmarkmagic/<version>/` plus a Gitea release with links; the stores stay the main channel.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | caller of `poli0981/.github/.github/workflows/reusable-chrome-extension.yml@main` + local `quality` job; `actions/checkout@v7`, `setup-node@v7` unpinned | Caller → `poli0981/.github/.gitea/workflows/reusable-chrome-extension.yml@<ops-sha> # ops v2026.11.N`; pin the local job's actions |
|
||||
| `codeql.yml` | caller of `reusable-codeql.yml@main` (that path is gone: the ops repo's workflows now live in `.gitea/workflows`), cron `0 14 * * 1` | **Delete** → `security.yml` caller (`node: true`), cron **`59 14 * * 0`** |
|
||||
| `notify-ci-failure.yml` | caller of `notify-ci-failure.yml@main`, gated by variable `DISCORD_CI_NOTIFY` | Path `.gitea/workflows/…@<ops-sha>`, `with: { default_branch: main, ops_ref: <ops-sha> }`; keep the gate (the reusable requires the webhook secret) |
|
||||
| `qodana.yml` | `qodana-action` + SARIF to code scanning (`GITHUB_TOKEN`), cron `0 15 * * 1` | Caller of `reusable-qodana.yml`: `package-manager` as the repo uses, `prepare-command` for WXT's generated types (e.g. `npx wxt prepare`), cron **`41 15 * * 1`**. The SARIF upload goes |
|
||||
| `release.yml` | build + gates + zip + `SHA256SUMS.txt`; `gh release create/upload` with `secrets.GITHUB_TOKEN`; store jobs (CWS, Edge, AMO) re-download `SHA256SUMS.txt` from the GitHub release; announce via `announce-release.yml@main` | Keep the job split and the store jobs. Hand the zip and `SHA256SUMS.txt` to the store jobs as a Gitea artifact instead of `gh release download`. Publish them to R2 with `publish-r2.yml` (`app: bookmarkmagic`, versioned dir `<version>/`, no feed) and make the Gitea release with `gitea-release-action` (links only). Announce: caller path + SHA, map `RELEASES_WEBHOOK`/`REPO_WEBHOOK` to the reusable's `DISCORD_RELEASES_WEBHOOK`/`DISCORD_REPO_WEBHOOK`. Store and R2 secrets stay in tag-push jobs only (rule 10) |
|
||||
| `sonarcloud.yml` | SonarCloud, upstream artifact actions | **Delete** (D1) |
|
||||
| `triage.yml` | `issues` + `pull_request_target`, `gh` + `scripts/triage.mjs` | **Delete** with the script and its tests (D2) |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`. `.github/FUNDING.yml` is GitHub-only: keep it inert or remove it with its README mention.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md` (12), `package.json` (3: `repository`, `bugs`, `homepage`), `.github/ISSUE_TEMPLATE/` (`feature_request.yml` 3, `config.yml` 2, `accessibility.yml`, `bug_report.yml`), `ACCESSIBILITY.md` (2), `CONTRIBUTING.md` (2), and the **store listings** `store/listing.{en,ja,ro,vi,zh_CN}.md` (support/source links: issues → GitLab, source → Gitea, kept in parity across the five languages; they ship with the next store update). The manifest's `homepage_url` (WXT config). `CHANGELOG.md` keeps its history. `SECURITY.md`: GitHub advisories → `security@poli0981.dev` (already documented). Add GitLab issue/MR templates (runbook §3.4).
|
||||
|
||||
## Secrets and variables
|
||||
|
||||
Keep (repo): `CHROME_EXTENSION_ID`, `CHROME_PUBLISHER_ID`, `CHROME_SERVICE_ACCOUNT_CLIENT_EMAIL`, `CHROME_SERVICE_ACCOUNT_PRIVATE_KEY`, `EDGE_API_KEY`, `EDGE_CLIENT_ID`, `EDGE_PRODUCT_ID`, `FIREFOX_EXTENSION_ID`, `FIREFOX_JWT_ISSUER`, `FIREFOX_JWT_SECRET`, `QODANA_TOKEN`, `DISCORD_CI_WEBHOOK`, `RELEASES_WEBHOOK`, `REPO_WEBHOOK`. Variables to recreate on Gitea: `AMO_AUTOPUBLISH`, `CWS_AUTOPUBLISH`, `EDGE_AUTOPUBLISH`, `DISCORD_ANNOUNCE`, `DISCORD_CI_NOTIFY`. Create (user level): R2 keys + `R2_ACCOUNT_ID`. Drop: `SONAR_TOKEN`, the explicit `GITHUB_TOKEN` use.
|
||||
@@ -0,0 +1,35 @@
|
||||
# captureimg — migration guide
|
||||
|
||||
> Written 2026-11-23 against `docs/a11y-test-record` @ `5e654bb`, one docs commit ahead of `main` @ `b2f8982` with the same workflows (local clone `E:\capture\captureimg`, Gitea `poli0981/captureimg`). Profile: CaptureImage, .NET 10 WPF (`net10.0-windows10.0.22621.0`) + `net10.0` libraries, Velopack (`--delta None`, channel `win`) (runbook §5.1). Shared decisions: [README](README.md).
|
||||
|
||||
Start the session from `main` (merge or park the docs branch first).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- D6: branch protection on `main`. D7: the release notes lose the `gh attestation verify` section.
|
||||
- **CI1 — PR title lint:** a few lines of shell over `github.event.pull_request.title` (the Conventional Commits pattern, no token, no API) replace `amannn/action-semantic-pull-request`.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | build/test on `windows-latest`, `sonarcloud` job, upstream `upload-artifact` | Move; Gitea artifact action; remove the Sonar job and `dotnet-sonarscanner` from `.config/dotnet-tools.json` (D1). Host mode: any test that starts the app must use a scratch data dir, never your real settings |
|
||||
| `release.yml` | tag/dispatch: `vpk pack` (`--delta None`), GitHub release with a body that lists the assets and `gh attestation verify`, attestations, upstream artifact actions | Velopack to R2 with `VPK_PREFIX=captureimg/` (runbook §5.1). Keep the `vpk download s3` step before `vpk pack` even with `--delta None`: it is how the new feed keeps the earlier releases (**VERIFY** on the first release). Gitea release with the same notes, without the attestation section (D7), links to `releases.poli0981.dev/captureimg/…`; Gitea artifact actions |
|
||||
| `docs.yml` | markdownlint + lychee on PRs/pushes, external links weekly `17 3 * * 1` | Move; cron → **`17 14 * * 1`** |
|
||||
| `workflow-lint.yml` | actionlint + zizmor | Move; pass both the `.gitea/workflows` files; zizmor with `online-audits: false` and `advanced-security: false` (README, shared rules) |
|
||||
| `pr-lint.yml` | semantic PR title (GitHub-API action), `GITHUB_TOKEN` | CI1 |
|
||||
| `announce-release.yml`, `notify-ci-failure.yml`, `notify-release-pipeline.yml` | ops callers at `e973e2f` (old `.github/workflows` path) | `poli0981/.github/.gitea/workflows/<x>.yml@<ops-sha>` + `ops_ref` |
|
||||
| `dependency-review.yml` | GitHub dependency review | **Delete** (D7) |
|
||||
| `scorecard.yml` | OpenSSF Scorecard, cron `41 4 * * 2` | **Delete** (D7) |
|
||||
| `discussion-welcome.yml` | greets new GitHub Discussions (`github-script`) | **Delete** (D11) |
|
||||
|
||||
Add a caller of the ops `security.yml` (`dotnet: true`, `dotnet-runs-on: windows-latest`, `dotnet-solution: CaptureImage.sln`, cron **`11 15 * * 6`**). `.github/dependabot.yml` → delete; add `renovate.json`. `.github/CODEOWNERS` → `.gitea/CODEOWNERS`. `.github/FUNDING.yml` is GitHub-only.
|
||||
|
||||
## Code and links
|
||||
|
||||
- `src/CaptureImage.Infrastructure/Update/VelopackUpdateService.cs`: `GithubSource` → HTTP source `https://releases.poli0981.dev/captureimg`. `UpdateViewModel.cs` and `AboutViewModel.cs` link to GitHub; `AboutPage.xaml` (2); `ShellAndAboutTests.cs` pins one.
|
||||
- `Directory.Build.props` (2), `README.md` (9), `SUPPORT.md` (5), `ACCESSIBILITY.md` (3), `.github/ISSUE_TEMPLATE/` (`config.yml` 2, `accessibility.yml`, `feature_request.yml`), `docs/dev_env.md` + `docs/i18n/vi/dev_env.md`, `docs/legal/PRIVACY.md`, CLAUDE.md. `CHANGELOG.md` keeps its history. `SECURITY.md`: GitHub advisories → `security@poli0981.dev` (already documented).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `DISCORD_*` for the ops callers. Create (user level): R2 keys + `R2_ACCOUNT_ID`. Drop `SONAR_TOKEN` and the explicit `GITHUB_TOKEN`.
|
||||
@@ -0,0 +1,85 @@
|
||||
# CommandForge — migration guide
|
||||
|
||||
> Written 2026-11-26 against `main` @ `ea60d58` (local clone `E:\cmd`, Gitea `poli0981/CommandForge`). Profile: .NET 10 WPF (`net10.0-windows`, `.slnx`), Velopack (channel `win`, ReadyToRun publish with an elevated helper next to the app), releases from GPG-signed annotated tags (runbook §5.1). Maintenance mode. It had no guide before its session: the inventory ran in it. Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-26**, the first Velopack app released to R2. The migration merged as Gitea #2 (`f59bc54`, 12
|
||||
commits, with the release commit), tagged and released as **v2.3.0**: Velopack feed and packages on
|
||||
`releases.poli0981.dev/commandforge/`, `2.3.0/SHA256SUMS` and a CycloneDX SBOM next to them, a Gitea release with the
|
||||
notes and links, announced through the ops `announce-release.yml` (pinned at ops v2026.11.4, `c133a00`). #3 corrected
|
||||
two docs details the release showed; #4 moved the ops pins to v2026.11.5, whose notifier names CommandForge a Velopack
|
||||
app. Renovate's onboarding PR #1 was closed: #2 adds `renovate.json`. What the move found:
|
||||
|
||||
- **`vpk … s3` works against R2 as the runbook guessed** (vpk 1.2.161): `VPK_BUCKET`, `VPK_PREFIX=commandforge/`,
|
||||
`VPK_ENDPOINT=https://<account>.r2.cloudflarestorage.com` and the keys, no region, default checksums. vpk reads every
|
||||
option from `VPK_<OPTION>` (checked locally against a dead endpoint first). `vpk download s3` on the empty folder
|
||||
logged "Found 0 release(s) in remote file … No full / applicable release was found" and exited 0, so a dispatched
|
||||
**dry run** (build, pack, SBOM, checksums, the download; no upload) checks the R2 credentials before the first tag.
|
||||
`vpk upload s3` sent the full package, Portable.zip and Setup.exe, then `releases.win.json` and `RELEASES`
|
||||
(`no-cache`), in 8 s. It does **not** publish `assets.win.json`, which `vpk pack` writes locally. The public names
|
||||
carry the channel: `CommandForge-win-Setup.exe`, `CommandForge-win-Portable.zip`. The workflow keeps one retry with
|
||||
`--disableChecksumValidation` in case R2 ever refuses the SDK's checksums; it was not needed.
|
||||
- **Release layout**: a local `release.yml`, not `reusable-desktop-csharp.yml`, because `scripts/pack.ps1` publishes
|
||||
ReadyToRun and checks that the elevated helper is in the publish folder. `scripts/release-assets.ps1` (runs locally
|
||||
too) writes the CycloneDX SBOM (`cyclonedx` 6.3.2 as a local tool, `.slnx` supported, test projects left out,
|
||||
build-only packages kept with scope `excluded`), `SHA256SUMS` and the notes from CHANGELOG.md. `SHA256SUMS` lists
|
||||
only what the version ships (Setup, Portable, its packages, the SBOM), not the feed files that vpk rewrites on every
|
||||
upload: that was the bug of the GitHub-era `checksums.txt`. The ops `publish-r2.yml` puts `<version>/` up after
|
||||
vpk; then `gitea-release-action`, then the announcer. The tag must equal `<Version>` in `Directory.Build.props`.
|
||||
- **Downloaded and compared after the release**: Setup.exe, Portable.zip, the full package and the SBOM all match
|
||||
`SHA256SUMS`, and the feed's SHA-256 of the full package matches too. Every public file answers 200 with
|
||||
`cf-cache-status: DYNAMIC`, the versioned ones included (the edge does not cache this folder today).
|
||||
- **VirusTotal**: the optional step found `VT_API_KEY` although the repository has no such secret, so it is a
|
||||
user-level secret; the scan and its links in the notes worked.
|
||||
- **Report a bug** opens `gitlab.com/poli0981/CommandForge/-/issues/new?issue[title]=…&issue[description]=…` with the
|
||||
Bug template's sections answered (no `issuable_template`: a template would replace the description). GitLab
|
||||
redirects `issues/new` to `work_items/new` and keeps both fields (checked signed in, nothing submitted). A test keeps
|
||||
the app's sections equal to `.gitlab/issue_templates/Bug.md`, another fails if any source file links to
|
||||
`github.com/poli0981`. The legal texts the app links (EULA, LICENSE, DISCLAIMER, PRIVACY) open on Gitea's
|
||||
`/src/branch/main/…`; the terms version stays the same (as FG5: same request, another host).
|
||||
- **Installs of 2.2.0 and older** asked GitHub (`GithubSource`) and see 404 ("No release feed was found"): they need
|
||||
2.3.0 once by hand. The notes, README, UPDATES and CHANGELOG say so (runbook §7 item 5).
|
||||
- **CI on the single runner** (`anon-win`, all labels, one job at a time): the PR's 11 checks took ~17 min, the
|
||||
release ~4 min. Qodana's CLI in native mode on Windows reported zero problems, as the action did; gitleaks found
|
||||
nothing over the full history; osv-scanner has no lockfile to read (the repo has no `packages.lock.json`; the
|
||||
NuGetAudit restore covers NuGet). Until #2 merged, Gitea listed the GitHub-era `.github/workflows` of `main`.
|
||||
- **Branch protection on `main`** (D6): no push, no force push, status checks `Build / build (*)` and
|
||||
`Build / package (*)` (Gitea lists both `(pull_request)` and `(push)` contexts). Merge commits made in the UI are
|
||||
unsigned ("no key available to sign"), so signed commits are not required.
|
||||
- **Logs and runs without a token**: `GET /repos/{owner}/{repo}/actions/runs/{id}/jobs` and
|
||||
`/commits/{sha}/status` answer; `GET …/actions/runs` and the API's job-log route answer 401. From the signed-in
|
||||
browser, `/{owner}/{repo}/actions/runs/{run}/jobs/{job id}/logs` returns the raw log.
|
||||
- **On the PC**: Git for Windows' ssh was refused by Gitea (`Permission denied (publickey)`) while the Windows
|
||||
OpenSSH agent holds the key: push with `GIT_SSH_COMMAND=C:/Windows/System32/OpenSSH/ssh.exe`. GPG signing failed
|
||||
with "sending fd … to keyboxd: Input/output error" until `gpgconf --kill keyboxd`.
|
||||
|
||||
## Decided (2026-11-26)
|
||||
|
||||
- D1 (SonarCloud and `dotnet-sonarscanner` removed; SonarAnalyzer stays as a Roslyn analyzer), D2 (no triage
|
||||
workflow existed), D6, D7 (attestations, Scorecard, dependency review, the GitHub SBOM go; a CycloneDX SBOM is
|
||||
generated in the build and uploaded under `<version>/`), D11 (Discussions links removed).
|
||||
- **CF1 — release workflow local**, as above; manual runs on a branch are dry runs.
|
||||
- **CF2 — VirusTotal stays optional**, skipped without `VT_API_KEY`.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Before | Now |
|
||||
|---|---|---|
|
||||
| `build.yml` | build/test/format + package smoke on `windows-latest`, `actions/cache`, upstream `upload-artifact` | Moved; tool-cache SDK, the PC's NuGet cache (no `actions/cache`), Gitea artifact action |
|
||||
| `codeql.yml` | CodeQL C# + actions, cron `37 14 * * 1` | **Deleted** → `security.yml`: actionlint + shellcheck job and the ops `security.yml` (`dotnet: true`, `dotnet-runs-on: windows-latest`, `dotnet-solution: CommandForge.slnx`), cron **`11 14 * * 5`** |
|
||||
| `sonarcloud.yml`, `scorecard.yml` (cron `25 6 * * 1`), `dependency-review.yml` | | **Deleted** (D1, D7) |
|
||||
| `qodana.yml` | `qodana-action`, token check job | Caller of `reusable-qodana.yml` (`windows-latest`, `dotnet-global-json-file`, `prepare-command: dotnet build …`) |
|
||||
| `release.yml` | `vpk download/upload github`, attestations, `gh` SBOM/checksums/notes, VirusTotal | CF1 |
|
||||
| `announce-release.yml`, `notify-ci-failure.yml` | ops callers `@c3e118a` (old path), `secrets: inherit` | ops v2026.11.4 + `ops_ref`, secrets by name; new `notify-release-pipeline.yml` |
|
||||
|
||||
`.github/dependabot.yml` → deleted; `renovate.json` (majors need Dashboard approval, no `Microsoft.Extensions.**` /
|
||||
`dotnet-sdk` majors, Velopack + vpk together). `.gitlab/issue_templates` (Bug, Feature request, Command, Translation,
|
||||
Accessibility) and the MR template added; `.github/ISSUE_TEMPLATE` kept for Gitea.
|
||||
|
||||
## Secrets
|
||||
|
||||
Repository: `DISCORD_CI_WEBHOOK`, `DISCORD_RELEASES_WEBHOOK`, `DISCORD_RELEASE_PIPELINE_WEBHOOK`, `QODANA_TOKEN`.
|
||||
User level: R2 keys + `R2_ACCOUNT_ID`, `VT_API_KEY`. Dropped: `SONAR_TOKEN`.
|
||||
|
||||
## Hand-off extras
|
||||
|
||||
Qodana Cloud: set the project's VCS URL to `https://git.poli0981.dev/poli0981/CommandForge.git` (maintainer).
|
||||
@@ -0,0 +1,38 @@
|
||||
# frameledger — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `7a77b73`. Profile: .NET (WPF, SDK pinned by `global.json`, .NET 11 band) + native C++ (MSVC, CMake, Vulkan SDK), Velopack (runbook §5.1). CI is repo-local by design: it runs `./build.ps1 check`, the same script as a local build (docs/12_BUILD.md, docs/13_CI_CD.md). Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **FL1 — SAST for the C++ layer:** accepted as it is. Qodana native reads the C++ solution through `qodana-native.yaml`, Opengrep covers C# and the workflows. No new analyser.
|
||||
- **FL2 — the wiki:** `wiki.yml` goes. The pages stay in `wiki/` and `guide/`, and README links them; a port would hang on the job token pushing to `<repo>.wiki.git`, which nobody has verified.
|
||||
- D6: branch protection on `main` requires the CI checks (hand-off).
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | `windows-latest`, `./build.ps1 check`; Sonar (`SONAR_TOKEN`); `gh api repos/…/pulls/$PR_NUMBER/files` for the changed files; upstream artifact actions; 9 unpinned `@vN` | Move. Pin every action (runbook rule 6). Gitea artifact actions. Replace `gh api …/pulls/{n}/files` with `curl` to `${{ github.api_url }}/repos/${{ github.repository }}/pulls/{n}/files` and the job token (README "gh → Gitea API"). Remove the Sonar part (D1) |
|
||||
| `codeql.yml` | CodeQL C# + C++ + actions, cron `27 4 * * 1` | **Delete** → `security.yml` caller: `dotnet: true`, `dotnet-runs-on: windows-latest`, `dotnet-version` matching global.json's band, cron **`41 14 * * 5`**. FL1 for C++ |
|
||||
| `qodana.yml` | `qodana-action`, two jobs: managed (`qodana.yaml`, `QODANA_TOKEN`) and native (`qodana-native.yaml`, `QODANA_TOKEN_NATIVE`, CMake generates the solution first) | Keep the file local (each job has build pre-steps), and swap only the action step for the Qodana CLI, as `reusable-qodana.yml`'s Windows steps do (pinned CLI 2026.3.1 + SHA-256, `qodana scan --within-docker false [--config qodana-native.yaml]`, report artifact). Drop the `checks` permission and the SARIF upload |
|
||||
| `release.yml` | tag `v*`: VERSION/CHANGELOG gates, publish, `vpk download github` → `vpk pack` → upload to GitHub Releases, checksums | Keep the gates. Velopack to R2 (runbook §5.1): `vpk download s3` / `vpk upload s3` with `VPK_BUCKET=poli0981-releases`, `VPK_PREFIX=frameledger/`, `VPK_ENDPOINT=https://${{ vars.R2_ACCOUNT_ID }}.r2.cloudflarestorage.com`, keys from the R2 secrets as env only. Keep the repo's channel names. Checksums to R2 next to the packages; Gitea release (notes from CHANGELOG via `body_path`, links only) with `gitea-release-action`. No `GH_TOKEN` |
|
||||
| `rules-publish.yml` | path-filtered gate for the detection rules | Move; pin `actions/checkout` |
|
||||
| `wiki.yml` | `workflow_run` on Release → GitHub Wiki | FL2. `workflow_run` works on Gitea; the payload's `head_branch` is **empty for tag runs** (README, ops notify fix): take the tag from `github.event.workflow_run.path` |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`.
|
||||
|
||||
## Code and tests
|
||||
|
||||
- `src/FrameLedger.App/Update/VelopackUpdateClient.cs`: `GithubSource` → HTTP source `https://releases.poli0981.dev/frameledger` (runbook §5.1); remove any GitHub token logic. Update `docs/11_UPDATER.md`.
|
||||
- `Directory.Build.props`: `RepositoryUrl` / `PackageProjectUrl` → Gitea.
|
||||
- Tests pin the GitHub URLs: `MarkdownLinksTests.cs` (4), `AccessibilityDocumentTests.cs`, `BugReportFlowTests.cs`, `DocumentWindowsTests.cs` (2 each). Change them with the links: source → Gitea, bug reports → `gitlab.com/poli0981/frameledger/-/issues`. Keep `.resx` EN/VI/JA in parity if a string changes.
|
||||
- Links: `README.md` (3), `wiki/Home.md` (2), `.github/ISSUE_TEMPLATE/accessibility.yml` + `config.yml`, `ACCESSIBILITY.md`, `FORKING.md`, `docs/10_LOGGING_AND_BUG_REPORTS.md`. The `githubusercontent` hits in `legal/licenses/` and `tools/license-overrides/` are third-party licence sources: leave them.
|
||||
- `SECURITY.md` points at GitHub advisories → e-mail. The repo documents `contact@poli0981.dev`; keep it if that is the security contact, otherwise `security@` (runbook §1 "Contact").
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `QODANA_TOKEN`, `QODANA_TOKEN_NATIVE`. Create (user level): R2 keys + `R2_ACCOUNT_ID`. Drop `SONAR_TOKEN`; no `GH_TOKEN`.
|
||||
|
||||
## Hand-off extras
|
||||
|
||||
Installed copies update from GitHub Releases and cannot be redirected (runbook §7 item 5): say which versions are affected. Branch protection (D6). Host mode: the release job runs MSVC/CMake on the PC; it installs nothing system-wide (the SDK goes to the runner tool cache as in the ops reusables).
|
||||
@@ -0,0 +1,81 @@
|
||||
# free-games-itchio-list — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `1323886` (local clone `E:\game`, Gitea `poli0981/free-games-itchio-list`). Profile: the catalog (`data_game/`) + a Python pipeline on a schedule + a React site, admin and Worker on Cloudflare (`freeitchgames.win`, the catalog bundled at build time) + Tauri desktop and Android viewers (no updater). Maintenance mode since v4.6.1. Shared decisions: [README](README.md).
|
||||
|
||||
The site still serves its last build, but nothing reaches it: Workers Builds pulled from GitHub, the admin and the Worker's cron write through a GitHub App, and the pipeline has not run since the account went. CLAUDE.md's "GitHub Actions", "Worker" and gotchas 17–18 explain the moving parts.
|
||||
|
||||
**Done 2026-11-25.** The data restore went to `main` first; the migration merged as Gitea #1 (`8776c61`) and was
|
||||
released as **v4.7.0** (desktop + Android on R2). [free-steam-games-list](free-steam-games-list.md)'s notes
|
||||
apply here too (the bot token's Repository permission, Renovate and npm lockfiles, the dhi.io pin for qodana-rust,
|
||||
one runner, a waiting run cancelled by a third); what this repo added:
|
||||
|
||||
- **Gitea's `main` was a week behind and no clone had the rest**: it had been pushed from `E:\game`, whose last
|
||||
GitHub fetch was 2026-11-16, while GitHub's pipeline committed until 11-22. The live site still served the
|
||||
Workers Build of GitHub `d6e1fd9`, and its readable catalog JSON (only for `Origin: tauri://localhost`) is
|
||||
`JSON.stringify` of the repo files: rewritten with the pipeline's own `json_io.dumps` it is byte-identical (the
|
||||
catalog has no floats), so `data_game/` and `scripts/deleted_games.json` were restored from it (+235 games, −6;
|
||||
6,298). Proof: a local build reproduced the live `manifest-v1.json` exactly (pack names are content hashes),
|
||||
and every asset of that build existed on the live site (no code commit lost). Not recoverable:
|
||||
`scripts/state/*` and `temp_link.json` of 16–22 Nov; D1 had no item stuck in `queued`, so nothing needed
|
||||
re-adding. A site that bundles its data can be its own backup when the build is deterministic.
|
||||
- **One `release.yml`** replaced `release_desktop.yml` + `release_android.yml` (one `v*` tag → Windows host,
|
||||
`ubuntu-22.04` Docker, Android Docker → `SHA256SUMS` → `publish-r2.yml` → a draft). A `workflow_dispatch` on
|
||||
`main` builds without uploading; the dry run was green on its first try, after the maintainer's rustup was
|
||||
reinstalled (free-steam's last note).
|
||||
- **D16 works**: `commit_push.sh` writes `deploy=true` when the pushed commit touched the catalog, and the data
|
||||
workflows dispatch `deploy.yml` with the job token (`bash/dispatch.sh`). A run with only state changes
|
||||
dispatches nothing.
|
||||
- **The Worker's first cron on the new code** (04:23Z, 11-25) auto-approved 100 games in one `[auto]` commit as
|
||||
`poli0981-bot` (`automation_last_run`: no errors); that push started `update.yml`, whose ingest (+98 games,
|
||||
6,396) dispatched `deploy.yml`, and the site served that commit at 05:12Z.
|
||||
- **Publishing the draft announced nothing (FG4 does not hold as written)**: Gitea credits `release: published`
|
||||
to the release's publisher, which stays the Actions user that created the draft, even when the maintainer
|
||||
clicks Publish; so, as for any job-token event, no workflow started. `announce-release.yml` was dispatched
|
||||
with the tag instead, and the release process says so now. Every repo whose release workflow leaves a draft
|
||||
for the maintainer has the same gap.
|
||||
- **Qodana**: Rust goes through the reusable's `extra-args` (v2026.11.3), as gotcha 49 asks. qodana-python flagged
|
||||
the bodies of two `isinstance` guards in the pipeline as unreachable because their parameters were annotated
|
||||
`str`; annotated as `object`, the guards stay. gitleaks: 5 non-secrets (the GPG fingerprint in CLAUDE.md twice,
|
||||
two Access audience tags, the old extension's OpenPGP.js) in `.gitleaksignore`.
|
||||
- **A command-line merge is not marked merged**: `git merge --no-ff` + push left Gitea #1 open, because the
|
||||
repository's "autodetect manual merge" setting is off; it was closed by hand with the merge SHA. Renovate's
|
||||
onboarding PR (#2), opened before `renovate.json` reached `main`, was closed too; its preview proposed JDK 25
|
||||
for the Android job, so `renovate.json` keeps `java-jdk` majors manual.
|
||||
- **The single runner**: the deploy after the merge waited ~85 minutes behind other repositories' jobs
|
||||
(01:07 → 02:32Z), and an hourly `deploy-status.yml` run queued before the merge still ran after its file was
|
||||
gone (a queued run keeps its workflow).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **FG1 — the Worker (D12, D13).** `repo.ts` + `github.ts`: the GitHub App and GraphQL `createCommitOnBranch` + `expectedHeadOid` → the Gitea contents API with the `poli0981-bot` token and each file's `sha` as the lock; `commitWithRetry` rebuilds from the new head on a refusal, as now (**VERIFY** the refusal, README D12). Reads at head (`scripts/state/ingest_outcomes.json` for reconcile, `scripts/temp_link.json`, the chunks the admin edits): Gitea raw or `GET /repos/{owner}/{repo}/raw/{path}?ref=main`, which return the bytes as they are (no base64, no mojibake). A bot commit to `scripts/temp_link.json` starts `update.yml`, as the App's did. The Worker's Cron Trigger (`23 */4 * * *`) stays on Cloudflare.
|
||||
- **FG2 — deploys (D3, D16).** A new `deploy.yml`: `push` to `main` + `workflow_dispatch`, `npm ci --ignore-scripts`, `npm run build`, `wrangler deploy` from `webapp/`. Every data commit must rebuild the site, and a job-token push starts nothing, so `update.yml` and `refresh.yml` dispatch `deploy.yml` after a commit that changed `data_game/` (job token, `actions: write`). D1 migrations stay a manual step before a deploy that needs them (gotcha 20).
|
||||
- **FG3 — schedules (D15).** `update.yml` daily at **`27 13 * * *`** (plus its push and dispatch triggers), `refresh.yml` daily at **`49 13 * * *`**, both on the Docker-only runner. `deploy-status.yml` (hourly) goes: it watched Workers Builds' check runs, and `deploy.yml` now reports its own failure through `notify-failure.yml`. The site's "updated daily" text names the evening Vietnam time and that it can slip.
|
||||
- **FG4 — releases (D9, D10).** Desktop on `windows-latest` + `ubuntu-22.04` (its glibc floor), no macOS, so no `.dmg`/`.pkg` and gotchas 1, 2 and 4 retire. Android per D10. Everything + `SHA256SUMS` to R2 under `free-games-itchio-list/<version>/` with `publish-r2.yml`, plus the alias `free-games-itchio-list-latest.apk`; a **draft** Gitea release with links. You publish the draft in the Gitea UI (no more `gh release edit`), which fires `release: published` for the announcements.
|
||||
- **FG5 — legal text.** The link edits (source on Gitea, issues on GitLab) are not a material change: `LEGAL_VERSION` stays, as in 4.4.1. `legacy-data.ts`'s 410 answer and `about.ts` point at Gitea.
|
||||
- D2 is moot (no triage workflow), D6, D7, D11 (`announce-discussion.yml` goes; the issue chooser stops linking Discussions).
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Do |
|
||||
|---|---|
|
||||
| `update.yml` | FG3 cron; dispatch `deploy.yml` after a data commit (FG2); `concurrency: ingest` (Gitea ignores `queue: max`: dropped) |
|
||||
| `refresh.yml` | FG3 cron; Gitea artifact actions for the patch; dispatch `deploy.yml` after apply (FG2) |
|
||||
| `force_update.yml` | Move; its dispatch of `refresh.yml` goes through the Gitea API (job token, `actions: write`) |
|
||||
| `notify-failure.yml` | Move; the "failed Cloudflare build" case now comes from `deploy.yml` |
|
||||
| `deploy-status.yml` | **Delete** (FG3) with `bash/cf_build_status.sh` |
|
||||
| `python-ci.yml`, `webapp-ci.yml` | Move (hash-locked pip, `npm ci --ignore-scripts`) |
|
||||
| `qodana.yml` | Callers of `reusable-qodana.yml`: TypeScript (native, `project-dir: webapp`, `package-manager: npm`), Python (native, `prepare-command` builds `.venv` and appends `QODANA_PYTHON_PATH=…` to `$GITHUB_ENV`). Rust (`windows-latest`, `within-docker`) passes `-u root -e CARGO_HOME=…` (gotcha 49) through the reusable's `extra-args` (v2026.11.3) |
|
||||
| `sonarcloud.yml` | **Delete** (D1) with `sonar-project.properties`; gotcha 41 and the coverage notes for Sonar go from CLAUDE.md |
|
||||
| `release_desktop.yml`, `release_android.yml` | FG4 |
|
||||
| `announce-release.yml`, `notify-release-pipeline.yml` | ops callers at `c3e118a` → `.gitea/workflows/<x>.yml@<ops-sha>` with `ops_ref` (that fixes the "checks out its script from `main`" note) |
|
||||
| `announce-discussion.yml` | **Delete** (D11) |
|
||||
|
||||
Add a caller of the ops `security.yml` (`python: true`, `node: true`, `rust: true`), cron **`1 15 * * 3`**. `.github/dependabot.yml` → delete; add `renovate.json` (npm, pip-tools locks, cargo; Tauri crates and their npm packages in one group, gotcha 31; the TypeScript aliases stay manual, gotcha 6). `.github/CODEOWNERS` → `.gitea/CODEOWNERS`. `.github/FUNDING.yml` is GitHub-only.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`webapp/src/lib/about.ts` (6), `README.md` + `README.vi.md` (16 each, in parity), `CONTRIBUTING.md` + VI, `SECURITY.md` + VI, `ACCESSIBILITY.md` + VI, `docs/EULA.md` + VI (and `webapp/src-tauri/installer/EULA.rtf` if it names GitHub), `NOTICE.md`, the `github.io` lines in `docs/PrivacyPolicy.md`, `docs/ToS.md`, `docs/THIRD_PARTY.md` and `webapp/README.md`, `docs/operations.md`, CLAUDE.md (Actions table, release process, "Current state"). Issue forms → GitLab templates. `changelog/*` is history.
|
||||
|
||||
## Secrets
|
||||
|
||||
Actions: keep `DISCORD_CI_WEBHOOK`, `DISCORD_PING_ROLE_ID`, `DISCORD_RELEASES_WEBHOOK`, `DISCORD_RELEASE_PIPELINE_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, `QODANA_TOKEN_TS_JS`, `QODANA_TOKEN_PYTHON` (and `QODANA_TOKEN_RUST` if Rust stays). Create (user level): R2 keys + `R2_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID`. Drop `SONAR_TOKEN` and the explicit `GITHUB_TOKEN`. Worker: `GH_APP_PRIVATE_KEY` and the App's ids → `GITEA_BOT_TOKEN` (D12).
|
||||
@@ -0,0 +1,123 @@
|
||||
# free-steam-games-list — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `eb426b8` (local clone `E:\2`, Gitea `poli0981/free-steam-games-list`; the clone sits on `test/signing`, one test commit ahead: start from `main`). Profile: the dataset (`data/*.jsonl`) + a Python scraping pipeline on a schedule + a SvelteKit site and admin on one Cloudflare Worker (`free-steam-games.win`) + Tauri desktop (with updater) and Android apps. Maintenance mode since 2026-11-11. Shared decisions: [README](README.md).
|
||||
|
||||
**This is an incident, not only a migration.** The Worker reads every shard from `raw.githubusercontent.com/poli0981/free-steam-games-list/main`, which answers 404 since the suspension (checked 2026-11-23): the site serves only what its caches still hold. The admin writes through a GitHub App, the activity feed and the desktop update feed read GitHub, and the pipeline has not run since the account went. CLAUDE.md is long and load-bearing: the session reads its Pipeline and Worker sections before touching anything.
|
||||
|
||||
**Done 2026-11-24.** The data fix went to `main` first (the Worker reads Gitea, deployed by hand with wrangler);
|
||||
the migration merged as Gitea #1 and was released as **v4.8.0 "Moving Day" / apps 2.6.0**. What the move found:
|
||||
|
||||
- **Gitea's `main` was 49 commits behind GitHub**: the import predated five days of pipeline commits
|
||||
(2026-11-17 to 11-22, about 110 auto-approved games among them). The clone's `github/main` still had them; they
|
||||
were fast-forwarded onto Gitea before anything else. Compare the forge copy with the last fetched GitHub ref
|
||||
before trusting an import.
|
||||
- **The Tauri updater key was lost with the account** (its private half lived only in GitHub's Actions secrets),
|
||||
so 2.6.0 ships a new one: installed desktop apps <= 2.5.2 cannot verify an update and must install 2.6.0 by
|
||||
hand (the old feed `/api/updates/desktop` answers 204 for good; 2.6.0 asks
|
||||
`/api/updates/desktop/v2/{target}/{arch}/{current_version}`). FS3's "installed apps keep updating" did not hold;
|
||||
for the other Tauri repos, check first that the signing key exists outside GitHub.
|
||||
- **R2 layout as built** (publish-r2 puts feeds at `<app>/<name>`): `desktop/<version>/…` and `latest.json`,
|
||||
`android/<version>/free-steam-games-list-<version>.apk`, `free-steam-games-list-latest.apk`,
|
||||
`android-latest.json`. Ops v2026.11.3 was cut for this repo: publish-r2 on any tag (its guard required
|
||||
`refs/tags/v*`, so `desktop-v*`/`android-v*` skipped the upload), `android-v` tags in notify-release-pipeline,
|
||||
and `working-directory` / `repository-root` / `extra-args` in reusable-qodana (subdirectory projects, Rust's
|
||||
`-u root`).
|
||||
- **Gitea cancels a waiting run** when a third joins its concurrency group (`models/actions/run.go`; `queue: max`
|
||||
is ignored), and stops any task after three hours. FS2's single daily workflow is the answer; every job's
|
||||
timeout is <= 170, and the rotation caps were scaled to the guide's budgets.
|
||||
- **Steam answers by the caller's country**: the jobs now run from Vietnam, so appdetails, store pages and the
|
||||
search send `cc=us`, as GetItems did.
|
||||
- **Workers Builds** had already lost its Git connection; `deploy.yml` deploys. Old `.github/workflows` ran on
|
||||
Gitea for the hours between the data fix and the merge (CodeQL and SonarCloud failed, no data job ran).
|
||||
- **qodana-rust's image is a Docker Hardened Image** (both `2026.2-eap` and `2026.3-eap`): its libraries are
|
||||
installed as `<v>+dhi0`, which sorts above the `<v>+deb13u0+dhi0` its own repository dhi.io ships, so every
|
||||
`-dev` package of a Tauri bootstrap reads as a downgrade and apt stops ("held broken packages"). The bootstrap
|
||||
in `web/src-tauri/qodana.yaml` pins dhi.io at 1001 and passes `--allow-downgrades`; any Tauri repo with a
|
||||
qodana-rust bootstrap needs the same two lines. Opening the Cargo project then took ~9 minutes in Docker
|
||||
Desktop on the PC, past the linter's default 10-minute limit on a cold cache:
|
||||
`properties: {qd.rust.configuration.timeout.minutes: "25"}`. The 2026.3-eap linter also misreads
|
||||
`tauri::generate_context!()` (`RsUnresolvedPath`, `RsTypeCheck` in `src/lib.rs`, excluded there with the
|
||||
reason). qodana-js and qodana-rust both ran in Docker Desktop on `windows-latest` (runbook §4.5's VERIFY
|
||||
holds); a download of the linter can fail with "unexpected EOF": re-run the failed job.
|
||||
- gitleaks found 8 non-secrets in the history (Access audience tags, the analytics token, a vendored OpenPGP.js
|
||||
regex), kept in `.gitleaksignore`; osv-scanner needed floors in the unpinned `requirements-dev.txt`, which it
|
||||
resolves by itself.
|
||||
- **publish-r2 at v2026.11.3 could not upload at all**: its pin `RCLONE_VERSION` is read by rclone as `--version`,
|
||||
and `rclone version` died before the first file. Fixed in **v2026.11.4** (`PINNED_RCLONE_*`, runbook §4.4). A
|
||||
release workflow runs the workflow file of its own tag, so `desktop-v2.6.0` / `android-v2.6.0` (nothing
|
||||
published from them) were moved, with the maintainer's OK, to the commit that pins v2026.11.4.
|
||||
- **The Windows build uses the maintainer's own rustup** (host mode): its `stable` had lost `bin\rustdoc.exe`, and
|
||||
`dtolnay/rust-toolchain` could neither update nor roll back ("failure removing component ... rustdoc.exe").
|
||||
A placeholder file and `rustup update stable` repaired it (1.99.1 -> 1.100.0).
|
||||
- **gitleaks' full-history fetch** (a ~164 MB pack) ran at ~12 MB/min inside the job container in the afternoon,
|
||||
against its 15-minute limit (twice timed out, once finished with seconds left), while the host and a bare
|
||||
container fetched it in under 40 s. Re-run on a timeout; if it keeps happening, raise the job's timeout.
|
||||
- **One runner is not enough once Renovate starts**: its first run after the merge opened pull requests across the
|
||||
repos, and the queue reached 80+ jobs (D15's second runner). Scheduled data jobs and releases wait their turn.
|
||||
- **The site's service worker answered Access's sign-in callback** (`/cdn-cgi/access/authorized`) from its
|
||||
offline shell, so `/admin` could not be signed in to from a browser that had the worker (pre-existing; fixed
|
||||
in Gitea #2 by adding `/cdn-cgi/` to `navigateFallbackDenylist`). Any PWA behind Cloudflare Access needs it.
|
||||
- **The Worker's bot token had the wrong permission**: `poli0981-bot` is a Bot account, which cannot sign in, so
|
||||
its tokens live in Site Administration → User Accounts → the bot, where each token's permissions are listed and
|
||||
every category starts at No access. The Worker's (`push2`) had `write:user` only: Gitea accepted it (a made-up
|
||||
token gets 401) and refused every repository call with 403, the public repository's reads included, so
|
||||
auto-approve, the Pipeline page and the Remove page all failed. Cure: a token with Repository at Read and
|
||||
write, as the Worker's `GITEA_BOT_TOKEN`; Gitea #6 makes the admin show Gitea's reason, not a bare 403. Check
|
||||
a Worker's token on that page, not only by its name.
|
||||
- **Renovate cannot update an npm lockfile without a github.com token**: the slim image installs Node on demand
|
||||
(`binarySource=install`), looking it up in `containerbase/node-prebuild`'s releases through GitHub's API;
|
||||
unauthenticated, that was rate-limited ("No tool releases found"), so the Tauri group's PR (#4) carried
|
||||
`Cargo.lock` only, with an artifact error on `web/package-lock.json`. Every npm repository meets it. In
|
||||
`renovate-config`: a read-only github.com token for those lookups, or the full image with
|
||||
`binarySource=global`.
|
||||
- **Kotlin's security update (#3, 1.9.25 → 2.4.20) is held**: Kotlin 2.2+ refuses the `kotlinOptions {}` block
|
||||
in `gen/android/app/build.gradle.kts`, and pull-request CI never builds the APK, so it would break only at the
|
||||
next `android-v` tag. It needs the `compilerOptions` migration and a real Android build.
|
||||
- **`rustup.exe` vanished from the maintainer's `~/.cargo/bin`** on 2026-11-25, after the release builds;
|
||||
`cargo`, `rustc` and the rest are symlinks to it, so they stopped too, on the host and for host-mode jobs.
|
||||
Reinstalling rustup restores them; the toolchains in `~/.rustup` stay.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **FS1 — the Worker's sources (D12, D13).**
|
||||
- Shards and `index.json`: `UPSTREAM` in `web/worker/lib/records.ts` and `web/worker/routes/data.ts` → `https://git.poli0981.dev/poli0981/free-steam-games-list/raw/branch/main`. The sha256 checks, the forever-cache by hash and `img-mint`'s "only shards that hash to the index" rule stay as they are; the comments about raw.githubusercontent's lag go.
|
||||
- Admin writes (`github-app.ts`, `git-commit.ts`): the Gitea contents API with the `poli0981-bot` token, `WRITABLE` unchanged, each file's `sha` as the lock (D12). A bot commit to `scripts/temp_info.jsonl` starts `ingest-new.yml`, as the App's did.
|
||||
- `github-runs.ts` (auto-approve's "no data-write workflow running or waiting" gate): `GET /repos/{owner}/{repo}/actions/runs` (**VERIFY** the route and its status filter). Until it works, the gate cannot be evaluated, so by the code's own rule auto-approve stays off; reviewers approve by hand.
|
||||
- `/api/activity` (`routes/activity.ts`): `GET /repos/{owner}/{repo}/commits`, public, no token.
|
||||
- **FS2 — one scheduled pipeline (D15).** The twelve scheduled data workflows become ONE, `data-daily.yml`, cron **`3 13 * * *`**, on the Docker-only runner: one job per old workflow, chained with `needs:` and `if: ${{ !cancelled() }}`, each running its old script with its old `timeout-minutes` and a smaller `JOB_BUDGET_MINUTES` (the rotation design takes the cut: a run that meets its budget leaves a different tail tomorrow). Order and budgets: ingest + removals (no budget, as before) → players (`update-json`, 20) → reviews (10) → purge (15) → store data + anti-cheat sweep (35) → all-time peaks (15) → snapshot → discovery (`discover_new.py`, 20) → the day's extra: Mon/Thu dead games (20), Wed/Sat top-online (30), Sun backfill-discover (30), the 1st and 15th top-offline (30). About 165 minutes on the longest day.
|
||||
- What changes for readers: player counts and the rest refresh once a day, in the evening Vietnam time, instead of spread over the day. The site's text that promises times (FAQ, README, `docs/`) says so.
|
||||
- `ingest-new.yml` stays separate for `push` (the admin's commits) and `workflow_dispatch`; `refetch-all.yml` stays dispatch-only. Both keep the `data-write` group. **VERIFY** what Gitea does with `queue: max` (README, shared rules): if a pending run can still evict another, ingest waits for the daily run to end.
|
||||
- `web/shared/pipeline.ts` (the list of data-write workflows) and `pipeline.test.ts` (group, `ref: main`, budget ≥ 20 below timeout) follow the new files.
|
||||
- **FS3 — releases (D8, D9, D10).**
|
||||
- Desktop (`desktop-v*`): Tauri CLI on `windows-latest` + Linux bundles on `ubuntu-latest` (as today), no macOS. The signed bundles, their `.sig` files and `latest.json` go to R2 under `free-steam-games-list/desktop/<version>/` and `free-steam-games-list/desktop/latest.json` (uploaded last). `scripts/updater_json.py` writes R2 URLs instead of rewriting GitHub's. `/api/updates/desktop` (`routes/updates.ts`) reads that `latest.json` instead of `releases.atom` and keeps every check (version, `.sig`, URL prefix now `https://releases.poli0981.dev/free-steam-games-list/desktop/`), so **installed desktop apps keep updating**: they ask the Worker, not GitHub.
|
||||
- Android (`android-v*`): the signed APK to `free-steam-games-list/android/<version>/`, the alias `free-steam-games-list-latest.apk` and `android/latest.json`; `web/src/lib/android-update.ts` reads that file. Released Android apps ask `api.github.com` and will not see the update: the announcement covers them (runbook §7 item 5).
|
||||
- The Tauri flavour of the CSP (`web/build/sveltekit-config.ts`, `tauri.conf.json`) swaps `https://api.github.com` for `https://releases.poli0981.dev`; `verify-dist.mjs` and the config tests follow.
|
||||
- Dataset releases (`v*`) carry notes only: create them on Gitea from the changelog file, as before on GitHub.
|
||||
- **FS4 — legal text.** PRIVACY_POLICY, ToS and DISCLAIMER name GitHub as the place the data lives and comes from. Consent here is a hash per document, so any edit reopens the gate: make every legal edit of the migration in ONE commit, so readers accept once.
|
||||
- **FS5 — contributions.** The five issue forms become GitLab templates (`.gitlab/issue_templates/add_game.md`, …); the About page links `https://gitlab.com/poli0981/free-steam-games-list/-/issues/new?issuable_template=<name>` (the page links the forms by file name, so this is the web change CLAUDE.md warns about). Data merge requests on GitLab are applied on Gitea by hand.
|
||||
- D3 (deploy job; data-only and docs-only commits still never deploy, legal documents still do: `docs/DEPLOYMENT.md` "Which commits deploy" becomes the `paths` filter of `deploy.yml`; job-token data commits deploy nothing anyway), D6, D7, D11.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Do |
|
||||
|---|---|
|
||||
| `update-json.yml` (`0 0 * * *`), `update-reviews.yml` (`0 6`), `purge-unhealthy.yml` (`0 7`), `refresh-store-data.yml` (`0 16`), `refresh-peaks.yml` (`30 19`), `snapshot-daily.yml` (`0 23`), `discover-new.yml` (`0 5`), `mark-dead-games.yml` (Mon/Thu), `top-online.yml` (Sun/Wed/Fri), `top-offline.yml` (1st/15th), `backfill-discover.yml` (Sun) | Folded into `data-daily.yml` (FS2). Keep each one's `workflow_dispatch` path as a `job` input of `data-daily.yml`, so one part can still be run by hand (`refresh-peaks`' `backfill` input included) |
|
||||
| `ingest-new.yml` (push + `0 */3 * * *` + dispatch) | Keep `push` and `workflow_dispatch`; the schedule goes (FS2) |
|
||||
| `refetch-all.yml`, `check-overrides.yml`, `python-tests.yml`, `web-ci.yml` | Move. Every data job keeps `bash/commit_push.sh`, `ref: main`, `permissions: contents: write` with the job token, and hash-locked installs |
|
||||
| `codeql.yml` | **Delete** → ops `security.yml` caller (`python: true`, `node: true`, `rust: true`), cron **`49 15 * * 2`** |
|
||||
| `qodana.yml` | Callers of `reusable-qodana.yml`: Python (native, `prepare-command` builds `.venv` and appends `QODANA_PYTHON_PATH=…` to `$GITHUB_ENV`), JS (Docker for the Svelte plugin: `runs-on: windows-latest`, `within-docker: true`). Rust needs `-u root -e CARGO_HOME=…` (CLAUDE.md), which the reusable cannot pass yet: the Rust project leaves Qodana unless the ops repo adds an `extra-args` input |
|
||||
| `sonarcloud.yml` | **Delete** (D1) with `sonar-project.properties`; `web/shared/toolchain.test.ts` stops reading it, and CLAUDE.md's SonarCloud section goes |
|
||||
| `release-desktop.yml`, `release-android.yml` | FS3 |
|
||||
| `announce-release.yml`, `notify-ci-failure.yml`, `notify-release-pipeline.yml` | ops callers at `@main` → `poli0981/.github/.gitea/workflows/<x>.yml@<ops-sha>` + `ops_ref`, Discord secrets by name |
|
||||
| `deploy-pages.yml`, `notify-deploy.yml`, `announce-release-discussion.yml` | **Delete** (D11; the second only listened for the first) |
|
||||
| new `deploy.yml` | D3: `push` to `main` with the paths of FS4/D3 + `workflow_dispatch`; `npm ci --ignore-scripts`, `npm run build` (it runs `build:admin`), `wrangler deploy` from `web/` |
|
||||
|
||||
The Worker's own Cron Trigger (`*/15 * * * *`: reconcile, auto-approve, image minting) stays: it runs on Cloudflare, not on the PC. `.github/dependabot.yml` → delete; add `renovate.json` (npm, pip with hashes, cargo; the TypeScript 6/7 aliases are bumped by hand, as now).
|
||||
|
||||
## Links and docs
|
||||
|
||||
`steamcharts.py`'s User-Agent names the project URL: Gitea. `ErrorView.svelte` (new issue → GitLab), `Sidebar.svelte`, `web/static/.well-known/security.txt`, `README.md` (15), `CONTRIBUTING.md`, `SECURITY.md`, `ACCESSIBILITY.md`, `AUTHORS.md`, `docs/Contact.md`, `docs/SECURITY_SETUP.md`, `docs/DEPLOYMENT.md`, the legal documents (FS4), `.github/ISSUE_TEMPLATE/*` and the PR template (FS5), `web/README.md`, CLAUDE.md (pipeline, deploy, CI). `docs/plan/*` and `changelog/*` are history: leave them.
|
||||
|
||||
## Secrets
|
||||
|
||||
Actions: keep `STEAM_API_KEY`, `CF_ACCESS_CLIENT_ID`, `CF_ACCESS_CLIENT_SECRET`, `WORKER_BASE_URL`, `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD`, `TAURI_SIGNING_PRIVATE_KEY`, `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`, `QODANA_TOKEN_PYTHON`, `QODANA_TOKEN_TS_JS` (and `QODANA_TOKEN_RUST` if Rust stays), the Discord webhooks. Create (user level): R2 keys + `R2_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID`. Drop `SONAR_TOKEN` and the explicit `GITHUB_TOKEN`. Worker: the GitHub App's id and key → `GITEA_BOT_TOKEN` (D12), set with `wrangler secret put`.
|
||||
@@ -0,0 +1,80 @@
|
||||
# HashTool — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `8af82be` (local clone `E:\hash`, Gitea `poli0981/HashTool`). Profile: Avalonia 12 / .NET 10 app (`CheckHash`) + NativeAOT CLI (`hashtool`), Velopack on Windows, macOS and Linux (runbook §5.1). Maintenance mode since 1.3.0. Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-26.** The migration merged as Gitea #2 (fast-forward to `c26a857`, 17 commits, with the release commit
|
||||
and the fixes the first runs asked for), and **1.3.1** was released to `releases.poli0981.dev/hashtool/` by the
|
||||
dispatched Release workflow. Renovate's onboarding PR #1 was closed (#2 adds `renovate.json`). What the move found:
|
||||
|
||||
- **The runner's Ubuntu images have no ICU.** Every .NET process died at start-up ("Couldn't find a valid ICU
|
||||
package"). Jobs that run the tests or the app install `libicu-dev`; jobs that only restore, build or run tools set
|
||||
`DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1`. The ops `security.yml` NuGetAudit job had the same problem on its default
|
||||
`ubuntu-latest`; fixed in ops v2026.11.5, which HashTool pins since #3 (its NuGetAudit job runs on the default
|
||||
`ubuntu-latest` again).
|
||||
- **Avalonia 12.2's XAML compiler names generated types and methods with U+0001.** Microsoft.CodeCoverage's Cobertura
|
||||
writer cannot put that into XML: all tests passed, then the test host crashed (exit -532462766). A plain
|
||||
`dotnet test` does not show it; CI's `--coverage` does. `eng/coverage.config` limits coverage to HashTool.Core, the
|
||||
only module the gate measures.
|
||||
- **Host-mode PowerShell cannot load `Microsoft.PowerShell.Archive`**, so `Compress-Archive` fails;
|
||||
`[IO.Compression.ZipFile]::CreateFromDirectory` works. `CheckHash.exe` is a GUI-subsystem program: PowerShell waits
|
||||
for it only through `Start-Process -Wait`. `shell: bash` is avoided on the host (`System32\bash.exe` is WSL) and so
|
||||
is `python3` (only `python` exists).
|
||||
- **Qodana through the ops reusable** (CLI, newer `qodana-dotnet`) rates `HashAlgorithmName.MD5` critical
|
||||
(`CsharpUsingCryptographyHashAlgorithmNameMD5`) and failed the gate; HashTool offers MD5 as a checksum, so the
|
||||
inspection is ignored for `HashFunction.cs`. Qodana Cloud only accepts VCS URLs on github.com, gitlab.com and
|
||||
bitbucket.org: the HASH project points at the GitLab mirror (`https://gitlab.com/poli0981/HashTool.git`), not Gitea.
|
||||
- **Release path.** Releases stay dispatch-based (`version`, `publish`; tags without `v`), so the ops `publish-r2.yml`
|
||||
(tag refs only) does not apply: the publish job uploads `hashtool/<version>/` (CLI archives, CycloneDX SBOMs,
|
||||
`SHA256SUMS`) with rclone pinned and checked like `publish-r2.yml`, then `vpk upload s3` publishes `linux` from
|
||||
Docker and `win` from the host. The Gitea release job creates the tag (`target_commitish`). vpk 1.2.161 names the
|
||||
Linux build `HashTool.AppImage` and also writes `RELEASES-linux`. The upgrade gate is off (HT2: the 1.1.3 portables
|
||||
were GitHub assets and are not on R2); `tests/Compat/LegacyClient` stays for a possible bridge release.
|
||||
- A transient DNS failure on the PC (`builds.dotnet.microsoft.com` not found during setup-dotnet) failed one job; a
|
||||
re-run passed. A full PR round (CI, Security, Qodana, Release dry run) took ~30 min on the single runner.
|
||||
- **Branch protection on `main`** (D6): no push, no force push, administrators included; required checks
|
||||
`CI / ci-ok (*)`, `Security / vulnerable-packages (*)`, `Security / licenses (*)`, `Security / workflow-lint (*)`,
|
||||
`Reusable / Security / Secrets (gitleaks) (*)`, `Reusable / Security / Dependencies (osv-scanner) (*)`,
|
||||
`Reusable / Security / .NET (NuGetAudit) (*)`.
|
||||
- The notifier `notify-release-pipeline.yml` reports a dispatched run with the branch (`main`) as its tag: Gitea's
|
||||
`workflow_run` payload carries no dispatch inputs.
|
||||
|
||||
The repo's CLAUDE.md and docs/RELEASING.md bind the session: Velopack invariants (pack id `HashTool`, channels `win`/`osx`/`osx-x64`/`linux`, exe `CheckHash`, tags **without** `v`), workflow rules (SHA pins, `persist-credentials: false`, per-job permissions, no `${{ }}` inside `run:`), `ci-ok` as the single required check, and **never run a built `Setup.exe`/`.pkg` on the maintainer's machine**. On Gitea, `windows-latest` *is* the maintainer's machine (host mode), so that last rule now applies to CI too.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **HT1 — macOS (D9):** CI and releases for Windows + Linux only. README and RELEASING.md say macOS builds stopped; macOS installs keep the GitHub feed they have, which cannot be redirected (runbook §7 item 5).
|
||||
- **HT2 — the upgrade gate's 1.1.3:** the gate fetches the 1.1.3 portable zips from R2 (`hashtool/1.1.3/HashTool-<channel>-Portable.zip`). Before the first release, put them there if you still have them; if you do not, the gate is switched off with a note in RELEASING.md.
|
||||
- **HT3 — data dir on the host runner:** every job that starts the app on `windows-latest` (ci smoke test, upgrade gate) sets `HASHTOOL_DATA_DIR` to a folder under the job's temp dir in `env:`, or it reads and writes your real `%LOCALAPPDATA%\HashTool`. The upgrade gate only runs the **portable** build, in the job's temp dir.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | build/test on Windows, macOS, Linux; coverage gate; smoke test; format; translations; `ci-ok`; upstream `upload-artifact` | Move; drop the macOS matrix entries (HT1); Gitea artifact action; `HASHTOOL_DATA_DIR` for the Windows smoke test (HT3). `ci-ok` stays the one check for branch protection (D6) |
|
||||
| `codeql.yml` | CodeQL actions + csharp + python, cron `17 3 * * 3` | **Delete** → `security.yml` caller of the ops repo: `dotnet: true`, `python: true` (eng/*.py), cron **`43 13 * * 1`**. Update CLAUDE.md's workflow list |
|
||||
| `dependency-review.yml` | GitHub dependency review | **Delete** (D7). Licences stay covered by the local `security.yml` (`nuget-license` + `eng/allowed-licenses.json`) |
|
||||
| `dependency-submission.yml` | submits the NuGet graph to GitHub's dependency graph | **Delete** (D7): nothing on Gitea reads it; NuGetAudit sees transitive packages |
|
||||
| `security.yml` (local) | vulnerable packages, licences, `gitleaks-action`, actionlint, zizmor; cron `23 4 * * 1` | Keep: licences, actionlint and zizmor are this repo's own gates. Point actionlint and zizmor at `.gitea/workflows`; run zizmor with `online-audits: false` and `advanced-security: false` (README, shared rules). Drop the `gitleaks-action` job: the ops caller above runs gitleaks on the full history. Cron → **`19 15 * * 2`** |
|
||||
| `qodana.yml` | `qodana-action`, `qodana-dotnet` native, `checks` permission, cron `37 4 * * 4` | Caller of `reusable-qodana.yml` with `dotnet-global-json-file: global.json` (linter and mode from `qodana.yaml`), cron **`53 13 * * 4`**. The annotations and the PR comment go; the report stays an artifact |
|
||||
| `release.yml` | dispatch-only (`version`, `publish`) + dry run on PRs touching release files; every channel, CLI for every RID; upgrade gate from 1.1.3; attestations; draft → latest GitHub release with all assets | See **Release path** below |
|
||||
| `announce-release.yml`, `notify-ci-failure.yml`, `notify-release-pipeline.yml` | ops callers at `c3e118a` (old `.github/workflows` path) | `poli0981/.github/.gitea/workflows/<x>.yml@<ops-sha>` + `ops_ref`. Tags have no `v`; the release notifier still fires because `release.yml` runs on `workflow_dispatch` |
|
||||
| `scorecard.yml` | OpenSSF Scorecard | **Delete** (D7) |
|
||||
| `sonarcloud.yml` | SonarCloud | **Delete** (D1). Remove `dotnet-sonarscanner` from `.config/dotnet-tools.json` (keep `dotnet-coverage` only if `ci.yml` still uses it) and the SonarCloud section of CLAUDE.md |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json` (it reads `.config/dotnet-tools.json`; vpk and the Velopack package still move together: group them in a `packageRules` entry if Renovate splits them). `.github/CODEOWNERS` → `.gitea/CODEOWNERS`. `.github/FUNDING.yml` is GitHub-only.
|
||||
|
||||
## Release path
|
||||
|
||||
- Channels `win` and `linux` (HT1) with `vpk download s3` → `vpk pack` → `vpk upload s3`, `VPK_PREFIX=hashtool/`, keys as env only (runbook §5.1). Keep `eng/assert-release.py` and the invariants.
|
||||
- CLI archives + `SHA256SUMS` to R2 under `hashtool/<version>/` (`publish-r2.yml`, or rclone in the same job).
|
||||
- `src/HashTool.App/Services/UpdateService.cs`: `GithubSource` → HTTP source `https://releases.poli0981.dev/hashtool`. `tests/Compat/LegacyClient` keeps `GithubSource`: it *is* 1.1.x.
|
||||
- Gitea release (notes + links, no binaries) with `gitea-release-action`; the job announces it itself (a release made by the job token starts no workflow).
|
||||
- Attestations go (D7). Release credentials stay in the `workflow_dispatch` publish path only (rule 10); the PR dry run gets none.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md` (10), `CONTRIBUTING.md` (4), `.github/ISSUE_TEMPLATE/` (`config.yml` 3, `accessibility.yml`, `hash_algorithm.yml`, `translation.yml`), `ACCESSIBILITY.md` (3), `Directory.Build.props`, `SECURITY.md` (GitHub advisories → e-mail; the repo documents only `accessibility@`, so use `security@poli0981.dev`), the About screen `AboutViewModel.cs` (2) with `DialogTests.cs` / `MainWindowViewModelTests.cs`, docs/RELEASING.md, CLAUDE.md ("Maintainer: poli0981 (GitHub)", workflow list). Any new UI string goes through `eng/loc.py set` into all 67 resx files.
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`, `DISCORD_CI_WEBHOOK`, `DISCORD_RELEASE_PIPELINE_WEBHOOK`, `QODANA_TOKEN`. Create (user level): R2 keys + `R2_ACCOUNT_ID`. Drop `SONAR_TOKEN`.
|
||||
@@ -0,0 +1,81 @@
|
||||
# jsonPrism — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `9923c4c`. Profile: React/Vite web app + API Worker on Cloudflare (`jsonprism.poli0981.dev`) + Tauri 2 desktop (no updater) + Android APK (runbook §5.2, §5.3). Maintenance mode. Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-27.** The migration, the dependency refresh and the release commit merged together as Gitea #2
|
||||
(`aab4b89`, 7 commits); the CI `deploy` job put the site live and **v2.3.0** went to R2 (Windows, Linux, Android; no
|
||||
macOS, D9). Renovate's onboarding PR (#1) was closed: #2 adds `renovate.json` with this repo's rules. What the move
|
||||
found:
|
||||
|
||||
- **Gitea's `main` matched `github/main`** (`9923c4c`, the 2.2.1 release): nothing to restore. Until #2 merged, the
|
||||
GitHub-era `maintenance-triage.yml` still ran from `main` on `pull_request_target` (owner PRs: skipped).
|
||||
- **The runner did not come up at logon**: the scheduled task "Gitea Runner" started before Docker Desktop and the
|
||||
daemon exited with "Docker Engine socket not found and docker_host config was invalid" (07:08 local); queued jobs
|
||||
of every repo waited until `Start-ScheduledTask 'Gitea Runner'` once Docker was up (the first retry, a few seconds
|
||||
later, still failed). With capacity 1, #2's first checks waited ~30 min behind free-games-itchio-list's ingest and a
|
||||
RepoLens PR.
|
||||
- **SSH push refused, HTTPS works**: `ssh://git@git.poli0981.dev:2222/…` answers "Permission denied (publickey)"
|
||||
from the agent's shell on the PC, while `https://git.poli0981.dev/…` pushes through Git Credential Manager (one
|
||||
transient "Failed to authenticate user" on a branch delete, fine on retry). The session pushed by URL and left the
|
||||
`origin` remote as it was.
|
||||
- **Two Discord secrets were not carried over**: the repo had `DISCORD_RELEASES_WEBHOOK` and `DISCORD_REPO_WEBHOOK`
|
||||
but not `DISCORD_CI_WEBHOOK` or `DISCORD_RELEASE_PIPELINE_WEBHOOK` (youtube-generator has both).
|
||||
`discord_notify.py` exits 1 without its webhook, so the release-pipeline notifier fails after every tag run until
|
||||
they exist; `DISCORD_PING_ROLE_ID` is optional.
|
||||
- **Renovate's onboarding preview** showed two proposals this repo cannot take: `ubuntu` 26.04 (it reads `runs-on:`
|
||||
labels with the `github-runners` datasource, but the labels are the PC runner's) and JDK 25. `renovate.json`
|
||||
disables `github-runners`, `node`/`java-jdk`, and the `gradle`/`gradle-wrapper` managers (the committed Tauri
|
||||
Android project). The OSV alert it raised, kotlin-gradle-plugin 1.9.25 → 2.4.20 (CVE-2026-53914, moderate,
|
||||
unsafe deserialization of the Kotlin build cache), waits for Tauri's template with the reason in `renovate.json`;
|
||||
the release job never shares or restores a build cache.
|
||||
- **Security on the first run**: Opengrep, osv-scanner and cargo-deny passed after the refresh (`url` 2.5.9,
|
||||
`cookie` 0.18.3 taken; the six Tauri-stack advisories nobody fixes yet in `src-tauri/osv-scanner.toml`, as
|
||||
youtube-generator). gitleaks found one non-secret, the Web Analytics beacon token in `src/lib/analytics.ts`, in
|
||||
`.gitleaksignore`. `npm audit`: 0 — typescript-eslint 8.74 moved to minimatch 11, which closed the last GitHub-era
|
||||
alert (GHSA-g3hv-75wg-m249).
|
||||
- **Release dry run from the branch** (web route `POST /{owner}/{repo}/actions/run?workflow=release.yml`,
|
||||
`ref=refs/heads/chore/gitea-migration`, as youtube-generator): verify, Windows (~6 min on the host), Linux
|
||||
(`ubuntu-22.04`, ~9 min) and Android (~7 min, SDK + NDK 27.2 installed in the job) all green on the first try.
|
||||
Unlike youtube-generator, this repo's committed `gen/android` `BuildTask.kt` runs the **npm** Tauri CLI, so no
|
||||
`cargo install tauri-cli` is needed. The APK's signer certificate SHA-256 is `fef0029e…b645`; the keystore on the PC
|
||||
(`E:\jsonprism-release.jks`) is PKCS12 with alias `jsonprism`, which `keytool` will not list without its password,
|
||||
so the maintainer should confirm it matches the 2.2.1 APK's.
|
||||
- **Production smoke as a reusable**: `production-smoke.yml` is `workflow_call` + `workflow_dispatch`, and `ci.yml`'s
|
||||
`smoke` job calls it with `uses: ./.gitea/workflows/production-smoke.yml` after `deploy`, the pattern
|
||||
free-games-itchio-list uses for its notifier. The first `deploy` (run 795) put `aab4b89` live; the same checks by
|
||||
hand passed while the `smoke` job still queued behind Qodana.
|
||||
- **The keystore alias is a secret, so the logs hide the app's name**: `ANDROID_KEY_ALIAS` is `jsonprism`, and the
|
||||
runner masks secret values in the run's logs, so even the `assemble` job (which gets no secret) shows `***` for
|
||||
"jsonprism" (`releases.poli0981.dev/***/2.3.0/…`). The files and notes are right; only the logs read oddly.
|
||||
- **One runner, many queues**: the PR's Qodana Rust run (Docker Desktop, cold cache) would have held the `deploy` job
|
||||
for ~25 minutes after the merge; it was cancelled, since the push to `main` runs the same scan.
|
||||
- **GnuPG on the PC**: the first signed commit failed with "sending fd … to keyboxd: Input/output error" although the
|
||||
signature was made; `gpgconf --kill keyboxd` fixed it.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- D3: a deploy job with `wrangler deploy`, and `production-smoke.yml` runs after it. D9: no macOS bundles. D10: the Android SDK is installed in the job. D11: `pages-redirect.yml` and `announce-discussion.yml` go.
|
||||
- **Qodana Rust:** in Docker on `windows-latest` (`within-docker: true`); if the image does not run under Docker Desktop on the PC (**VERIFY**), the Rust project goes.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`; `runs-on: ubuntu-24.04` stays, it is a runner label)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | build/test, Sonar, upstream artifact actions | Move; Gitea artifact actions; remove Sonar (D1); add the `wrangler deploy` job on `main` pushes (D3) |
|
||||
| `production-smoke.yml` | on push to `main`: waits until the site serves the pushed commit, then checks headers, routing, redirects, API | Keep. Run it after the deploy job (`needs:` in the same workflow, or `workflow_run` on CI) instead of polling for Workers Builds |
|
||||
| `qodana.yml` | `qodana-action`: JS native (`QODANA_TOKEN_TS_JS`) + Rust Docker (`QODANA_TOKEN_RUST`) | Two callers of `reusable-qodana.yml` (TS: `package-manager: npm`; Rust: `runs-on: windows-latest`, `within-docker: true`, its config), separate `artifact-name` |
|
||||
| `release.yml` | tag → `tauri-action` on a matrix incl. macOS + Android APK into ONE draft release; `github-script`; SHA256SUMS; attestations | Tauri CLI on `windows-latest` (+ Linux bundles on `ubuntu-24.04`); no macOS (D9); Android per D10. Everything + `SHA256SUMS.txt` to R2 with `publish-r2.yml` (`app: jsonprism`, `<version>/…`; a `jsonprism-latest.apk` alias if you link the APK from the site); draft **Gitea** release with links (`gitea-release-action`, `draft: true`); drop attestations (D7). You publish the draft, which fires `release: published` for the announcements |
|
||||
| `announce-release.yml`, `notify-ci-failure.yml`, `notify-release-pipeline.yml` | ops callers at `c3e118a` (old `.github/workflows` path) | `poli0981/.github/.gitea/workflows/<x>.yml@<ops-sha>` + `ops_ref` |
|
||||
| `announce-discussion.yml` | posts to GitHub Discussions on release | **Delete** (D11): Gitea has no Discussions; Discord gets the announcement |
|
||||
| `pages-redirect.yml` | GitHub Pages redirect `poli0981.github.io/jsonPrism/` → the site | **Delete** (D11) with `.github/pages-redirect/` |
|
||||
| `maintenance-triage.yml` | `issues` + `pull_request_target` + `github-script` | **Delete** (D2) |
|
||||
|
||||
Add a caller of the ops `security.yml` (`node: true`, `rust: true`, cron **`19 13 * * 5`**). `.github/dependabot.yml` → delete; add `renovate.json`. `.github/FUNDING.yml` is GitHub-only.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md` and `README.vi.md` (13 each, keep them in parity), `CONTRIBUTING.md` (8), `MAINTAINERS.md` (6), `DISCLAIMER.md` (4), `.github/ISSUE_TEMPLATE/` (`config.yml` 3, `accessibility.md`, `bug_report.md`), `.github/PULL_REQUEST_TEMPLATE.md` (3), `package.json` (3), `ACCESSIBILITY.md` + `docs/i18n/vi/ACCESSIBILITY.md`, `public/.well-known/security.txt` (2), `docs/DEPLOYMENT.md`, `src/pages/About.tsx`, and the tests that pin links: `useExternalLinkInterceptor.test.ts`, `privacy-features.test.ts`. CLAUDE.md (deploy path, CI). `THIRD-PARTY.md` / `package-lock.json` `github.io` hits are third-party. `SECURITY.md`: GitHub advisories → `security@poli0981.dev` (already documented).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `QODANA_TOKEN_TS_JS`, `QODANA_TOKEN_RUST`, `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD`, `DISCORD_*`. Create (user level): R2 keys + `R2_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` (D3). Drop `SONAR_TOKEN` and the explicit `GITHUB_TOKEN`.
|
||||
@@ -0,0 +1,86 @@
|
||||
# MarkLens — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `2d33b1c` (local clone `E:\marklens`, Gitea `poli0981/MarkLens`). Profile: Flutter desktop app (Windows installer via Inno Setup, Linux package), with an in-app update check. Docs 11 and 14 describe packaging and CI. Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-27**, the first Flutter repo. The migration merged as Gitea #2 (9 commits) and #3 stacked on it (the
|
||||
remote-badge fix, Flutter 3.50.1, maintenance mode and the release commit), both by fast-forward in the UI (every
|
||||
commit stays signed); tagged and released as **v1.1.0**: the four artefacts and `SHA256SUMS` under
|
||||
`releases.poli0981.dev/marklens/1.1.0/`, the update feed `marklens/latest.json` uploaded last, a Gitea release with the
|
||||
notes and links, published (not a draft). Renovate's onboarding PR #1 was closed: #2 adds `renovate.json`. #4 ticked
|
||||
the release checklist. What the move found:
|
||||
|
||||
- **Flutter has no setup action that fits host mode.** `subosito/flutter-action`'s steps are `shell: bash`, which on
|
||||
the host-mode Windows runner can resolve to WSL's `bash.exe`. `tool/ci/install-flutter.{sh,ps1}` download the
|
||||
pinned archive from `storage.googleapis.com`, check a SHA-256 pinned in `tool/ci/flutter.env` (copied from Google's
|
||||
`releases_<os>.json`, not fetched beside the archive), and unpack it into `$RUNNER_TOOL_CACHE` (else
|
||||
`%LOCALAPPDATA%\gitea-runner\toolcache`): once per version, never system-wide on the PC. A release passes
|
||||
`--fresh`/`-Fresh` (job temp dir, no shared cache). The PC has `LongPathsEnabled=1`, which the SDK needs (its
|
||||
deepest relative path is ~186 characters). Flutter runs as root in the Docker jobs with only a warning.
|
||||
- **The Linux floor is a runner label again.** The GitHub release built the `.deb` and AppImage with `docker run -v
|
||||
"$PWD:/src"` inside the job; from inside the runner's own container that mounts a host path, not the checkout.
|
||||
`runs-on: ubuntu-22.04` *is* the build machine here (the runner's image), so the job installs
|
||||
`tool/linux/Dockerfile`'s packages there and a repo test holds the label and the Dockerfile's `FROM` together. The
|
||||
goldens, made in an `ubuntu:24.04` container, match byte for byte on the runner's `ubuntu-24.04` image.
|
||||
- **Renovate would have moved the floor.** The onboarding PR listed "update dependency ubuntu to v26" (the
|
||||
Dockerfiles' base images), and the `github-runners` datasource proposes newer `runs-on` labels. MarkLens's
|
||||
`renovate.json` disables both for Ubuntu: 22.04 is its glibc floor, 24.04 its goldens' image. **Any repo that pins
|
||||
an Ubuntu label on purpose (youtube-generator's `ubuntu-22.04` floor) wants the same rule**; a candidate for the
|
||||
preset. Also local: `constraints.flutter` (the SDK Renovate's lockfile updates install), and holds on
|
||||
`desktop_drop` < 0.9 (a `cross_file` wall) and `window_manager` < 0.6 (a nativeapi rewrite, held by decision).
|
||||
**pub joined the preset's 3-day release-age rule** (renovate-config #7): pub.dev reports `published`.
|
||||
- **The update feed (D8).** `tool/release/release_files.py` writes `latest.json` — `{app, version, tag, published,
|
||||
page, files[{name, url, sha256, size}], sha256sums}` — and the release notes from CHANGELOG. The app reads
|
||||
`version` and `page`, and opens `page` only on `git.poli0981.dev` / `releases.poli0981.dev` (the GitHub version
|
||||
opened any `html_url`). The Gitea release is published, not a draft: the banner links to it, and a draft is a 404
|
||||
for everyone else. So the tag is the release decision, and the person's checks moved before it (doc 15).
|
||||
`latest.json` answers with `cf-cache-status: DYNAMIC`.
|
||||
- **First CI run, two reds, neither in the code.** gitleaks (full history) flagged `sonar.projectKey=…` in the
|
||||
deleted `sonar-project.properties` as `generic-api-key`; `.gitleaksignore` records that fingerprint, as softharbor's
|
||||
does. The golden job died in `apt-get` on one failed DNS lookup of `archive.ubuntu.com` from the runner's Docker
|
||||
network; every `apt-get` now runs with `-o Acquire::Retries=5`. osv-scanner reads `pubspec.lock` (green).
|
||||
- **The tag run lost its Windows artifact** to `Failed to CreateArtifact … Request timeout` (all 5 attempts) after a
|
||||
good build; nothing had been published, and "Re-run failed jobs" finished the chain with the Linux artifact kept.
|
||||
- **Timings on the single runner**: a PR round ~25 min once it starts (`CI` + `Security`); the release rehearsal's
|
||||
build jobs 6 min (Windows, host) and 4.7 min (Linux), assemble 30 s. A PR stacked on another was the cheaper
|
||||
path: the lower PR's runs were cancelled and the upper one's CI covered both before both fast-forwarded.
|
||||
- **Enabling Actions on 28.4.0** is Settings → Actions → General → "Enable Repository Actions" (not in the Advanced
|
||||
settings list; `/settings/actions` 404s until it is on).
|
||||
- **Branch protection on `main`** (D6): no push, no force push, administrators included; required checks
|
||||
`CI / ci-ok (*)`, `Security / workflow-lint (*)`, `Reusable / Security / Secrets (gitleaks) (*)`,
|
||||
`Reusable / Security / Dependencies (osv-scanner) (*)`. Default merge style: fast-forward only.
|
||||
- **Installs of 1.0.0–1.0.2** ask `api.github.com/repos/poli0981/MarkLens/releases/latest`, now 404, silently by
|
||||
design: README, SECURITY.md, the CHANGELOG and the release notes tell them to install 1.1.0 once by hand.
|
||||
- **WinGet is paused**: winget-pkgs PRs come from a GitHub fork, and the pending 1.0.1 submission (#439835) points at
|
||||
dead GitHub downloads. `tool/winget/` is unchanged.
|
||||
- **Contacts**: CLAUDE.md said to leave `{{CONTACT_EMAIL}}` for the maintainer; this guide decided
|
||||
`security@`/`code@poli0981.dev`, and the runbook wins for migration topics. Reported in #2; CLAUDE.md updated.
|
||||
- **Not done**: no Discord announcement (MarkLens has no Discord webhooks; three secrets and one
|
||||
`announce-release.yml` caller would add it); the listings (SoftHarbor, poli0981.dev) still link GitHub.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **D8 — the update check:** a `latest.json` (version + download URLs) at `releases.poli0981.dev/marklens/latest.json`, uploaded last by each release (a `*.json` name, so the cache is bypassed); `update_service.dart` reads it. Not the Gitea API: the app stays off the forge, like every other app. `legal/PRIVACY.md` names the new host: it is a privacy statement, not just a doc.
|
||||
- D6: branch protection on `main` requires the CI checks.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | analyze/test/build on a matrix, Sonar (`sonar-project.properties`), upstream artifact actions | Move; Gitea artifact actions; remove Sonar and `sonar-project.properties` (D1). The Windows leg runs in host mode on the PC: the Flutter SDK goes to the runner tool cache, nothing system-wide |
|
||||
| `codeql.yml` | CodeQL, cron `17 3 * * 1` | **Delete** → ops `security.yml` caller (no language flag fits Dart: you get gitleaks, the workflow rules and osv-scanner on `pubspec.lock`), cron **`23 15 * * 5`** |
|
||||
| `dependency-review.yml` | GitHub dependency review | **Delete** (D7) |
|
||||
| `release.yml` | builds the four artefacts of doc 11 on `ubuntu-24.04` and `windows-2025`, draft GitHub release; only a `v*` tag reaches the writing job | `windows-2025` → `windows-latest`; Gitea artifact actions; artefacts + checksums to R2 with `publish-r2.yml` (`app: marklens`, `<version>/…`, `latest.json` as the feed file for D8); draft Gitea release with links. Keep the dispatch-builds-only / tag-writes split (rule 10) |
|
||||
| `watch-observation.yml` | manual matrix run | Move; drop any macOS leg |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json` (Renovate reads `pubspec.yaml`). `.github/FUNDING.yml` is GitHub-only.
|
||||
|
||||
## Code, packaging, docs
|
||||
|
||||
- `lib/core/update/update_service.dart` (D8) and its tests: `test/core/update_service_test.dart` (expects the host `api.github.com`), `test/architecture/no_network_test.dart` (the allowed-host list).
|
||||
- `packaging/linux/dev.poli0981.marklens.metainfo.xml` (3: homepage → Gitea, bugtracker → GitLab issues), `packaging/windows/marklens.iss` (`AppURL`s).
|
||||
- `README.md` (5), `docs/03_DATA_FLOW.md`, `docs/10_SECURITY_PRIVACY.md`, `docs/11_PACKAGING_UPDATE.md`, `legal/PRIVACY.md` (D8), CLAUDE.md. `tool/fonts/build_fonts.py` fetches Noto fonts from `raw.githubusercontent.com`: third-party, leave it.
|
||||
- `SECURITY.md`: GitHub advisories → e-mail. The repo documents no `@poli0981.dev` address in tracked text: use `security@poli0981.dev`. Add GitLab issue templates (runbook §3.4).
|
||||
|
||||
## Secrets
|
||||
|
||||
The inventory found none besides `SONAR_TOKEN` (drop). Create (user level): R2 keys + `R2_ACCOUNT_ID`.
|
||||
@@ -0,0 +1,38 @@
|
||||
# OmniDeck — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `90f667e`. Profile: .NET 10 WPF (`net10.0-windows`, `.slnx`), Velopack, releases from GPG-signed annotated tags only (no `workflow_dispatch`, RELEASING.md). Every CI job is a required check on `main` (GitHub ruleset). Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **OD1 — the catalog source:** Gitea raw, `https://git.poli0981.dev/poli0981/OmniDeck/raw/branch/main/<path>`. It behaves like the old `raw.githubusercontent.com` URL (always `main`, no release needed); an R2 copy would need a job with R2 keys on every catalog change (rule 10). The app's privacy text names the new host.
|
||||
- **OD2 — licence gate:** a local check on every PR: `nuget-license` with an allow-list file, as HashTool does (`eng/allowed-licenses.json`).
|
||||
- **OD3 — signed-tag check:** `git tag -v` against the key at `https://git.poli0981.dev/poli0981.gpg`, as the ticktune pilot does. It needs the GPG key on the Gitea account (README, "Maintainer steps once").
|
||||
- D6. D7: attestations, Scorecard, dependency review and the GitHub SBOM go.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | build/test/package/lint on Ubuntu + Windows; upstream `upload-artifact` | Move; Gitea artifact action. Jobs keep their names (they become branch-protection checks, D6) |
|
||||
| `codeql.yml` | CodeQL C# (manual build on Windows) + actions, cron `23 4 * * 1` | **Delete** → `security.yml` caller: `dotnet: true`, `dotnet-runs-on: windows-latest`, `dotnet-solution: <name>.slnx`, cron **`23 14 * * 6`** |
|
||||
| `dependency-review.yml` | vulnerable deps + licence gate on PRs | **Delete** (D7); NuGetAudit + osv-scanner in `security.yml` cover vulnerabilities; OD2 for licences |
|
||||
| `scorecard.yml` | OpenSSF Scorecard, SARIF to code scanning, `id-token` | **Delete** (D7) |
|
||||
| `sonarcloud.yml` | SonarQube Cloud | **Delete** (D1) |
|
||||
| `notify.yml` | vendored `.github/scripts/discord_notify.py` (calls `api.github.com`); CI failures + manual release announcements | Callers of ops `notify-ci-failure.yml` (watch `CI`), `notify-release-pipeline.yml` (watch `Release`: the CI notifier skips names with "elease" on purpose) and `announce-release.yml` (`release: published` + `workflow_dispatch`), each with `ops_ref`. Delete the vendored script |
|
||||
| `release.yml` | signed-tag check via `gh api`; `vpk download/upload github`; SBOM from `dependency-graph/sbom`; checksums; `gh release edit`; attestations; Discord announce | Keep the tag rules. OD3 for the check. Velopack to R2 (`vpk download s3` / `vpk upload s3`, `VPK_PREFIX=omnideck/`, runbook §5.1). SBOM: generate it in the build (CycloneDX for .NET) and put it, with SHA256SUMS, under `omnideck/<version>/` via `publish-r2.yml` or `rclone` (versioned names). Gitea release (notes from CHANGELOG, links only, `prerelease` for < 1.0.0 as today) via `gitea-release-action`. **Drop** attestations and `id-token`. A release created by the job token fires no `release` event (README), so keep announcing from this workflow: add a job that calls `announce-release.yml` with `tag_override: ${{ github.ref_name }}` |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`. `.github/CODEOWNERS` → `.gitea/CODEOWNERS`: Gitea reads only `CODEOWNERS`, `docs/CODEOWNERS` and `.gitea/CODEOWNERS`, and treats a pattern without `*` as a regular expression.
|
||||
|
||||
## Code
|
||||
|
||||
- `src/OmniDeck.App/Updates/OdVelopackUpdateService.cs`: `GithubSource` → `https://releases.poli0981.dev/omnideck` (HTTP source), no GitHub token.
|
||||
- `OdCatalogService.cs`: OD1.
|
||||
- `Directory.Build.props` (`RepositoryUrl`), `README.md` (6), `CONTRIBUTING.md` (2), `.github/ISSUE_TEMPLATE/config.yml` (2), `SECURITY.md` (GitHub advisories → `security@poli0981.dev`, already documented). `docs/spikes/*` and `CHANGELOG.md` mention GitHub as history: leave them.
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `DISCORD_CI_WEBHOOK`, `DISCORD_RELEASE_WEBHOOK` (the ops `announce-release.yml` expects `DISCORD_RELEASES_WEBHOOK` / `DISCORD_REPO_WEBHOOK`: map the name in the caller). Create (user level): R2 keys + `R2_ACCOUNT_ID`; `DISCORD_RELEASE_PIPELINE_WEBHOOK` (or map an existing webhook in the caller). Drop `SONAR_TOKEN`; no `GH_TOKEN`.
|
||||
|
||||
## Hand-off extras
|
||||
|
||||
Installs that update from GitHub Releases cannot be redirected (runbook §7 item 5). Recreate the `main` ruleset as Gitea branch protection with the CI job names (D6).
|
||||
@@ -0,0 +1,40 @@
|
||||
# pipdock — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `fdc51a8`. Profile: Tauri 2 (no self-update) + Rust workspace + React/Vite (runbook §5.2, §5.5). Old remote `github` = `github.com/poli0981org/pipdock` (the org it moved to on 2026-11-21); Gitea: `poli0981/pipdock`. Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **D4:** call the ops repo for **security** and **notifications**, pinned by commit SHA; everything else stays local. RELEASE-CI.md §1's reason (no other account can change this CI) holds on Gitea: the ops repo has the same owner and a SHA pin cannot move. Say so in RELEASE-CI.md.
|
||||
- D2: the triage workflow goes. D7: attestations go.
|
||||
- **Qodana Rust:** in Docker on `windows-latest` (`within-docker: true`). If the image does not run under Docker Desktop on the PC (**VERIFY** on the first run), the Rust project leaves Qodana: clippy and cargo-deny stay.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci-node.yml` | lint/typecheck/test/build, `npm licences` job runs the triage script's tests | Move. Drop the triage tests with D2 |
|
||||
| `ci-rust.yml` | Linux + Windows (PEP 514 registry needs Windows) | Move. Windows job = host mode on the PC: check it creates no system-wide state |
|
||||
| `ci-integration.yml` | Windows, real pip/uv in disposable venvs; cron `17 3 * * *` + `17 4 * * 1`; upstream `upload-artifact` | Move; Gitea artifact action; crons → **`47 13 * * *`** and **`53 14 * * 2`**. Host mode: venvs go under the job's temp dir only |
|
||||
| `codeql.yml` | CodeQL Rust + actions + JS/TS | **Delete** → `security.yml` caller (`rust: true`, `node: true`, cron **`19 14 * * 4`**) |
|
||||
| `security-scan.yml` | daily `cargo audit` + `npm audit` of `main`, cron `41 5 * * *` | Keep (cheap, the repo's own gate) or drop in favour of `security.yml`'s osv-scanner + cargo-deny. If kept: cron → **`23 13 * * *`** |
|
||||
| `qodana.yml` | two jobs (Rust in Docker, TS native) via `qodana-action`, SARIF → code scanning | Two callers of `reusable-qodana.yml`: TS (`config: qodana-js.yaml`, `package-manager: npm`, token `QODANA_TOKEN_TS_JS`, `artifact-name: qodana-report-js`) and Rust (`config: qodana-rust.yaml`, `runs-on: windows-latest`, `within-docker: true`, token `QODANA_TOKEN_RUST`, `artifact-name: qodana-report-rust`). Delete the committed `.qodana/rust.sarif.json` if it is only a code-scanning upload |
|
||||
| `release.yml` | tag → NSIS .exe + .msi, SHA256SUMS.txt, attest, **draft** GitHub release (`softprops`) | Build on `windows-latest`, Gitea artifact actions; **drop attestation** (D7); publish with the ops `publish-r2.yml` (`app: pipdock`, `versioned-dir` holding `<version>/…` + `SHA256SUMS.txt`, no `feed-files`: PipDock does not update itself); draft **Gitea release** via `gitea-release-action` (`draft: true`, body = links to `https://releases.poli0981.dev/pipdock/<version>/…`). R2 secrets only in the tag job (rule 10) |
|
||||
| `notify.yml` | vendored `discord_notify.py` (calls `api.github.com`), `workflow_run` + `release` | D4 default: callers of ops `notify-ci-failure.yml` (watch `CI / Node`, `CI / Rust`, `CI / Integration`, `Security scan`), `notify-release-pipeline.yml` (watch `Release`; the CI notifier skips names with "elease") and `announce-release.yml`, each with `ops_ref`; delete `.github/scripts/discord_notify.py` |
|
||||
| `sonar.yml` | SonarQube Cloud | **Delete** (D1) |
|
||||
| `triage.yml` | `pull_request_target` + `github-script` + `.github/scripts/triage.cjs` | **Delete** with its script and tests (D2); keep the maintenance-mode text in CONTRIBUTING |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json` (runbook §3.5).
|
||||
|
||||
## Links and docs (tracked files that still say GitHub)
|
||||
|
||||
`README.md` (14), `.github/ISSUE_TEMPLATE/config.yml` (3), `CONTRIBUTING.md` (3), `package.json` (3: `repository`, `bugs`, `homepage`), `.github/SECURITY.md` (2), `ACCESSIBILITY.md` (2), `docs/AI-DISCLOSURE.md` (2), `docs/ROADMAP.md` (2), `Cargo.toml` (`repository`), `crates/pipdock-core/src/report.rs` (an in-app link: bug reports → GitLab issues). Leave `changelog/1.x.md` history alone. Update RELEASE-CI.md and CLAUDE.md ("Forge & CI").
|
||||
|
||||
`SECURITY.md` is only in `.github/`, where GitHub looked for it. Move it to the repo root, rewritten for e-mail-only reports (runbook §3.4).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep: `QODANA_TOKEN_RUST`, `QODANA_TOKEN_TS_JS`, `DISCORD_CI_WEBHOOK`, `DISCORD_RELEASES_WEBHOOK`, `DISCORD_REPO_WEBHOOK`. Create (user level, once): `R2_RELEASES_ACCESS_KEY_ID`, `R2_RELEASES_SECRET_ACCESS_KEY`, variable `R2_ACCOUNT_ID`; `DISCORD_RELEASE_PIPELINE_WEBHOOK` for the release notifier (or map an existing webhook to that name in the caller). Drop: `SONAR_TOKEN`.
|
||||
|
||||
## Hand-off extras
|
||||
|
||||
Existing installs do not update themselves, so nothing to redirect; README's download links move to `releases.poli0981.dev/pipdock/<version>/`. Branch protection for the old required checks (D6).
|
||||
@@ -0,0 +1,71 @@
|
||||
# poli0981-dev — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `2ef3045`. Profile: web (Astro, Cloudflare Workers) with an admin (admin.poli0981.dev), a widgets Worker and the `src/content` submodule (`poli0981/content`). Docs live in `poli0981.dev-docs/`; there is no CLAUDE.md. Shared decisions: [README](README.md).
|
||||
|
||||
This repo talks to GitHub from **its own code**, not only from CI. That part is product work: plan it before the session.
|
||||
|
||||
**Done 2026-11-24.** Merged as Gitea #1 (the migration, v2.4.0) and #3 (v2.4.1, the publish fix below); `main`
|
||||
deploys from the CI `deploy` job (`wrangler deploy`, then waits for `/api/health`), the admin saves and publishes
|
||||
through Gitea with the `poli0981-bot` token, bug reports are confidential issues on the GitLab mirror, the widget
|
||||
reads Gitea's public feed (it answers anonymously, PD3 verified). What the migration found:
|
||||
|
||||
- **`content` on Gitea was 16 commits behind** what the site pinned (98f7692): the import came from a stale clone.
|
||||
It was fast-forwarded from the site's submodule checkout before anything else. Compare `git ls-remote` with the
|
||||
pinned gitlink before trusting a submodule's forge copy.
|
||||
- **D5 as built:** `content-bump.yml` opens the PR and dispatches `ci.yml` through `scripts/content-publish.mjs`;
|
||||
CI's `publish` job merges with the job token and dispatches `ci.yml` on `main` to deploy (a job-token merge starts
|
||||
no workflow, so `merge_when_checks_succeed` would merge and never deploy). The PR body marker
|
||||
`<!-- publish: auto|review -->` stands in for the auto-merge flag Gitea's API lacks.
|
||||
- **A dispatched run writes no commit status** (Gitea 28.4: push and pull_request only), so the bump commit never got
|
||||
the required `CI / build (*)` and the first publish was refused (405). The `publish` job (`needs: build`,
|
||||
`if: always()`) now records build's result as `CI / build (workflow_dispatch)` itself, then merges (#3). Any
|
||||
repo whose bot PRs rely on a dispatched check (softharbor) needs the same step.
|
||||
- **Runner:** a server started with `&` in one step is gone in the next (start it and its tests in one step);
|
||||
`astro preview` on `localhost` listened on ::1 only while Node's fetch went to 127.0.0.1 (`--host 127.0.0.1`);
|
||||
`treosh/lighthouse-ci-action` cannot be unpacked on the runner (case-colliding paths on the Windows disk), so
|
||||
Lighthouse runs `npx --ignore-scripts @lhci/cli`; gitleaks needed a `.gitleaksignore` for four public
|
||||
identifiers (Access AUD, the Analytics site tag, the Sonar key, a forged test JWT).
|
||||
- PD2: reports still reach Discord (a degraded 202) while `GITLAB_ISSUES_TOKEN` is missing. Qodana stayed a local CLI
|
||||
job: the ops tag callers pin (v2026.11.1) has no `reusable-qodana.yml`.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **PD1 — the admin's "Publish" (D12):** `src/lib/admin/github.ts` moves to the Gitea API with a token of the bot user `poli0981-bot`, a collaborator with write access on `poli0981-dev` and `content` only (a Worker secret of the admin, never an Actions secret). Dispatching `content-bump.yml` uses `POST …/actions/workflows/content-bump.yml/dispatches` with that token (**VERIFY** that a collaborator's token may dispatch).
|
||||
- **PD2 — the public bug report (D14):** issues on the GitLab mirror through the GitLab API.
|
||||
- **PD3 — the widgets feed:** `GET /api/v1/users/poli0981/activities/feeds` on Gitea, without a token. **VERIFY** that it answers anonymously and lists pushes and releases; if it does not, the widget goes.
|
||||
- D3 (deploy job with `wrangler deploy`), D5 (content-bump's PR merges itself with `merge_when_checks_succeed`), D2 (triage goes), D6 (`build` is the required check).
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | `build` (required), Sonar, upstream artifact actions, wrangler | Move; Gitea artifact actions; remove Sonar (D1); deploy job on `main` with `wrangler deploy` (D3) |
|
||||
| `content-bump.yml` | dispatched by the admin: bump `src/content`, push `content/bump`, `gh pr create`, `gh pr merge --auto --squash` (or comment and wait when MDX changed), `gh workflow run ci.yml` | Gitea API (README table): create PR, merge with `{do:"squash", merge_when_checks_succeed:true}`, comment, dispatch `ci.yml`. `permissions: contents: write, pull-requests: write, actions: write`. PD1 for the caller |
|
||||
| `lighthouse.yml` | advisory perf budget on PRs | Move |
|
||||
| `osv-scanner.yml` | Google's osv-scanner reusable, SARIF, cron `17 3 * * 1` | **Delete** → `security.yml` caller (`node: true`), cron **`13 14 * * 3`** |
|
||||
| `qodana.yml` | `qodana-action`, SARIF to code scanning | Caller of `reusable-qodana.yml` (`package-manager: npm`, `prepare-command: npx astro sync` if needed) |
|
||||
| `triage.yml` | `pull_request_target` + `scripts/triage.mjs` | **Delete** with the script (D2) |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`.
|
||||
|
||||
## Code, submodule, links
|
||||
|
||||
- `.gitmodules`: `src/content` → `https://git.poli0981.dev/poli0981/content.git` (that repo must be on Gitea; there is a local `E:\content`).
|
||||
- `src/lib/admin/github.ts` (PD1), `src/pages/api/report.ts` (PD2), `workers/widgets/src/feeds.ts` (PD3), `src/components/admin/Dashboard.svelte` (link), and their tests: `tests/api-public.test.ts` (5), `tests/widgets-worker.test.ts` (2), `tests/support/github.ts`.
|
||||
- `README.md` (6), `CONTRIBUTING.md` (4), `.github/ISSUE_TEMPLATE/config.yml` (2), `.github/pull_request_template.md` (2), `ACCESSIBILITY.md` (2), `public/.well-known/security.txt`, `poli0981.dev-docs/02_ARCHITECTURE.md`, `06_SECURITY.md`, `11_WIDGETS_INTEGRATIONS.md`, `12_LEGAL/CONTENT_LICENSE.md`. `CHANGELOG.md` keeps its history.
|
||||
- `src/lib/links.ts` (the GitHub profile link → `https://git.poli0981.dev/poli0981`) and the console note in `src/lib/easter.ts`.
|
||||
- Add a short "Forge & CI" section to the docs (runbook §3.4); a CLAUDE.md would be the place if you add one.
|
||||
|
||||
## The `content` submodule (`poli0981/content`, `E:\content`)
|
||||
|
||||
Checked 2026-11-23 at `main` @ `9265c94`: already on Gitea (`origin`), no workflows, no secrets, no code. Migrate it in the same session as `poli0981-dev`:
|
||||
|
||||
- `README.md`: the link to `poli0981/poli0981-dev` → Gitea.
|
||||
- `projects/poli0981-dev.md`, `projects/frameledger.md`: `repo:` → `https://git.poli0981.dev/poli0981/<repo>` (the schema is `z.url()`, any host passes).
|
||||
- `legal/licenses.md` (the EN and the VI paragraph): source on Gitea, issues on the GitLab mirror. A link edit, not a material change, so no consent bump (the ticktune precedent).
|
||||
- No `renovate.json` and no security caller: nothing to scan. The GitLab mirror and branch protection apply as for any repo.
|
||||
- The content commit lands first; `poli0981-dev`'s `.gitmodules` change and the submodule bump follow in its PR.
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `QODANA_TOKEN`. Create (user level): `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` (D3). Drop `SONAR_TOKEN`. Outside Actions, as Worker secrets: the `poli0981-bot` token (PD1, D12) and the GitLab token of the report endpoint (PD2, D14).
|
||||
@@ -0,0 +1,30 @@
|
||||
# QuoteAtlas — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `826842f` (local clone `E:\qoute`). Profile: one React/Vite SPA shipped as a static web app on Cloudflare (PWA), Tauri 2 desktop (NSIS, DMG, AppImage, deb, rpm; no updater) and an Android APK with an optional update check (runbook §5.2, §5.3). Shared decisions: [README](README.md).
|
||||
|
||||
**This repo is not on Gitea yet.** Its `origin` is still `https://github.com/poli0981/QuoteAtlas.git` and there is no `github` remote, so `push-to-gitea.ps1` has not handled it. The working tree has three uncommitted changes (`docs/15_ROADMAP.md`, `src/features/clock/calendars/fixtures/amlich-vectors.json`, `wrangler.jsonc`; −2376 lines in total): commit or park them first.
|
||||
|
||||
## Before the migration session
|
||||
|
||||
1. Settle the three local changes.
|
||||
2. `.\push-to-gitea.ps1 -Root E:\qoute -DryRun`, then without `-DryRun`: it renames `origin` → `github`, creates `poli0981/QuoteAtlas` on Gitea with Actions off, and pushes every branch and tag (there are many `claude/*` branches; prune the merged ones first if you do not want them on Gitea).
|
||||
3. Decided (2026-11-23):
|
||||
- **D8 — the Android update check:** a `latest.json` on `releases.poli0981.dev/quoteatlas/` (cache-bypassed `*.json`); the new host goes into `network_security_config.xml`, the CSP in `tauri.conf.json` and `legal/PRIVACY.md` (EN + VI), and `api.github.com` comes out of all three.
|
||||
- D3: the web app deploys with `wrangler deploy` from Gitea CI (CLAUDE.md's "Cloudflare Pages" changes with it). D9: no DMG. D10: the Android SDK is installed in the job.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | build/test on PRs and pushes, upstream `upload-artifact` | Move; Gitea artifact action; add the deploy job on `main` (D3) |
|
||||
| `release.yml` | `v*` tags: desktop matrix incl. macOS + Android (JDK 21), `softprops/action-gh-release`, upstream artifact actions | Desktop on `windows-latest` + Linux bundles on `ubuntu-latest`, no DMG (D9); Android per D10; everything + `SHA256SUMS` to R2 with `publish-r2.yml` (`app: quoteatlas`, `<version>/…`, `latest.json` as the feed for D8); Gitea release with links (`gitea-release-action`). Keystore secrets only in this tag job (rule 10) |
|
||||
|
||||
There is no security, Qodana, Renovate or notification workflow yet. Add callers of the ops `security.yml` (`node: true`, `rust: true`, cron **`33 15 * * 0`**), `notify-ci-failure.yml` and `notify-release-pipeline.yml`, and `renovate.json`. Qodana only if you create a Qodana Cloud project for it.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`src/features/bug-report/report.ts` (+ `report.test.ts`) and `src/features/legal/Gate.tsx` link to GitHub (bug reports → GitLab issues), `README.md`, `docs/13_RELEASE_PUBLISHING.md` (2), `docs/03_DATA_FLOW.md`, `docs/09_SECURITY_PRIVACY.md`, `docs/11_TESTING.md`, `docs/14_LEGAL_GATE.md`, `legal/PRIVACY.md`, CLAUDE.md. `SECURITY.md`: GitHub advisories → e-mail (no `@poli0981.dev` address documented: use `security@poli0981.dev`). Add CONTRIBUTING.md with the Gitea / GitLab / e-mail paths (runbook §3.4).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `ANDROID_KEYSTORE_B64`, `ANDROID_KEYSTORE_PASSWORD`, `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD` (set them on the new Gitea repo). Create (user level): R2 keys + `R2_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` (D3), and the Discord webhooks for the notifiers.
|
||||
@@ -0,0 +1,98 @@
|
||||
# RepoLens — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `ed91e72` (local clone `E:\repo`, Gitea `poli0981/repolens`). Profile: SvelteKit 3 on one Cloudflare Worker (`repolens.poli0981.dev`), a showcase of the maintainer's repositories read from the GitHub API, with a Cron Trigger (`*/10 * * * *`) that warms the cache. Maintenance mode since v1.5.0. Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-26.** The migration merged as Gitea #2 (fast-forward to `35b5926`, 9 commits: CI, Renovate, RL1–RL4,
|
||||
templates, docs), the CI `deploy` job put it live (version `475c73d8`, custom domain and the `*/10` cron applied),
|
||||
and **v1.6.0** followed with the dependency refresh (Gitea #3, #4). The site reads Gitea again: 24 public repos, the
|
||||
production smoke 7/7. Renovate's onboarding PR #1 was closed (#2 adds `renovate.json`). What the move found:
|
||||
|
||||
- **The repository went private on Gitea** (the owner's choice: `LICENSE` carries an internal relicensing note that
|
||||
must not be public). Outside contributions arrive by e-mail. Renovate and the runner keep working (`renovate-bot`
|
||||
is a collaborator). **Its GitLab push mirror** (added 2026-11-27, also where the confidential bug reports land) was
|
||||
created **public**, which exposed the private source and that note; it was switched to private the same day. For a
|
||||
private Gitea repo, check the mirror's visibility right after creating it.
|
||||
- **Anonymous reads (D13) settled the VERIFY items:** `GET /repos/{o}/{r}/licenses` answers (the list and repo objects
|
||||
carry `licenses` too, which can include `README`); `GET …/actions/runs` answers 401 without a token, so the build
|
||||
badge reads the head commit's statuses (`GET …/commits/{sha}/status`, anonymous, one per job, latest per context,
|
||||
`target_url` relative). `GET …/actions/tasks` is anonymous as well.
|
||||
- **No ETag, no rate-limit headers** (`Cache-Control: max-age=0, private` on every answer). RepoLens keeps each
|
||||
sub-resource with a validator instead: the repo's `updated_at` (any push moves it, Renovate's branches included)
|
||||
or the head sha. A quiet list refresh is one request; a cold one 1 + 4 per repo.
|
||||
- **No `pushed_at`:** the default branch's head commit time is the last push. Times carry the committer's offset
|
||||
(`+07:00`): normalise to UTC before comparing ISO strings. Stars and forks are always 0 without registration (hidden),
|
||||
and there are no deployments or language colours.
|
||||
- **Webhook (RL3):** Gitea signs with `X-Gitea-Signature` (hex HMAC-SHA256, no prefix) and also sends GitHub-style
|
||||
headers (read from `services/webhook/deliver.go`). The system webhook form (Site Administration → Integrations →
|
||||
Webhooks → System Webhooks) names the events Create, Delete, Push, Repository, Release, **Statuses** and
|
||||
**Workflow Run**. Gitea sends no ping, rename, transfer or visibility events.
|
||||
- **Bug reports (RL2, D14):** `GITLAB_TOKEN_ISSUES` is optional on purpose: without it the endpoint answers 503 and the
|
||||
dialog offers `code@` (no deploy waits on a GitLab token). The token set on 2026-11-26 has the **Guest** role: GitLab
|
||||
files a Guest's confidential issue but silently drops its labels, so Reporter is the role to pick. It **expires
|
||||
2027-11-26** (RepoLens docs/11 §H).
|
||||
- **System webhook (live 2026-11-27, admin hook #1):** system hooks have no Test Delivery button, so the first real
|
||||
events checked it (`npx wrangler tail repolens --format json --search webhook`): a push and two commit statuses of
|
||||
free-games-itchio-list answered `202`, refreshed the list and the detail in ~2.5 s with 13 requests, and the burst's
|
||||
later deliveries rode along.
|
||||
- **e2e in the job container:** binding `wrangler dev` and Playwright to `127.0.0.1` (runbook §6) was enough; chromium
|
||||
and webkit both ran. One PR's CI took ~10 minutes on the single runner (verify 55 s, e2e 2 min 44 s, Qodana
|
||||
2 min 48 s).
|
||||
- **Merging in the UI:** "Fast-forward only" keeps the signed commits; a UI merge commit is unsigned. Until #2 merged,
|
||||
`main`'s GitHub-era `maintenance-triage.yml` still ran on the PR (`pull_request_target` reads the base branch).
|
||||
- **Branch protection (D6):** no push, no force push; required `CI / verify (*)`, `CI / e2e (*)`,
|
||||
`Security / npm-audit (*)`, `Reusable / Security / Secrets (gitleaks) (*)`,
|
||||
`Reusable / Security / Dependencies (osv-scanner) (*)`.
|
||||
- **adapter-cloudflare 9** builds through `@cloudflare/vite-plugin` and refuses a `main` in `wrangler.jsonc`: RepoLens's
|
||||
`withScheduled` cron entry needs a redesign before it can move (left on 8.0.3). Other SvelteKit Workers with a
|
||||
Cron Trigger will meet the same wall.
|
||||
- **On the PC:** GPG signing failed with "sending fd … to keyboxd" until `gpgconf --kill keyboxd` of **Gpg4win** (git's
|
||||
`gpg.program`), not Git Bash's `gpgconf`.
|
||||
- **Done by the maintainer by 2026-11-27:** the GitLab project + `GITLAB_TOKEN_ISSUES`, the system webhook +
|
||||
`GITEA_WEBHOOK_SECRET`, the dead `GITHUB_*` Worker secrets deleted. **Still open:** disconnecting Workers Builds,
|
||||
Qodana Cloud's VCS URL, and every repo's description/website/topics on Gitea (all empty after the import; RepoLens
|
||||
shows them once set).
|
||||
|
||||
**Before the move:** the site had no data source. Every repo it showed came from GitHub's GraphQL API with `GITHUB_TOKEN_READ`, a token of the suspended account; bug reports opened GitHub issues with `GITHUB_TOKEN_ISSUES`; the webhook was GitHub's. Restoring it is a website incident, which maintenance mode takes.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **RL1 — the data source moves to the Gitea REST API, without a token (D13).** `src/lib/server/github.ts` keeps its normalised shapes and changes what fills them:
|
||||
|
||||
| Today (GraphQL / REST on github.com) | Gitea |
|
||||
|---|---|
|
||||
| repository list | `GET /users/poli0981/repos` (paged, `limit` ≤ 50) |
|
||||
| stars, forks, homepage, pushed, open issues and PRs, default branch, visibility | `GET /repos/{owner}/{repo}` (`stars_count`, `forks_count`, `website`, `updated_at`, `open_issues_count`, `open_pr_counter`, `default_branch`, `private`) |
|
||||
| topics, languages | `/topics`, `/languages` |
|
||||
| commits, tags, releases | `/commits?sha=<default>&limit=…`, `/tags`, `/releases` |
|
||||
| licence | `/licenses` (**VERIFY** on 28.4.0), else the `LICENSE` file's first line |
|
||||
| the newest push's Actions runs | `/actions/runs` (**VERIFY**, README `gh` table) |
|
||||
| deployments | none on Gitea: the deploy line goes |
|
||||
|
||||
Stars and forks read 0 on an instance without registration: hide the two counters rather than show zeros. Fixtures in `tests/fixtures/gh/` are replaced with recorded Gitea answers; the unit tests keep faking `ghFetch` (rename it if the session likes). `src/params.ts`' guard against odd repo names stays. The cache, the warm cron and the rate limits stay as they are; Gitea has no GraphQL points, so docs/05's points budget becomes a request budget.
|
||||
- **RL2 — bug reports go to GitLab (D14).** `src/lib/server/issues.ts` creates the issue on `gitlab.com/poli0981/repolens` (preview hosts stay a dry run). `GITHUB_TOKEN_ISSUES` → `GITLAB_TOKEN_ISSUES`.
|
||||
- **RL3 — the webhook.** Gitea sends `X-Gitea-Event` and `X-Gitea-Signature` (hex HMAC-SHA256 of the body, **VERIFY** on 28.4.0). One **system webhook** (Site Administration → Webhooks) covers every repo instead of one per repo; `webhook.ts` verifies the new header and maps Gitea's `push` / `release` / `repository` events onto the same eviction plans. `GITHUB_WEBHOOK_SECRET` → `GITEA_WEBHOOK_SECRET` (still opt-in, still outside `secrets.required`).
|
||||
- **RL4 — legal.** The privacy text changes where report data goes (GitLab instead of GitHub) and where repo data comes from: a material change. Edit `legal/*.md` in ONE commit, run `npm run build:legal`, bump `LEGAL_VERSION`.
|
||||
- **Order:** the CI move first, then RL1–RL4 as their own commits on the same branch; the first deploy (D3) ships them together.
|
||||
- D2 (`maintenance-triage.yml` goes), D3 (deploy job with `wrangler deploy`: Cron Triggers apply only on `wrangler deploy`, never on `versions upload`), D6 (`.github/rulesets/main.json` goes; branch protection names the new check names), D7.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Do |
|
||||
|---|---|
|
||||
| `ci.yml` (`verify`, Sonar, e2e with a GitHub read token, upstream artifact actions) | Move; Gitea artifact actions; remove Sonar (D1); the e2e run needs no GitHub token after RL1. Add the deploy job on `main` (D3) |
|
||||
| `e2e.yml` (production smoke, `0 4 * * *`) | Move; cron → **`11 13 * * *`** |
|
||||
| `security.yml` (osv-scanner, npm-audit, gitleaks, Snyk; `0 6 * * 1`) | osv-scanner and gitleaks → the ops `security.yml` caller (`node: true`), cron **`33 14 * * 2`**; `npm-audit` and Snyk stay local, Snyk pinned by SHA |
|
||||
| `qodana.yml` | Caller of `reusable-qodana.yml` (`package-manager: npm`) |
|
||||
| `codeql.yml` (dispatch-only caller of `reusable-codeql.yml@main`) | **Delete** |
|
||||
| `dependabot-automerge.yml` | **Delete**: Renovate's automerge rules live in `renovate-config` |
|
||||
| `maintenance-triage.yml` | **Delete** (D2) |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json` (the `typescript` 6 / `@typescript/native` 7 pair stays manual, as CLAUDE.md says).
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md` (8), `MAINTAINERS.md`, `CONTRIBUTING.md`, `ACCESSIBILITY.md` (+ `legal/ACCESSIBILITY.md`), `legal/THIRD_PARTY_NOTICES.md`, `src/lib/legal/content.ts` (generated: edit `legal/*.md`), `.github/ISSUE_TEMPLATE/config.yml`, docs/02, 05, 10 and 11, `.dev.vars.example`, `wrangler.jsonc` (`secrets.required`), CLAUDE.md (data source, landmines, deploys), and the UI copy that says "GitHub" (EN and VI). `CHANGELOG.md` is history.
|
||||
|
||||
## Secrets
|
||||
|
||||
Actions: keep `QODANA_TOKEN`, `SNYK_TOKEN`. Create (user level): `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID`. Drop `SONAR_TOKEN` and the explicit `GITHUB_TOKEN`. Worker: remove `GITHUB_TOKEN_READ`; `GITHUB_TOKEN_ISSUES` → `GITLAB_TOKEN_ISSUES` (D14); `GITHUB_WEBHOOK_SECRET` → `GITEA_WEBHOOK_SECRET`.
|
||||
@@ -0,0 +1,64 @@
|
||||
# softharbor — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `289ab47`. Profile: web (Astro, Cloudflare Workers) with data bots that open issues and pull requests (runbook §5.3). Its docs/12 describes the CI; `ci.yml` is self-contained on purpose (the old reusable broke every run). Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-24.** Merged as Gitea #1 (the migration), #2 (dependency upkeep) and #3 (catalogue batch 4);
|
||||
released as **v1.5.0**, deployed by the CI `deploy` job and announced through the ops `announce-release.yml`
|
||||
(pinned at the new ops tag **v2026.11.2**, `8e6582a`, which carries `ops_ref` and `reusable-qodana.yml`). The site's
|
||||
footer, Contact, legal pages, `security.txt` and the `/api/apps.json` attribution name Gitea; "Report a bug" opens a
|
||||
prefilled issue on the GitLab mirror (no forms there: one Markdown description; gitlab.com took an 8000-character
|
||||
URL and refused 12000 with 400), which changed the Privacy Policy (LEGAL_VERSION 2026-11-24). Its decision log
|
||||
entry is D38. What the migration found:
|
||||
|
||||
- **The import carried code and tags only.** Issues, PRs, releases and Discussions stayed on GitHub; the repo had
|
||||
just the labels `dependencies` and `security`. The bots skip a missing label with a notice (Gitea's API attaches
|
||||
labels by id and creates none), so `quarantine` and `link-rot` must be created by hand.
|
||||
- **The bots** (`quarantine.yml`, `vt-recheck.yml`, `link-check.yml`) go through one tested script,
|
||||
`scripts/gitea.mjs` (PRs, dispatches, issues, statuses); the push uses the job token in an `AUTHORIZATION: basic`
|
||||
extra header for that one command only. `ci.yml`'s `record` job writes `CI / build|gates (workflow_dispatch)`
|
||||
statuses — the poli0981-dev lesson, applied up front. vt-recheck previews print the `security` diff in the log, so
|
||||
a data PR's evidence is read without downloading an artifact.
|
||||
- **gitleaks** flagged the SonarQube project key in `sonar-project.properties`' history (generic-api-key), and then
|
||||
the `.gitleaksignore` comment that quoted it: describe a finding in words, never quote it.
|
||||
- **Qodana** (ops reusable, CLI 2026.3.1) caught "Exception used for local control-flow" in the new script on the
|
||||
first run; deterministic after that.
|
||||
- **osv-scanner 2.7** warns that `ignoreUntil` is deprecated (`effectiveUntil`), and reported the deepmerge skip
|
||||
unused: GHSA-gcqx-w48m-w2h4 was **withdrawn** on 2026-11-16.
|
||||
- **The runner takes one job at a time, first come first served.** A `main` deploy waited behind two PRs' queued
|
||||
jobs (14 in the queue); cancelling a PR's superseded runs moved it up. Expect ~25 minutes from a merge to
|
||||
production when PRs are open.
|
||||
- **Merging in the UI:** the repository's default merge style is "merge"; pick "Create squash commit" from the
|
||||
menu. Gitea has no signing key ("There is no key available to sign this commit"), so squash commits on `main`
|
||||
are unsigned — branch protection must not require signatures (the bots cannot sign either).
|
||||
- Handy: job logs of a public repo are readable anonymously at `/{owner}/{repo}/actions/runs/{run}/jobs/{job}/logs`,
|
||||
and `GET /repos/{owner}/{repo}/commits/{sha}/status` answers without a token — enough to watch CI from a shell.
|
||||
- knip 6.48's lefthook plugin calls `lefthook` unused where `.git/hooks` is missing (a git worktree) unless `CI`
|
||||
is set.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **D3 — deploys:** a deploy job with `wrangler deploy` from Gitea CI on `main`.
|
||||
- **D5 — bot PRs:** `quarantine.yml` and `vt-recheck.yml` keep opening ONE pull request with the job token, then dispatch `ci.yml` and the security caller on its branch through the Gitea API (README, `gh` table), as they did with `gh workflow run`.
|
||||
- D6: branch protection on `main` with the checks the ruleset required.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | gates + build, Sonar (`SONAR_TOKEN`), upstream `upload-artifact`, job token use | Move; Gitea artifact action; remove Sonar (D1); add the deploy job on `main` pushes (D3), with Cloudflare secrets only in that job |
|
||||
| `codeql.yml` | caller of `reusable-codeql.yml@main` (that path is gone: the ops repo's workflows now live in `.gitea/workflows`), cron `31 3 * * 1` | **Delete** → `security.yml` caller (`node: true`), cron **`37 15 * * 2`**. Bots that dispatched `codeql.yml` dispatch the security workflow instead |
|
||||
| `link-check.yml` | weekly sweep, ONE tracking issue refreshed or closed with `gh issue …`, cron `43 4 * * 1` | Cron → **`43 14 * * 1`**. `gh issue edit/comment/create/close` → Gitea API (README table), `permissions: issues: write` |
|
||||
| `notify.yml` | caller of `announce-release.yml@main` | `.gitea/workflows/announce-release.yml@<ops-sha>` with `ops_ref`, explicit secrets |
|
||||
| `qodana.yml` | `qodana-action`, SARIF to code scanning | Caller of `reusable-qodana.yml` (`package-manager` as in the repo, `prepare-command: <pm> exec astro sync` if `qodana.yaml` needs Astro's types); no schedule today, keep it so |
|
||||
| `quarantine.yml` | on data pushes + nightly `17 2 * * *`; opens a PR, `gh workflow run ci.yml / codeql.yml`, `gh issue create` | Cron → **`17 13 * * *`**. Branch + PR + dispatch + issue through the Gitea API (README table), `permissions: contents: write, pull-requests: write, issues: write, actions: write` on that job only |
|
||||
| `vt-recheck.yml` | daily `41 0 * * *`, `VT_API_KEY`, ONE PR `vt/recheck`, `gh workflow run`, `gh issue create`, upstream `upload-artifact` | Cron → **`59 13 * * *`**; same Gitea API port as quarantine; Gitea artifact action. Check VirusTotal's daily quota still fits one run at that hour |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`. `.github/CODEOWNERS` → `.gitea/CODEOWNERS` (Gitea reads only the root, `docs/` and `.gitea/`; a pattern without `*` is a regular expression).
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md` (13), `.github/ISSUE_TEMPLATE/` (`config.yml` 3, `listing_change.yml`, `accessibility.yml`), `ACCESSIBILITY.md` (2), `docs/09_SECURITY_PRIVACY.md` (2), **`public/.well-known/security.txt`** (2: keep `Contact: mailto:security@…`, policy URL → Gitea), the in-app links in `src/components/legal/Accessibility.astro` and the bug-report island with its test `ShBugReport.test.ts` (issues → GitLab), `LICENSE-DATA.md`, `CONTRIBUTING.md`, `docs/03_DATA_FLOW.md`, `docs/05_ALGORITHMS.md`, CLAUDE.md (deploy path). The `github.io` hits in `src/data/apps/*.json` are third-party apps' homepages: data, leave them. `CHANGELOG.md` keeps its history. `SECURITY.md`: GitHub advisories → e-mail (`security@` is already documented).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep: `VT_API_KEY`, `QODANA_TOKEN`, `DISCORD_RELEASES_WEBHOOK`. Create (user level): `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` (D3). Drop: `SONAR_TOKEN`.
|
||||
@@ -0,0 +1,27 @@
|
||||
# ticktune — finish the pilot
|
||||
|
||||
> Written 2026-11-23 against `chore/gitea-migration` @ `f64f8d2` (20 commits ahead of `main`). Profile: web (Astro, Cloudflare Workers). Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-23.** Merged as Gitea #1 (28 commits, Sonar removed per D1) and #2 (the v2.3.0 results); v2.3.1 was
|
||||
the first release deployed by Gitea Actions from a signed tag. Pilot findings now in the repo's `docs/14 §1`: jobs run as
|
||||
root (Lighthouse's Chrome needs `--no-sandbox`), artifact uploads are `continue-on-error` (the route to the server
|
||||
flakes), gitleaks needed a `.gitleaksignore` for public identifiers. Still to verify: the Renovate skips (first
|
||||
Renovate PR).
|
||||
|
||||
The pilot did the migration (runbook §3.2–§3.5): workflows in `.gitea/workflows`, Renovate, the ops `security.yml` caller, the Qodana CLI, Gitea artifact actions, schedules in the window, Gitea + GitLab links, GitLab templates, docs and CLAUDE.md. The GitHub mentions left are deliberate history ("the project moved from GitHub…", the old `github.com/poli0981.gpg` keyring). What is left:
|
||||
|
||||
## Agent (on the same branch)
|
||||
|
||||
1. **SonarQube Cloud goes (D1, decided 2026-11-23).** `ci.yml` still has the `sonar` job (`SonarSource/sonarqube-scan-action`, `SONAR_TOKEN`). Delete the job, `sonar-project.properties`, the coverage hand-off that only feeds it (keep the LCOV if another job reads it), and the Sonar text in `docs/14-CI-CD.md` and `qodana.yaml`'s comments. Say in docs/14 what covers it now (Qodana for the TypeScript, Opengrep via `security.yml`).
|
||||
2. **Ops pin.** `security.yml` calls the ops repo at `2a255e0` (`v2026.11.1`). `security.yml` itself did not change in the next ops release, so this is optional; bump it with the rest when the ops repo is tagged again.
|
||||
3. Optional, for one Qodana setup across repos: `qodana.yml` can become a caller of the ops `reusable-qodana.yml` (`package-manager: pnpm`, `node-version-file: .nvmrc`, `prepare-command: pnpm exec astro sync`, cron `13 15 * * 1`). The pilot's own file does the same thing; only switch if you want the shared one.
|
||||
|
||||
## Maintainer
|
||||
|
||||
1. Review and merge `chore/gitea-migration` (runbook §3.8).
|
||||
2. Secrets: `QODANA_TOKEN` (repo), `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` (user level). Delete `SONAR_TOKEN`.
|
||||
3. Repo settings → enable Actions. Branch protection on `main` with the checks `ci` requires (D6).
|
||||
4. Cloudflare: disconnect Workers Builds from GitHub (docs/10-CLOUDFLARE-SETUP.md); `deploy.yml` deploys now (D3).
|
||||
5. `maintainer/gitea-repo-setup.ps1 -Only ticktune` (renovate-bot + labels), Qodana Cloud VCS URL, GitLab mirror (`setup-mirrors.ps1 -Only ticktune`).
|
||||
6. Watch the first runs and close the pilot's **VERIFY** items: artifact actions, Qodana CLI native mode, `deploy.yml` (tag keys, Gitea release), the three schedules (14:37 Mon, 15:13 Mon, 15:29 Wed).
|
||||
7. Tick ticktune in the runbook tracker (§8).
|
||||
@@ -0,0 +1,28 @@
|
||||
# tilepier — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `d1c9973`. Profile: web (SvelteKit, Cloudflare Workers) with Playwright e2e (runbook §5.3). Its doc 21 describes the CI. Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- D3: a deploy job with `wrangler deploy` from Gitea CI (docs/internal/02-TECH-STACK.md changes with it). D6: branch protection on `main`.
|
||||
- **TP1 — contacts:** the runbook defaults, `code@poli0981.dev` and `security@poli0981.dev`.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | lint, dead code, tests, build, bundle budgets, secret gate, Sonar; upstream artifact actions; 6 unpinned `@vN` | Move; pin; Gitea artifact actions; remove Sonar (D1); deploy job on `main` with `wrangler deploy` (D3) |
|
||||
| `codeql.yml` | caller of `reusable-codeql.yml@main` (that path is gone: the ops repo's workflows now live in `.gitea/workflows`), cron `17 3 * * 1` | **Delete** → `security.yml` caller (`node: true`), cron **`7 15 * * 4`** |
|
||||
| `e2e.yml` | Playwright on PRs, pushes and daily `41 2 * * *`; upstream `upload-artifact`; 3 unpinned | Cron → **`29 14 * * *`**; pin; Gitea artifact action. Browsers install inside the Docker job (`npx playwright install --with-deps`) |
|
||||
| `notify.yml` | caller of `announce-release.yml@c3e118a…` (old `.github/workflows` path) | `.gitea/workflows/announce-release.yml@<ops-sha>` with `ops_ref`; explicit secrets |
|
||||
| `release.yml` | tag → **draft** GitHub release with the CHANGELOG section (`gh release create --draft --verify-tag`); 2 unpinned | `gitea-release-action` with `draft: true` and `body_path` (the CHANGELOG section); pin. The draft-then-publish-by-hand flow stays: a release published by you fires `release: published`, so `notify.yml` still announces it |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`. No Qodana today; add a `reusable-qodana.yml` caller only if you want it (needs a Qodana Cloud project + `qodana.yaml`).
|
||||
|
||||
## Links and docs
|
||||
|
||||
In the app: `src/routes/about/+page.svelte` (3), `src/lib/core/bug-report.ts` (bug reports → GitLab issues), `static/.well-known/security.txt` (2) with its test `src/lib/security-txt.test.ts` (2), `src/lib/release.test.ts`, `e2e/legal-gate.e2e.ts`. Docs: `.github/ISSUE_TEMPLATE/config.yml` (2), `ACCESSIBILITY.md` (2), `CONTRIBUTING.md`, `SECURITY.md` (GitHub advisories → e-mail, TP1), `docs/internal/18-BUG-REPORTING.md`, `src/lib/widgets/quote/data/DATA-LICENSE.md`, CLAUDE.md. `CHANGELOG.md` keeps its history; the `github.io` hit in `licenses.generated.json` is third-party.
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `DISCORD_RELEASES_WEBHOOK`. Create (user level): `CLOUDFLARE_API_TOKEN`, `CLOUDFLARE_ACCOUNT_ID` (D3). Drop `SONAR_TOKEN`.
|
||||
@@ -0,0 +1,32 @@
|
||||
# WardSweep — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `42946e0` (local clone `E:\wardsweep`, Gitea `poli0981/wardsweep`). Profile: Rust broker + CLI, C#/WPF UI, Velopack installer + portable zip (runbook §5.1). Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **WS1 — CI stays in this repo, all of it.** docs/14-DISTRIBUTION-TRUST.md rests on public, inspectable CI ("a pipeline that lives in another repository cannot be read from here"), so WardSweep is the exception to D4: no ops callers. CodeQL's replacement is a local `security.yml` that runs the same tools as the ops one (gitleaks over the history, Opengrep for C# and Rust), copying its pinned versions and SHA-256 checks.
|
||||
- **WS2 — trust without attestations (D7).** docs/14 keeps its trust story with what remains: public Gitea Actions logs, the SHA-256 of every artefact in the release notes, the rebuild instructions, and the manual VirusTotal step. The attestation paragraph goes.
|
||||
- **Host mode:** the Windows legs (`rust-ci`, `dotnet-ci`, `release`) run on your PC. `core/tests/win_machine.rs` reads the machine (read-only, the deny-list and `no_destructive_code.rs` hold that); its `#[ignore]`d test stays ignored: CI never passes `--ignored` or `--include-ignored`. No job runs the broker without dry-run.
|
||||
- D6: branch protection on `main` with the CI checks.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `rust-ci.yml` | fmt/clippy/test, `--locked`, `ubuntu-latest` + `windows-latest`, upstream `upload-artifact` | Move; Gitea artifact action |
|
||||
| `dotnet-ci.yml` | build/test on `windows-latest` | Move |
|
||||
| `catalog-verify.yml` | catalog integrity gate | Move |
|
||||
| `audit.yml` | cargo-deny / NuGet audit, cron `0 4 * * 1` | Move; cron → **`27 14 * * 1`** |
|
||||
| `codeql.yml` | C# and Rust on `windows-latest`, cron `0 3 * * 1` | **Delete** → local `security.yml` (WS1), cron **`3 15 * * 4`** |
|
||||
| `sonarcloud.yml` | SonarScanner for .NET, Rust through `sonar.text.inclusions` | **Delete** (D1), with `sonar-project.properties` and `dotnet-sonarscanner` in `.config/dotnet-tools.json` (vpk stays) |
|
||||
| `release.yml` | `v*.*.*` tags: `vpk pack` (`--packId WardSweep`), portable zip, observe-harness zip, SHA-256 block, `attest-build-provenance`, `softprops/action-gh-release` | `vpk download s3` → `vpk pack` → `vpk upload s3` with `VPK_PREFIX=wardsweep/` (a feed for any later updater); the zips + `SHA256SUMS` to `wardsweep/<version>/` with `publish-r2.yml`; a **draft** Gitea release whose notes keep the verification block, with links. Attestations go (WS2). R2 keys only in this job (rule 10) |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json` (cargo + NuGet + the dotnet tools in `.config/dotnet-tools.json`; `rust-toolchain.toml` too).
|
||||
|
||||
## Links and docs
|
||||
|
||||
`.github/ISSUE_TEMPLATE/config.yml` (3), `Cargo.toml` (`repository`), `Directory.Build.props`, `README.md`, `CONTRIBUTING.md`, `SECURITY.md` (GitHub advisories → `security@poli0981.dev`; the repo documents no address yet), docs/14 (WS2) and any doc that names CodeQL or SonarCloud. `CHANGELOG.md` keeps its history. Issue templates → GitLab (runbook §3.4).
|
||||
|
||||
## Secrets
|
||||
|
||||
The inventory found only `SONAR_TOKEN` (drop). Create (user level): R2 keys + `R2_ACCOUNT_ID`.
|
||||
@@ -0,0 +1,27 @@
|
||||
# youtube-auto-post — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `40083c9`. Profile: Python bot that posts new YouTube uploads to Discord, Bluesky, Mastodon and Telegram from a scheduled workflow (runbook §5.5). No SECURITY.md or CONTRIBUTING.md. Shared decisions: [README](README.md).
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- **YA1 — how often it posts:** once a day at **`47 14 * * *`** (21:47 Vietnam). A video can wait up to a day before it is posted: the price of a schedule on the PC (runbook §7 item 4). README says so.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `notify.yml` | 3× daily; checks out the code and the `state` branch, runs `python scripts/notify.py`, commits the posted-video state and pushes it to `state` (`contents: write`) | Cron per YA1. The push now goes to Gitea with the job token; keep `contents: write` on that job only. Create the `state` branch on Gitea if the import did not bring it |
|
||||
| `ci.yml` | tests, Qodana (`qodana-action`), Sonar, upstream artifact actions, `checks` permission | Move; Gitea artifact actions; remove Sonar (D1); Qodana → a job calling `reusable-qodana.yml` (linter from `qodana.yaml`) |
|
||||
| `release.yml` | tag push → ops `announce-release.yml@main`, `secrets: inherit` | Path `.gitea/workflows/announce-release.yml@<ops-sha>` + `ops_ref`; secrets explicitly (runbook §3.2 item 3; Gitea also runs `inherit`) |
|
||||
| `announce-release.yml` | ops caller `@main`, `secrets: inherit` | Same |
|
||||
| `notify-ci-failure.yml` | ops caller `@main`, `secrets: inherit` | Same; `DISCORD_CI_WEBHOOK` explicitly |
|
||||
|
||||
Add a caller of the ops `security.yml` (`python: true`, cron **`47 15 * * 4`**). `.github/dependabot.yml` → delete; add `renovate.json`.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`README.md` (2 GitHub links, 1 `githubusercontent` image or badge), `scripts/config.py` (1: check whether a posted message links to the repo). `changelog/1.x.md` keeps its history. Add a short SECURITY.md (e-mail only) and the "Where things live" section (runbook §3.4).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `YOUTUBE_CHANNEL_ID`, `DISCORD_WEBHOOK_URL`, `BLUESKY_HANDLE`, `BLUESKY_APP_PASSWORD`, `MASTODON_INSTANCE_URL`, `MASTODON_ACCESS_TOKEN`, `TELEGRAM_BOT_TOKEN`, `TELEGRAM_CHAT_ID`, `QODANA_TOKEN`, and the Discord webhooks the ops callers need. Drop `SONAR_TOKEN`.
|
||||
@@ -0,0 +1,92 @@
|
||||
# youtube-generator — migration guide
|
||||
|
||||
> Written 2026-11-23 against `main` @ `d7e2876` (local clone `E:\youtube`, Gitea `poli0981/youtube-generator`). Profile: YTDescGen, React/Vite web app on Cloudflare Workers (`ytgenerator.stream`, Turnstile gate) + Tauri 2 desktop (no updater) + Android APK (runbook §5.2, §5.3). Maintenance mode. Shared decisions: [README](README.md).
|
||||
|
||||
**Done 2026-11-26.** The migration merged as Gitea #2 (`6c0614d`), the dependency fold as #3 and the release
|
||||
commit as #4; tagged and released as **v1.7.0** (Windows, Linux, Android on R2; no macOS, D9). The website deploys
|
||||
from the CI `deploy` job. What the move found:
|
||||
|
||||
- **Gitea's `main` matched `github/main`** (`d7e2876`): nothing to restore. Until #2 merged, the GitHub-era
|
||||
`.github/workflows` still ran on Gitea for PRs (`maintenance-triage.yml` ran from `main` on `pull_request_target`);
|
||||
harmless, gone with the merge. Renovate's onboarding PR (#1) was closed: #2 adds `renovate.json` with this repo's
|
||||
rules (majors via the Dependency Dashboard, Tauri's npm packages and crates in one group, i18next held below
|
||||
26.7 for the bundle budget, the TypeScript aliases and runtimes by hand, glib and Tauri's Gradle template off).
|
||||
- **The runner queue**: #2's checks waited ~1.5 h behind free-games-itchio-list's `refresh` scan (13:49 UTC) and the
|
||||
catalog jobs after it; every push to a PR re-queues its whole check set at the back. D15's Docker-only runner would
|
||||
have taken the ubuntu jobs. Expect an evening PR to take hours.
|
||||
- **Release dry run from a branch**: Gitea's "Run workflow" menu lists only the workflows of the default branch, so a
|
||||
new `release.yml` cannot be dispatched from the UI before it merges. The web route works from the maintainer's
|
||||
signed-in browser: `POST /{owner}/{repo}/actions/run?workflow=release.yml` with `ref=refs/heads/<branch>` and the
|
||||
page's `_csrf` (no token needed). A dispatched run writes no commit status (runbook §6); watch it with
|
||||
`GET /repos/{owner}/{repo}/actions/runs/{id}/jobs`, which answers without a token for a public repo.
|
||||
- **The committed Android project calls the cargo CLI**: `src-tauri/gen/android` is in git here (not generated in the
|
||||
job, as in the catalog repos), and its `buildSrc/.../BuildTask.kt` runs `cargo tauri android android-studio-script`.
|
||||
The npm CLI alone fails in Gradle with "no such command: `tauri`"; the job installs `tauri-cli` at exactly the npm
|
||||
CLI's version (`cargo install tauri-cli --version "=<package.json version>" --locked`) and builds with
|
||||
`cargo tauri android build --apk` (universal APK, signed by Gradle through `keystore.properties`).
|
||||
- **The keystore secret was missing on Gitea**: `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD` and
|
||||
`ANDROID_STORE_PASSWORD` had been carried over, `ANDROID_KEYSTORE_BASE64` had not. The keystore was still on the PC
|
||||
(`ytdescgen-release.jks`), so the maintainer added it and the APK keeps its signing key (certificate SHA-256
|
||||
`a099a450…`): installed apps update in place. Check all four before a Tauri repo's first Android release.
|
||||
- **gitleaks**: one non-secret, the Cloudflare Web Analytics beacon token (public in every page) in
|
||||
`build-plugins/web-only.ts` and its test, in `.gitleaksignore`.
|
||||
- **osv-scanner and cargo-deny on the first run**: six RustSec advisories with patch releases (url 2.5.9, cookie
|
||||
0.18.3, tokio 1.51.6, rustix 1.1.6, event-listener 5.4.2, anyhow 1.0.103), taken with `cargo update -p --precise`.
|
||||
The Tauri-stack advisories nobody fixes yet (glib 0.18, the zbus crates, proc-macro-error, chrono) are in
|
||||
`src-tauri/osv-scanner.toml` only: cargo-deny's default scopes (`unmaintained = "workspace"`, unsound likewise)
|
||||
never meet them, and listing them in `deny.toml` just prints `advisory-not-detected` warnings.
|
||||
- **qodana-rust 2026.3-eap, once its bootstrap worked** (dhi.io pin, 25-minute timeout, as free-steam-games-list),
|
||||
reported 9 critical problems rustc and clippy do not have: `20 * 1024 * 1024` in a `u64` const read as a
|
||||
`Duration` (RsTypeCheck), `file.metadata()` then `file.take()` read as a use after move (RsBorrowChecker), a
|
||||
`usize` read as a `toml_parser::Span`, and unresolved macro paths. RsTypeCheck, RsBorrowChecker and RsUnresolvedPath
|
||||
are the linter's copy of the compiler; they are excluded project-wide, since `rust.yml` builds with rustc and
|
||||
clippy `-D warnings`. Write the bootstrap's `printf '…\n…'` with an editor, not through a shell heredoc: the `\n`
|
||||
escapes became real newlines once and the YAML stopped parsing.
|
||||
- **Local tooling without Docker**: actionlint + shellcheck (pinned binaries, as ops-lint) and zizmor `--offline`
|
||||
from a hash-locked `.github/requirements-ci.txt` (also `reuse`), compiled on Windows for the Linux job with
|
||||
`uv pip compile --generate-hashes --python-platform x86_64-manylinux_2_28`. The PR title check is bash on the
|
||||
event payload (`amannn/action-semantic-pull-request` asks GitHub's API).
|
||||
- **The deploy job** proves a deploy without passing the Turnstile gate: it reads the new entry chunk from
|
||||
`dist/index.html` and waits for `https://ytgenerator.stream/assets/<chunk>.js` to answer 200 (assets are public).
|
||||
`setup-node` logs "API rate limit exceeded" while fetching its version manifest from GitHub without a token, then
|
||||
falls back; harmless.
|
||||
- **Gitea's artifact service timed out twice** ("Failed to CreateArtifact … Request timeout", five attempts): Opengrep's
|
||||
SARIF upload on `main`, and the v1.7.0 tag's Windows installers after a good build. "Re-run failed jobs" re-ran the
|
||||
job and the skipped `assemble` → `publish` → `release` chain in the same run, with the Linux and Android artifacts
|
||||
of the first attempt still there; R2 then got all six files, `SHA256SUMS` and the APK alias.
|
||||
- **The release itself**: draft checked (all 8 links 200 with `curl -I`), short highlights added, published in the UI;
|
||||
`announce-release.yml` dispatched with `tag=v1.7.0` (publishing CI's draft fires nothing, as in FG4) posted to both
|
||||
Discord webhooks (HTTP 204).
|
||||
- **Legal text**: TERMS and PRIVACY name the Gitea releases page and `releases.poli0981.dev` (Cloudflare, named in
|
||||
the policy) instead of GitHub; not a material change, so the consent version stays 2 (as FG5). The in-app links
|
||||
(About, "Report a bug") open Gitea and the GitLab mirror (Bug template); Wiki, Discussions and GitHub Sponsors went.
|
||||
|
||||
## Decided (2026-11-23)
|
||||
|
||||
- D3: a deploy job with `wrangler deploy` on `main` pushes. D9: no macOS bundles. D10: the Android SDK is installed in the job. D11: `pages-migration.yml` goes with `migration-page/`.
|
||||
- **Qodana Rust:** in Docker on `windows-latest` (`within-docker: true`); if the image does not run under Docker Desktop on the PC (**VERIFY**), the Rust project goes and clippy stays.
|
||||
|
||||
## Workflows (`.github/workflows` → `.gitea/workflows`)
|
||||
|
||||
| File | Today | Do |
|
||||
|---|---|---|
|
||||
| `ci.yml` | web build/test, Sonar, upstream artifact actions | Move; Gitea artifact actions; remove Sonar (D1); add the `wrangler deploy` job on `main` pushes (D3) |
|
||||
| `compliance.yml` | licence/legal checks on PRs and pushes, uses `secrets.GITHUB_TOKEN` | Move; if the token only feeds a GitHub API call, port that call (README "gh → Gitea API") or drop it |
|
||||
| `rust.yml` | Tauri shell checks on change + weekly `41 4 * * 1` | Move; cron → **`53 15 * * 1`** |
|
||||
| `security.yml` (local) | actionlint (docker image), zizmor, dependency review, `id-token` | Keep actionlint + zizmor on the `.gitea/workflows` files (zizmor with `online-audits: false`, `advanced-security: false`); drop dependency review and `id-token` (D7); cron `17 4 * * 1` → **`41 13 * * 2`**. Add a caller of the ops `security.yml` (`node: true`, `rust: true`, cron **`37 13 * * 3`**) for gitleaks, Opengrep and osv-scanner |
|
||||
| `qodana.yml` | `qodana-action`: TS native (`qodana.yaml`, `QODANA_TOKEN_TS_JS`) + Rust Docker (`src-tauri/qodana.yaml`, `QODANA_TOKEN_RUST`) | Two callers of `reusable-qodana.yml`: TS (`package-manager: npm`), Rust (`project-dir: src-tauri`, `runs-on: windows-latest`, `within-docker: true`), each with its token and `artifact-name` |
|
||||
| `release-desktop.yml` | `tauri-action` on a matrix incl. macOS, GitHub release, `GITHUB_TOKEN` | Tauri CLI on `windows-latest` (+ Linux bundles on `ubuntu-latest` with the webkit2gtk packages installed in the job); no macOS (D9). Bundles + SHA256SUMS to R2 with `publish-r2.yml` (`app: youtube-generator`, `<version>/…`, no feed: no updater); Gitea release with links |
|
||||
| `release-android.yml` | signed APK (`ANDROID_KEYSTORE_BASE64`, …), GitHub release, upstream `upload-artifact` | D10 for the SDK; APK to R2 `youtube-generator/<version>/…` plus a stable alias `youtube-generator-latest.apk` (cache-bypassed name, runbook §1); Gitea artifact action. Keystore secrets only in the tag/dispatch job (rule 10) |
|
||||
| `announce-release.yml`, `notify-ci-failure.yml`, `notify-release-pipeline.yml` | ops callers `@main` (old `.github/workflows` path); `announce-release.yml` also passes `GITHUB_TOKEN` | `poli0981/.github/.gitea/workflows/<x>.yml@<ops-sha>` + `ops_ref`; drop the `GITHUB_TOKEN` secret (the reusable uses the job token) |
|
||||
| `maintenance-triage.yml` | `issues` + `pull_request_target` + `github-script` | **Delete** (D2) |
|
||||
| `pages-migration.yml` | GitHub Pages notice page (`migration-page/`) | **Delete** (D11) with `migration-page/` and its test, unless you want to keep the backup-handoff page somewhere else |
|
||||
|
||||
`.github/dependabot.yml` → delete; add `renovate.json`. `.github/FUNDING.yml` is GitHub-only.
|
||||
|
||||
## Links and docs
|
||||
|
||||
`CHANGELOG.md` keeps its history. In the app: `src/config/about.ts` (7), `build-plugins/legal-docs.ts` (2) with `tests/build/legal-docs.test.ts`. `src-tauri/tauri.conf.json` has a `githubusercontent` URL: check what it loads. Docs: `README.md` (13), `.github/ISSUE_TEMPLATE/` (`config.yml` 4, `option_request.yml`, `accessibility.yml`, `translation.yml`), `MAINTAINERS.md` (4), `CONTRIBUTING.md` (3), `docs/FEATURES.md` (3), `docs/HOSTING.md`, `docs/PACKAGING.md`, `ACCESSIBILITY.md` + `docs/i18n/vi/ACCESSIBILITY.md`, `PRIVACY.md`, CLAUDE.md (deploy path, CI). `SECURITY.md`: GitHub advisories → `security@poli0981.dev` (already documented).
|
||||
|
||||
## Secrets
|
||||
|
||||
Keep `QODANA_TOKEN_TS_JS`, `QODANA_TOKEN_RUST`, `ANDROID_KEYSTORE_BASE64`, `ANDROID_KEY_ALIAS`, `ANDROID_KEY_PASSWORD`, `ANDROID_STORE_PASSWORD`, `DISCORD_*`. Create (user level): R2 keys + `R2_ACCOUNT_ID`, `CLOUDFLARE_API_TOKEN` + `CLOUDFLARE_ACCOUNT_ID` (D3). Drop `SONAR_TOKEN` and every explicit `GITHUB_TOKEN`.
|
||||
@@ -0,0 +1,177 @@
|
||||
#Requires -Version 7.0
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Chuan bi hang loat repo tren Gitea cho Renovate: them renovate-bot lam collaborator (Write)
|
||||
va tao nhan 'dependencies' + 'security' (runbook §3.5, §4.2).
|
||||
|
||||
.DESCRIPTION
|
||||
Voi tung repo cua -Owner tren Gitea (bo qua repo archived, repo mirror va repo rong):
|
||||
* Neu -Bot chua la collaborator: them voi quyen Write. Thieu buoc nay, Renovate
|
||||
khong thay repo (autodiscover chi liet ke repo bot co quyen day code).
|
||||
* Tao nhan con thieu: 'dependencies' (moi PR cua Renovate) va 'security'
|
||||
(PR va loi OSV). Renovate bo qua nhan khong ton tai ma khong bao loi.
|
||||
Khong bat Actions, khong doi setting nao khac. Chay lai nhieu lan duoc: chi lam phan con thieu.
|
||||
|
||||
Token: Settings > Applications > Generate New Token, quyen
|
||||
repository = Read and Write (collaborator)
|
||||
issue = Read and Write (nhan)
|
||||
user = Read (liet ke repo qua /user/repos)
|
||||
Dat vao bien moi truong GITEA_TOKEN, hoac dan khi script hoi. Xoa token sau khi dung.
|
||||
|
||||
Chay -DryRun truoc de xem se lam gi.
|
||||
|
||||
.EXAMPLE
|
||||
.\gitea-repo-setup.ps1 -DryRun
|
||||
.\gitea-repo-setup.ps1
|
||||
.\gitea-repo-setup.ps1 -Only ticktune,pipdock
|
||||
.\gitea-repo-setup.ps1 -Exclude .github,.profile
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string] $GiteaUrl = 'https://git.poli0981.dev',
|
||||
[string] $Owner = 'poli0981',
|
||||
[string] $Bot = 'renovate-bot',
|
||||
[string[]] $Only = @(),
|
||||
[string[]] $Exclude = @(),
|
||||
[switch] $SkipCollaborator,
|
||||
[switch] $SkipLabels,
|
||||
[switch] $DryRun
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$GiteaUrl = $GiteaUrl.TrimEnd('/')
|
||||
$Api = "$GiteaUrl/api/v1"
|
||||
|
||||
# Nhan Renovate dung (runbook §4.2). Mau giong GitHub de de nhan ra.
|
||||
$Labels = @(
|
||||
[pscustomobject]@{ Name = 'dependencies'; Color = '#0366d6'; Description = 'Dependency updates (Renovate)' },
|
||||
[pscustomobject]@{ Name = 'security'; Color = '#d73a4a'; Description = 'Security fixes (Renovate OSV alerts)' }
|
||||
)
|
||||
|
||||
function Write-Step([string]$Msg) { Write-Host "`n==> $Msg" -ForegroundColor Green }
|
||||
function Write-Warn([string]$Msg) { Write-Host "[!] $Msg" -ForegroundColor Yellow }
|
||||
function Write-Bad ([string]$Msg) { Write-Host "[LOI] $Msg" -ForegroundColor Red }
|
||||
|
||||
# Goi API Gitea, khong nem loi theo HTTP status; tra ve Status + Body de tu xu ly.
|
||||
function Invoke-Api([string]$Method, [string]$Path, $Body = $null) {
|
||||
$params = @{
|
||||
Method = $Method
|
||||
Uri = "$Api$Path"
|
||||
Headers = $Headers
|
||||
SkipHttpErrorCheck = $true
|
||||
StatusCodeVariable = 'apiStatus'
|
||||
}
|
||||
if ($null -ne $Body) {
|
||||
$params.Body = ($Body | ConvertTo-Json)
|
||||
$params.ContentType = 'application/json'
|
||||
}
|
||||
$res = Invoke-RestMethod @params
|
||||
[pscustomobject]@{ Status = [int]$apiStatus; Body = $res }
|
||||
}
|
||||
|
||||
function Get-ApiMessage($Body) {
|
||||
if ($null -ne $Body -and $Body.PSObject.Properties['message']) { return [string]$Body.message }
|
||||
return [string]$Body
|
||||
}
|
||||
|
||||
# Lay het cac trang cua mot API liet ke (Gitea tra toi da 50 muc/trang).
|
||||
function Get-AllPages([string]$Path) {
|
||||
$items = [System.Collections.Generic.List[object]]::new()
|
||||
$sep = if ($Path.Contains('?')) { '&' } else { '?' }
|
||||
for ($page = 1; $page -le 100; $page++) {
|
||||
$r = Invoke-Api GET "$Path${sep}limit=50&page=$page"
|
||||
if ($r.Status -ne 200) { throw "GET $Path (trang $page): HTTP $($r.Status) $(Get-ApiMessage $r.Body)" }
|
||||
$batch = @($r.Body)
|
||||
if ($batch.Count -eq 0) { break }
|
||||
$items.AddRange($batch)
|
||||
}
|
||||
return $items
|
||||
}
|
||||
|
||||
# --- 1. Token --------------------------------------------------------------------
|
||||
Write-Step '1/3 Kiem tra token'
|
||||
$token = $env:GITEA_TOKEN
|
||||
if (-not $token) {
|
||||
$sec = Read-Host 'Dan Gitea access token (Settings > Applications)' -AsSecureString
|
||||
$token = [System.Net.NetworkCredential]::new('', $sec).Password
|
||||
}
|
||||
if (-not $token) { throw 'Chua co token.' }
|
||||
$Headers = @{ Authorization = "token $token"; Accept = 'application/json' }
|
||||
|
||||
$r = Invoke-Api GET '/user'
|
||||
if ($r.Status -ne 200) { throw "Token khong dung duoc (HTTP $($r.Status)): $(Get-ApiMessage $r.Body)" }
|
||||
Write-Host "Token cua '$($r.Body.login)'."
|
||||
if (-not $SkipCollaborator) {
|
||||
$r = Invoke-Api GET "/users/$([Uri]::EscapeDataString($Bot))"
|
||||
if ($r.Status -ne 200) { throw "Khong thay user '$Bot' tren Gitea (HTTP $($r.Status)). Tao bot truoc (runbook §4.2)." }
|
||||
}
|
||||
|
||||
# --- 2. Danh sach repo -------------------------------------------------------------
|
||||
Write-Step "2/3 Liet ke repo cua '$Owner'"
|
||||
$repos = @(Get-AllPages '/user/repos' | Where-Object { $_.owner.login -eq $Owner } | Sort-Object name)
|
||||
$todo = foreach ($repo in $repos) {
|
||||
$why = $null
|
||||
if ($Only.Count -and $repo.name -notin $Only) { continue }
|
||||
if ($repo.name -in $Exclude) { $why = 'loai tru (-Exclude)' }
|
||||
elseif ($repo.archived) { $why = 'archived' }
|
||||
elseif ($repo.mirror) { $why = 'mirror' }
|
||||
elseif ($repo.empty) { $why = 'repo rong' }
|
||||
if ($why) { Write-Host (" bo qua {0,-28} {1}" -f $repo.name, $why); continue }
|
||||
$repo
|
||||
}
|
||||
$todo = @($todo)
|
||||
$repoNames = @($repos | ForEach-Object { $_.name })
|
||||
foreach ($name in $Only) {
|
||||
if ($name -notin $repoNames) { Write-Warn "Khong thay repo '$name' cua $Owner." }
|
||||
}
|
||||
Write-Host "$($todo.Count) repo can kiem tra."
|
||||
|
||||
# --- 3. Collaborator + nhan --------------------------------------------------------
|
||||
Write-Step ('3/3 ' + $(if ($DryRun) { 'DRY RUN: chi in ra viec se lam' } else { 'Cap nhat' }))
|
||||
$summary = foreach ($repo in $todo) {
|
||||
$full = "$Owner/$($repo.name)"
|
||||
$path = "/repos/$([Uri]::EscapeDataString($Owner))/$([Uri]::EscapeDataString($repo.name))"
|
||||
$row = [ordered]@{ Repo = $repo.name; Collaborator = '-'; Labels = '-'; Loi = '' }
|
||||
try {
|
||||
if (-not $SkipCollaborator) {
|
||||
$c = Invoke-Api GET "$path/collaborators/$([Uri]::EscapeDataString($Bot))"
|
||||
if ($c.Status -eq 204) { $row.Collaborator = 'da co' }
|
||||
elseif ($c.Status -eq 404) {
|
||||
if ($DryRun) { $row.Collaborator = 'SE THEM (write)' }
|
||||
else {
|
||||
$p = Invoke-Api PUT "$path/collaborators/$([Uri]::EscapeDataString($Bot))" @{ permission = 'write' }
|
||||
if ($p.Status -ne 204) { throw "them collaborator: HTTP $($p.Status) $(Get-ApiMessage $p.Body)" }
|
||||
$row.Collaborator = 'DA THEM (write)'
|
||||
}
|
||||
}
|
||||
else { throw "kiem tra collaborator: HTTP $($c.Status) $(Get-ApiMessage $c.Body)" }
|
||||
}
|
||||
if (-not $SkipLabels) {
|
||||
$have = @(Get-AllPages "$path/labels" | ForEach-Object { $_.name })
|
||||
$missing = @($Labels | Where-Object { $_.Name -notin $have })
|
||||
$missingNames = ($missing | ForEach-Object { $_.Name }) -join ', '
|
||||
if ($missing.Count -eq 0) { $row.Labels = 'da du' }
|
||||
elseif ($DryRun) { $row.Labels = "SE TAO: $missingNames" }
|
||||
else {
|
||||
foreach ($l in $missing) {
|
||||
$p = Invoke-Api POST "$path/labels" @{ name = $l.Name; color = $l.Color; description = $l.Description }
|
||||
if ($p.Status -ne 201) { throw "tao nhan '$($l.Name)': HTTP $($p.Status) $(Get-ApiMessage $p.Body)" }
|
||||
}
|
||||
$row.Labels = "DA TAO: $missingNames"
|
||||
}
|
||||
}
|
||||
}
|
||||
catch {
|
||||
$row.Loi = "$_"
|
||||
Write-Bad "${full}: $_"
|
||||
}
|
||||
[pscustomobject]$row
|
||||
}
|
||||
|
||||
$summary | Format-Table -AutoSize | Out-Host
|
||||
$failed = @($summary | Where-Object { $_.Loi })
|
||||
if ($failed.Count) { Write-Bad "$($failed.Count) repo loi (xem cot Loi)."; exit 1 }
|
||||
if ($DryRun) { Write-Host 'Dry run xong. Chay lai khong co -DryRun de ap dung.' -ForegroundColor Cyan }
|
||||
else { Write-Host 'Xong. Nho xoa token vua dung (Settings > Applications).' -ForegroundColor Cyan }
|
||||
@@ -0,0 +1,4 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["local>poli0981/renovate-config"]
|
||||
}
|
||||
@@ -0,0 +1,281 @@
|
||||
"""Read-only Gitea-migration inventory of local repos (runbook §3.1).
|
||||
|
||||
Usage, from anywhere:
|
||||
python3 tools/migration-inventory.py [--json OUT.json] [REPO_DIR ...] (default: .)
|
||||
|
||||
Nothing is written inside the repos. For each repo it reports the git state, every workflow
|
||||
(where it lives, triggers, crons and whether they fit 13:00-16:00 UTC, runners, actions that do
|
||||
not work on Gitea, unpinned actions, unsupported permissions, secrets, calls to the ops repo),
|
||||
migration markers (renovate.json, dependabot, SECURITY.md, GitLab templates, ...) and the
|
||||
GitHub references left in tracked files. Needs Python 3.10+; PyYAML is optional (without it,
|
||||
triggers, runners and permissions are not parsed).
|
||||
"""
|
||||
import json
|
||||
import pathlib
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
try:
|
||||
import yaml # PyYAML
|
||||
except ImportError: # pragma: no cover
|
||||
yaml = None
|
||||
|
||||
SKIP_DIRS = {".git", "node_modules", "bin", "obj", "target", "dist", "build", ".svelte-kit", ".next",
|
||||
".astro", ".wrangler", "vendor", ".venv", "venv", "__pycache__", ".idea", ".vs", ".claude",
|
||||
"coverage", ".output", ".turbo", "packages", "out", ".pnpm-store", "TestResults"}
|
||||
TEXT_EXT = {".md", ".json", ".jsonc", ".toml", ".yml", ".yaml", ".cs", ".csproj", ".props", ".targets",
|
||||
".resx", ".xaml", ".ts", ".tsx", ".js", ".mjs", ".cjs", ".svelte", ".astro", ".py", ".rs",
|
||||
".html", ".txt", ".cfg", ".ini", ".xml", ".sh", ".ps1", ".iss", ".nuspec", ".gitmodules"}
|
||||
GH_PATTERNS = {
|
||||
"github.com/poli0981": re.compile(r"github\.com/poli0981(?:org)?\b", re.I),
|
||||
"githubusercontent": re.compile(r"githubusercontent\.com", re.I),
|
||||
"api.github.com": re.compile(r"api\.github\.com", re.I),
|
||||
"github.io": re.compile(r"\.github\.io", re.I),
|
||||
"GithubSource": re.compile(r"GithubSource"),
|
||||
}
|
||||
UNSUPPORTED_PERMS = {"id-token", "statuses", "checks", "deployments", "security-events", "pages", "attestations"}
|
||||
BAD_ACTIONS = {
|
||||
"github/codeql-action": "CodeQL (not on Gitea)",
|
||||
"actions/upload-artifact": "upstream artifact v4 (use christopherhx/gitea-upload-artifact)",
|
||||
"actions/download-artifact": "upstream artifact v4 (use christopherhx/gitea-download-artifact)",
|
||||
"softprops/action-gh-release": "GitHub release action",
|
||||
"ncipollo/release-action": "GitHub release action",
|
||||
"tauri-apps/tauri-action": "tauri-action (build with Tauri CLI + R2)",
|
||||
"cloudflare/wrangler-action": "wrangler-action (use npx wrangler deploy)",
|
||||
"JetBrains/qodana-action": "qodana-action (use Qodana CLI)",
|
||||
"aquasecurity/trivy-action": "trivy-action (removed, supply-chain incident)",
|
||||
"aquasecurity/setup-trivy": "setup-trivy (removed)",
|
||||
"actions/github-script": "github-script (GitHub API)",
|
||||
"actions/configure-pages": "GitHub Pages",
|
||||
"actions/upload-pages-artifact": "GitHub Pages",
|
||||
"actions/deploy-pages": "GitHub Pages",
|
||||
"actions/dependency-review-action": "dependency review (GitHub only)",
|
||||
"actions/attest-build-provenance": "attestations (GitHub only)",
|
||||
"actions/stale": "stale bot",
|
||||
"SonarSource/sonarqube-scan-action": "SonarCloud (dropped)",
|
||||
"SonarSource/sonarcloud-github-action": "SonarCloud (dropped)",
|
||||
}
|
||||
SHA_RE = re.compile(r"@[0-9a-f]{40}\b")
|
||||
|
||||
|
||||
def git(repo, *args):
|
||||
r = subprocess.run(["git", "-C", str(repo), "-c", "core.autocrlf=true", *args],
|
||||
capture_output=True, text=True)
|
||||
return r.stdout.strip()
|
||||
|
||||
|
||||
def walk_text_files(root):
|
||||
"""Tracked files only (git ls-files): build output and reports are not the repo."""
|
||||
listed = git(root, "ls-files", "-z")
|
||||
if listed:
|
||||
for rel in listed.split("\0"):
|
||||
p = root / rel
|
||||
if rel and (p.suffix.lower() in TEXT_EXT or p.name in {"Dockerfile", ".gitmodules", "CODEOWNERS"}):
|
||||
try:
|
||||
if p.is_file() and p.stat().st_size <= 2_000_000:
|
||||
yield p
|
||||
except OSError:
|
||||
pass
|
||||
return
|
||||
stack = [root]
|
||||
while stack:
|
||||
d = stack.pop()
|
||||
try:
|
||||
entries = list(d.iterdir())
|
||||
except OSError:
|
||||
continue
|
||||
for p in entries:
|
||||
if p.is_dir():
|
||||
if p.name not in SKIP_DIRS and not p.is_symlink():
|
||||
stack.append(p)
|
||||
elif p.suffix.lower() in TEXT_EXT or p.name in {"Dockerfile", ".gitmodules", "CODEOWNERS"}:
|
||||
try:
|
||||
if p.stat().st_size <= 2_000_000:
|
||||
yield p
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
def triggers_of(doc):
|
||||
on = doc.get("on", doc.get(True)) # PyYAML parses bare `on` as True
|
||||
if isinstance(on, str):
|
||||
return [on], []
|
||||
if isinstance(on, list):
|
||||
return on, []
|
||||
if isinstance(on, dict):
|
||||
crons = [c.get("cron") for c in (on.get("schedule") or []) if isinstance(c, dict)]
|
||||
return list(on.keys()), crons
|
||||
return [], []
|
||||
|
||||
|
||||
def analyse_workflow(path):
|
||||
text = path.read_text(encoding="utf-8", errors="replace")
|
||||
info = {"file": path.name, "triggers": [], "crons": [], "runs_on": [], "uses": [], "unpinned": [],
|
||||
"bad_actions": [], "unsupported_perms": [], "secrets": sorted(set(re.findall(r"secrets\.([A-Za-z0-9_]+)", text))),
|
||||
"vars": sorted(set(re.findall(r"vars\.([A-Za-z0-9_]+)", text))), "ops_calls": [], "name": None,
|
||||
"macos": bool(re.search(r"macos-", text)), "parse_error": None}
|
||||
for line in text.splitlines():
|
||||
m = re.match(r"\s*-?\s*uses:\s*([^\s#]+)", line)
|
||||
if not m:
|
||||
continue
|
||||
ref = m.group(1).strip("'\"")
|
||||
info["uses"].append(ref)
|
||||
base = ref.split("@")[0]
|
||||
if "poli0981/.github/" in ref:
|
||||
info["ops_calls"].append(ref)
|
||||
elif not ref.startswith("./") and not ref.startswith("$/") and not ref.startswith("docker://") \
|
||||
and not SHA_RE.search(ref):
|
||||
info["unpinned"].append(ref)
|
||||
for bad, why in BAD_ACTIONS.items():
|
||||
if base.lower().startswith(bad.lower()):
|
||||
info["bad_actions"].append(f"{base}: {why}")
|
||||
if yaml:
|
||||
try:
|
||||
doc = yaml.safe_load(text) or {}
|
||||
info["name"] = doc.get("name")
|
||||
info["triggers"], info["crons"] = triggers_of(doc)
|
||||
perms = []
|
||||
if isinstance(doc.get("permissions"), dict):
|
||||
perms += list(doc["permissions"].keys())
|
||||
for job in (doc.get("jobs") or {}).values():
|
||||
if not isinstance(job, dict):
|
||||
continue
|
||||
ro = job.get("runs-on")
|
||||
if ro is not None:
|
||||
info["runs_on"].append(ro if isinstance(ro, str) else json.dumps(ro))
|
||||
if isinstance(job.get("permissions"), dict):
|
||||
perms += list(job["permissions"].keys())
|
||||
info["unsupported_perms"] = sorted(set(perms) & UNSUPPORTED_PERMS)
|
||||
info["triggers"] = [str(t) for t in info["triggers"]]
|
||||
except Exception as e: # noqa: BLE001
|
||||
info["parse_error"] = str(e)[:200]
|
||||
info["runs_on"] = sorted(set(info["runs_on"]))
|
||||
return info
|
||||
|
||||
|
||||
def detect_stack(root):
|
||||
s = []
|
||||
names = {p.name for p in root.iterdir()}
|
||||
tracked = git(root, "ls-files").splitlines()
|
||||
if any(t.endswith((".sln", ".slnx", ".csproj")) for t in tracked):
|
||||
s.append("dotnet")
|
||||
if any(t.endswith("tauri.conf.json") for t in tracked):
|
||||
s.append("tauri")
|
||||
if "package.json" in names:
|
||||
pkg = (root / "package.json").read_text(encoding="utf-8", errors="replace")
|
||||
for fw in ("wxt", "@sveltejs/kit", "astro", "react", "vite", "svelte"):
|
||||
if f'"{fw}"' in pkg:
|
||||
s.append(f"node:{fw}")
|
||||
break
|
||||
else:
|
||||
s.append("node")
|
||||
if "Cargo.toml" in names or (root / "src-tauri" / "Cargo.toml").exists():
|
||||
s.append("rust")
|
||||
if "pyproject.toml" in names or "requirements.txt" in names:
|
||||
s.append("python")
|
||||
if "pubspec.yaml" in names:
|
||||
s.append("flutter")
|
||||
if "go.mod" in names:
|
||||
s.append("go")
|
||||
if names & {"wrangler.jsonc", "wrangler.json", "wrangler.toml"}:
|
||||
s.append("workers")
|
||||
return s
|
||||
|
||||
|
||||
def inventory(root):
|
||||
root = pathlib.Path(root).resolve()
|
||||
r = {"repo": root.name, "branch": git(root, "branch", "--show-current"),
|
||||
"dirty": [l for l in git(root, "status", "--short").splitlines() if l and not l.startswith("?? .claude")],
|
||||
"has_migration_branch": bool(git(root, "branch", "--list", "chore/gitea-migration")),
|
||||
"remote_origin": git(root, "remote", "get-url", "origin"),
|
||||
"stack": detect_stack(root), "workflows": {}, "files": {}, "github_refs": {}, "github_ref_files": {}}
|
||||
for d in (".github/workflows", ".gitea/workflows"):
|
||||
p = root / d
|
||||
if p.is_dir():
|
||||
r["workflows"][d] = [analyse_workflow(f) for f in sorted(p.iterdir())
|
||||
if f.suffix in (".yml", ".yaml")]
|
||||
checks = {
|
||||
"dependabot": ".github/dependabot.yml", "renovate.json": "renovate.json",
|
||||
"SECURITY.md": "SECURITY.md", "CONTRIBUTING.md": "CONTRIBUTING.md", "CLAUDE.md": "CLAUDE.md",
|
||||
"qodana.yaml": "qodana.yaml", "deny.toml": "deny.toml", "gitlab_issue_templates": ".gitlab/issue_templates",
|
||||
"gitlab_mr_templates": ".gitlab/merge_request_templates", "gh_issue_templates": ".github/ISSUE_TEMPLATE",
|
||||
"gh_pr_template": ".github/pull_request_template.md", "CODEOWNERS": ".github/CODEOWNERS",
|
||||
"FUNDING": ".github/FUNDING.yml", "gitea_issue_templates": ".gitea/ISSUE_TEMPLATE",
|
||||
}
|
||||
for k, rel in checks.items():
|
||||
r["files"][k] = (root / rel).exists()
|
||||
sec = root / "SECURITY.md"
|
||||
if sec.exists():
|
||||
t = sec.read_text(encoding="utf-8", errors="replace")
|
||||
r["files"]["SECURITY_mentions_github_advisory"] = bool(re.search(r"security/advisories|private vulnerability|Report a vulnerability", t, re.I))
|
||||
r["files"]["SECURITY_mentions_security_at"] = "security@poli0981.dev" in t
|
||||
emails = set()
|
||||
for f in walk_text_files(root):
|
||||
try:
|
||||
t = f.read_text(encoding="utf-8", errors="replace")
|
||||
except OSError:
|
||||
continue
|
||||
rel = str(f.relative_to(root)).replace("\\", "/")
|
||||
for key, rx in GH_PATTERNS.items():
|
||||
n = len(rx.findall(t))
|
||||
if n:
|
||||
r["github_refs"][key] = r["github_refs"].get(key, 0) + n
|
||||
r["github_ref_files"].setdefault(key, []).append(f"{rel}:{n}")
|
||||
emails.update(re.findall(r"[A-Za-z0-9._%+-]+@poli0981\.dev", t))
|
||||
r["emails"] = sorted(emails)
|
||||
for k in r["github_ref_files"]:
|
||||
r["github_ref_files"][k] = sorted(r["github_ref_files"][k], key=lambda s: -int(s.rsplit(":", 1)[1]))[:25]
|
||||
return r
|
||||
|
||||
|
||||
def cron_in_window(expr):
|
||||
"""True when every hour of a 5-field cron is inside 13-15 (13:00-16:00 UTC) and the minute is fixed."""
|
||||
parts = (expr or "").split()
|
||||
if len(parts) != 5 or not parts[0].isdigit():
|
||||
return False
|
||||
hours = parts[1].split(",")
|
||||
return all(h.isdigit() and 13 <= int(h) <= 15 for h in hours)
|
||||
|
||||
|
||||
def main():
|
||||
args = sys.argv[1:]
|
||||
out = None
|
||||
if args[:1] == ["--json"]:
|
||||
out, args = pathlib.Path(args[1]), args[2:]
|
||||
data = [inventory(p) for p in (args or ["."])]
|
||||
for r in data:
|
||||
for items in r["workflows"].values():
|
||||
for w in items:
|
||||
w["crons_outside_window"] = [c for c in w["crons"] if not cron_in_window(c)]
|
||||
if out:
|
||||
out.write_text(json.dumps(data, indent=1, default=str), encoding="utf-8")
|
||||
for r in data:
|
||||
wf = r["workflows"]
|
||||
print(f"\n## {r['repo']} [{', '.join(r['stack'])}] branch={r['branch']} migration-branch={r['has_migration_branch']} dirty={len(r['dirty'])}")
|
||||
for d, items in wf.items():
|
||||
print(f" {d}: {len(items)} workflows")
|
||||
for w in items:
|
||||
flags = []
|
||||
if w["crons"]:
|
||||
flags.append("cron=" + ",".join(w["crons"]))
|
||||
if w["crons_outside_window"]:
|
||||
flags.append("CRON-OUTSIDE-13-16-UTC")
|
||||
if w["bad_actions"]:
|
||||
flags.append("BAD=" + "; ".join(sorted(set(w["bad_actions"]))))
|
||||
if w["unpinned"]:
|
||||
flags.append(f"unpinned={len(w['unpinned'])}")
|
||||
if w["unsupported_perms"]:
|
||||
flags.append("perms=" + ",".join(w["unsupported_perms"]))
|
||||
if w["macos"]:
|
||||
flags.append("macOS")
|
||||
if w["ops_calls"]:
|
||||
flags.append("ops=" + ",".join(sorted({c.split('/')[-1] for c in w['ops_calls']})))
|
||||
print(f" - {w['file']}: on={','.join(w['triggers'])} runs-on={','.join(w['runs_on'])} secrets={','.join(w['secrets'])} {' '.join(flags)}")
|
||||
print(" files: " + ", ".join(k for k, v in r["files"].items() if v))
|
||||
print(" github refs: " + json.dumps(r["github_refs"]))
|
||||
print(" emails: " + ", ".join(r["emails"]))
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in new issue
Block a user