Skip to content

Update pirated-content.txt #28

Update pirated-content.txt

Update pirated-content.txt #28

Workflow file for this run

name: Create Release and Update Branch
on:
workflow_dispatch: # 保留手动触发
push:
branches: [main]
paths:
- 'pirated-content.txt'
- 'pirated-game.txt'
- 'pirated-software.txt'
jobs:
build-and-release:
name: Build, Release, and Push to Branch
runs-on: ubuntu-latest
permissions:
contents: write
steps:
# 检出代码
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
# 获取最新Release标签
- name: Get latest tag
id: get_latest_tag
run: |
LATEST_TAG=$(gh release view --json tagName --jq .tagName || echo "")
echo "tag_name=${LATEST_TAG}" >> $GITHUB_OUTPUT
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# 生成和处理文件
- name: Combine, format, sort, and deduplicate files
run: |
mkdir -p dist
cat pirated-game.txt pirated-content.txt pirated-software.txt | \
awk -F '.' '{
if (NF == 2) {
print "+."$0
} else {
print $0
}
}' | \
sort -d -u > ./dist/pirated-list.txt
echo "Generated pirated-list.txt in ./dist directory"
# 部署到release分支
- name: Deploy to release branch
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: release
folder: dist
clean: true
# 生成发布标签
- name: Generate release tag
run: echo "RELEASE_TAG=$(date +'%Y-%m-%d-%H%M%S')" >> $GITHUB_ENV
# 创建GitHub Release
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
files: ./dist/pirated-list.txt
name: Pirated List - ${{ env.RELEASE_TAG }}
tag_name: ${{ env.RELEASE_TAG }}
body: |
Automated release triggered by source file changes.
This release contains the updated combined list.
prerelease: false