From ffac6fe22ad87e34fe7220f88fae216968d15e91 Mon Sep 17 00:00:00 2001 From: Deivid Soto Date: Wed, 27 May 2026 15:45:38 +0200 Subject: [PATCH 1/2] ci: port workflows from .github/ to .forgejo/ (Forgejo Actions) GitHub torrentclaw org is shadow-banned; CI is hosted at git.torrentclaw.com now. Move workflows into the runner's natively-watched .forgejo/workflows/ tree and adapt steps to run in the available 'docker'-labeled Forgejo runner without GitHub-only tooling (gh CLI, third-party marketplace actions). - Use container: image to ship the toolchain (no actions/setup-* needed). - Drop GitHub-only marketplace actions in favour of upstream installers invoked over curl/apt. - Where a workflow created a GitHub Release (release.yml), substitute the step with a curl call against the Forgejo Releases API (POST /repos///releases). --- {.github => .forgejo}/workflows/ci.yml | 22 ++++----- .forgejo/workflows/release.yml | 68 ++++++++++++++++++++++++++ .github/workflows/release.yml | 41 ---------------- 3 files changed, 79 insertions(+), 52 deletions(-) rename {.github => .forgejo}/workflows/ci.yml (68%) create mode 100644 .forgejo/workflows/release.yml delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/ci.yml b/.forgejo/workflows/ci.yml similarity index 68% rename from .github/workflows/ci.yml rename to .forgejo/workflows/ci.yml index c764d29..c1f6f9e 100644 --- a/.github/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -12,33 +12,33 @@ permissions: jobs: lint-commits: name: Lint commits - runs-on: ubuntu-latest + runs-on: docker + container: + image: docker.io/library/node:22 if: github.event_name == 'pull_request' steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - - uses: actions/setup-node@v4 - with: - node-version: "22" - - name: Install dependencies run: npm ci - name: Validate conventional commits - run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: | + npx commitlint \ + --from ${{ github.event.pull_request.base.sha }} \ + --to ${{ github.event.pull_request.head.sha }} \ + --verbose build-and-test: name: Build & test - runs-on: ubuntu-latest + runs-on: docker + container: + image: docker.io/library/node:22 steps: - uses: actions/checkout@v4 - - uses: actions/setup-node@v4 - with: - node-version: "22" - - name: Install dependencies run: npm ci diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml new file mode 100644 index 0000000..145d200 --- /dev/null +++ b/.forgejo/workflows/release.yml @@ -0,0 +1,68 @@ +name: Release + +on: + push: + tags: + - "v*" + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + runs-on: docker + container: + image: docker.io/library/node:22 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Test + run: npm test + + - name: Publish to npm + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + run: | + # Set authToken explicitly — actions/setup-node was the only consumer + # of registry-url + NODE_AUTH_TOKEN, and we dropped it for Forgejo + # compat. The literal npmjs registry stays the same. + cat > ~/.npmrc </dev/null || echo "") + if [ -n "$prev" ]; then + notes=$(git log --pretty=format:'- %s' "${prev}..${TAG}") + else + notes=$(git log --pretty=format:'- %s' "${TAG}") + fi + body=$(jq -n --arg t "$TAG" --arg n "$notes" \ + '{tag_name:$t, name:$t, body:$n, draft:false, prerelease:false}') + curl -sSf -X POST "$FORGEJO_API/repos/$REPO/releases" \ + -H "Authorization: token $FORGEJO_TOKEN" \ + -H "Content-Type: application/json" \ + -d "$body" >/dev/null || \ + echo "Release may already exist for $TAG" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 8a489af..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,41 +0,0 @@ -name: Release - -on: - push: - tags: - - "v*" - -permissions: - contents: write - -jobs: - release: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - uses: actions/setup-node@v4 - with: - node-version: "22" - registry-url: "https://registry.npmjs.org" - - - name: Install dependencies - run: npm ci - - - name: Build - run: npm run build - - - name: Test - run: npm test - - - name: Publish to npm - run: npm publish - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - - - name: GitHub Release - uses: softprops/action-gh-release@v2 - with: - generate_release_notes: true From a5f867eeea393b0bbef41150c21ca7e235366e92 Mon Sep 17 00:00:00 2001 From: Deivid Soto Date: Wed, 27 May 2026 15:58:47 +0200 Subject: [PATCH 2/2] refactor(ci): point Forgejo URLs at torrentclaw org (post-transfer) Repos were transferred from the deivid user to a dedicated torrentclaw organisation; the workflows reference the org path. --- .forgejo/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.forgejo/workflows/release.yml b/.forgejo/workflows/release.yml index 145d200..79737aa 100644 --- a/.forgejo/workflows/release.yml +++ b/.forgejo/workflows/release.yml @@ -46,7 +46,7 @@ jobs: env: FORGEJO_TOKEN: ${{ secrets.GITHUB_TOKEN }} FORGEJO_API: http://forgejo:3000/api/v1 - REPO: deivid/torrentclaw-mcp + REPO: torrentclaw/torrentclaw-mcp TAG: ${{ github.ref_name }} run: | set -euo pipefail