Skip to content

chore: refresh public subscription feed #14

chore: refresh public subscription feed

chore: refresh public subscription feed #14

Workflow file for this run

name: Release Feed Snapshot
on:
push:
branches:
- main
paths:
- "output/clash.yaml"
- "output/singbox.json"
- "output/v2ray-base64.txt"
- "output/status.json"
workflow_dispatch:
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: "true"
permissions:
contents: write
actions: write
concurrency:
group: public-feed-release
cancel-in-progress: false
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Build release metadata
id: meta
run: |
stamp="$(date -u +'%Y-%m-%d %H:%M:%S UTC')"
tag="feed-$(date -u +'%Y%m%d-%H%M%S')"
echo "stamp=$stamp" >> "$GITHUB_OUTPUT"
echo "tag=$tag" >> "$GITHUB_OUTPUT"
- name: Fetch previous snapshot status
env:
GH_TOKEN: ${{ github.token }}
run: |
mkdir -p .tmp
latest_status_url="$(gh api repos/${{ github.repository }}/releases/latest --jq '.assets[] | select(.name=="status.json") | .browser_download_url' 2>/dev/null || true)"
if [ -n "$latest_status_url" ]; then
curl -fsSL "$latest_status_url" -o .tmp/previous-status.json
fi
- name: Build release notes
run: |
python3 scripts/build_release_notes.py \
--current output/status.json \
--previous .tmp/previous-status.json \
> .tmp/release-notes.md
- name: Create snapshot release
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release create "${{ steps.meta.outputs.tag }}" \
output/clash.yaml \
output/singbox.json \
output/v2ray-base64.txt \
output/status.json \
--title "Feed Snapshot ${{ steps.meta.outputs.stamp }}" \
--notes-file .tmp/release-notes.md
- name: Dispatch amplify workflow
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api \
-X POST \
repos/${{ github.repository }}/actions/workflows/release-amplify.yml/dispatches \
-f ref=${{ github.ref_name }}