From 0640b427588ba5452be4e253292ec02e1b887ff6 Mon Sep 17 00:00:00 2001 From: BigCoke233 Date: Wed, 28 Jan 2026 20:43:14 +0800 Subject: chore: migrate GitHub Actions to Forgejo also: - remove unused workflows - remove GitHub issue templates --- .forgejo/workflows/extract-data.yml | 43 +++++++++++++++++ .forgejo/workflows/fetch-linkding-rss.yml | 52 ++++++++++++++++++++ .forgejo/workflows/fetch-webmentions.yml | 56 ++++++++++++++++++++++ ...212\225\347\250\277\346\250\241\346\235\277.md" | 14 ------ .github/workflows/build-unocss.yml | 35 -------------- .github/workflows/extract-data.yml | 43 ----------------- .github/workflows/fetch-linkding-rss.yml | 52 -------------------- .github/workflows/fetch-webmentions.yml | 56 ---------------------- 8 files changed, 151 insertions(+), 200 deletions(-) create mode 100644 .forgejo/workflows/extract-data.yml create mode 100644 .forgejo/workflows/fetch-linkding-rss.yml create mode 100644 .forgejo/workflows/fetch-webmentions.yml delete mode 100644 ".github/ISSUE_TEMPLATE/\346\212\225\347\250\277\346\250\241\346\235\277.md" delete mode 100644 .github/workflows/build-unocss.yml delete mode 100644 .github/workflows/extract-data.yml delete mode 100644 .github/workflows/fetch-linkding-rss.yml delete mode 100644 .github/workflows/fetch-webmentions.yml diff --git a/.forgejo/workflows/extract-data.yml b/.forgejo/workflows/extract-data.yml new file mode 100644 index 00000000..6f40be55 --- /dev/null +++ b/.forgejo/workflows/extract-data.yml @@ -0,0 +1,43 @@ +name: Extract Data from Content + +on: + push: + branches: + - master + paths: + - 'content/**/*.md' + - 'scripts/*.go' + workflow_dispatch: + +# Prevent concurrent runs to avoid conflicts +concurrency: + group: data-extraction + cancel-in-progress: true + +jobs: + extract-data: + name: Extract Data from Content + runs-on: docker + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version: '1.21' + + - name: Extract highlights + run: go run scripts/extract_highlights.go + + - name: Generate external link rank + run: go run scripts/get_external_link_rank.go + + - name: Generate internal link graph + run: go run scripts/get_internal_link_graph.go + + - name: Commit all data + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: 'chore: update data from scripts' + file_pattern: 'data/highlights.json data/externallinks.json static/link-graph.json' diff --git a/.forgejo/workflows/fetch-linkding-rss.yml b/.forgejo/workflows/fetch-linkding-rss.yml new file mode 100644 index 00000000..5442866a --- /dev/null +++ b/.forgejo/workflows/fetch-linkding-rss.yml @@ -0,0 +1,52 @@ +name: Fetch Linkding RSS Feed + +on: + schedule: + # Run daily at 2 AM UTC + - cron: '0 2 * * *' + workflow_dispatch: # Allow manual triggering + +jobs: + fetch-rss: + runs-on: docker + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Create data directory if it doesn't exist + run: mkdir -p data + + - name: Fetch RSS feed + run: | + curl -s "https://links.eltr.ac/feeds/shared?limit=12" -o data/linkding.xml + + - name: Check if file was downloaded successfully + run: | + if [ ! -f data/linkding.xml ]; then + echo "Error: RSS feed file not downloaded" + exit 1 + fi + + # Check if file contains valid XML content + if ! grep -q " data/webmentions.json + + - name: Commit if changed + run: | + if git diff --quiet; then + echo "No changes" + exit 0 + fi + + git config user.name "github-actions" + git config user.email "github-actions@github.com" + git add data/webmentions.json + git commit -m "chore: update webmentions" + git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git diff --git "a/.github/ISSUE_TEMPLATE/\346\212\225\347\250\277\346\250\241\346\235\277.md" "b/.github/ISSUE_TEMPLATE/\346\212\225\347\250\277\346\250\241\346\235\277.md" deleted file mode 100644 index c8a3d2a2..00000000 --- "a/.github/ISSUE_TEMPLATE/\346\212\225\347\250\277\346\250\241\346\235\277.md" +++ /dev/null @@ -1,14 +0,0 @@ ---- -name: 投稿模板 -about: 向稻草人周刊投稿 -title: "[投稿] " -labels: 投稿 -assignees: BigCoke233 - ---- - -## 原文链接 - -## 投稿栏目 - -## 投稿理由 diff --git a/.github/workflows/build-unocss.yml b/.github/workflows/build-unocss.yml deleted file mode 100644 index b6768411..00000000 --- a/.github/workflows/build-unocss.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Build UnoCSS - -on: - push: - -jobs: - build-uno: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: pnpm/action-setup@v4 - with: - version: 9 - - - uses: actions/setup-node@v4 - with: - node-version: 20 - cache: pnpm - - - name: Install deps - run: pnpm install --frozen-lockfile - - - name: Build UnoCSS - run: pnpm run build:uno:prod - - - name: Commit if changed - run: | - git config user.name "github-actions[bot]" - git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - - git add . - git commit -m "chore(unocss): rebuild styles" || exit 0 - git push diff --git a/.github/workflows/extract-data.yml b/.github/workflows/extract-data.yml deleted file mode 100644 index 968ab16c..00000000 --- a/.github/workflows/extract-data.yml +++ /dev/null @@ -1,43 +0,0 @@ -name: Extract Data from Content - -on: - push: - branches: - - master - paths: - - 'content/**/*.md' - - 'scripts/*.go' - workflow_dispatch: - -# Prevent concurrent runs to avoid conflicts -concurrency: - group: data-extraction - cancel-in-progress: true - -jobs: - extract-data: - name: Extract Data from Content - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Setup Go - uses: actions/setup-go@v5 - with: - go-version: '1.21' - - - name: Extract highlights - run: go run scripts/extract_highlights.go - - - name: Generate external link rank - run: go run scripts/get_external_link_rank.go - - - name: Generate internal link graph - run: go run scripts/get_internal_link_graph.go - - - name: Commit all data - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: 'chore: update data from scripts' - file_pattern: 'data/highlights.json data/externallinks.json static/link-graph.json' diff --git a/.github/workflows/fetch-linkding-rss.yml b/.github/workflows/fetch-linkding-rss.yml deleted file mode 100644 index bdcdffb4..00000000 --- a/.github/workflows/fetch-linkding-rss.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Fetch Linkding RSS Feed - -on: - schedule: - # Run daily at 2 AM UTC - - cron: '0 2 * * *' - workflow_dispatch: # Allow manual triggering - -jobs: - fetch-rss: - runs-on: ubuntu-latest - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Create data directory if it doesn't exist - run: mkdir -p data - - - name: Fetch RSS feed - run: | - curl -s "https://links.eltr.ac/feeds/shared?limit=12" -o data/linkding.xml - - - name: Check if file was downloaded successfully - run: | - if [ ! -f data/linkding.xml ]; then - echo "Error: RSS feed file not downloaded" - exit 1 - fi - - # Check if file contains valid XML content - if ! grep -q " data/webmentions.json - - - name: Commit if changed - run: | - if git diff --quiet; then - echo "No changes" - exit 0 - fi - - git config user.name "github-actions" - git config user.email "github-actions@github.com" - git add data/webmentions.json - git commit -m "chore: update webmentions" - git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git -- cgit v1.2.3